Baanboard.com

Baanboard.com (http://www.baanboard.com/baanboard/index.php)
-   AFS/DDC/OLE: Function servers (http://www.baanboard.com/baanboard/forumdisplay.php?f=59)
-   -   Purchase Order Generation error from AFS IN ERP_LN FP2 (http://www.baanboard.com/baanboard/showthread.php?t=44055)

som.papai 7th November 2007 07:37

Purchase Order Generation error from AFS IN ERP_LN FP2
 
Hi all,
I am going to generate P.O from ERP_LN FP2 through AFS.
I write this code, to save data in header.

i.buy.from.bp="CDMA00001"
ret_val =stpapi.synchronize.dialog("tdpur4100m000", "add", error)
stpapi.put.field("tdpur4100m900","tdpur400.otbp",i.buy.from.bp)
ret_val = stpapi.insert( "tdpur4100m900", true, error )
stpapi.end.session("tdpur4100m900")

I am getting error "Editable Synchronized Dialog not Started"
at this stpapi.insert( "tdpur4100m900", true, error ) Line.
In LN when I am going to write AFS I always stuck with this problem.


plz help me.
Sudipta Som

_Ralph_ 7th November 2007 18:30

tdpur4100m900 it's a multmain session.

AFS does not work with this kind os sessions.


If you are working with fonts it's better search for a DLL or use DAL's business methods...

som.papai 12th November 2007 09:21

Hi Ralph
Thankx for ur reply.
But i also going to make this through DAL2 , i am getting some error
i also post query in TOOL development.
Solution needed.

Regards
Sudipta Som.

som.papai 12th November 2007 09:40

Hi Ralph,
Sir u says in a previous thread that "tdpurdll1234 - Generate Purchase Order"
But how can i know that what function should I call?
And what is the parameter of of the function?
Because i can not view the script of "tdpurdll1234”.


Regards
Sudipta Som.

som.papai 13th November 2007 08:35

Hi all,
I am able to generate P.O Lines from AFS.
So, i am generating P.O Header from DAL
and P.O Lines from AFS on session tdpur4101m000
thankx.

Regards
Sudipta Som.
:)

kathuria 16th November 2007 23:13

Create PO & LINes by DAL
 
Hi,

DAL Script to Create Purchase Order and Lines.

Code:


********* Header**********************
        dal.new.object("tdpur400")
        dal.set.field("tdpur400.orno", s.orno)
        dal.set.field("tdpur400.otbp", s.bpid)
        dal.set.field("tdpur400.ptbp", s.bpid)
        dal.set.field("tdpur400.cotp", s.cotp)
        dal.set.field("tdpur400.cofc", s.cofc)
        dal.set.field("tdpur400.ccur", s.ccur)
        dal.set.field("tdpur400.odat", s.odat)
        dal.set.field("tdpur400.ddat", s.odat)
        dal.set.field("tdpur400.sbim", s.sbim)
        dal.set.field("tdpur400.refa", s.refa)
        dal.set.field("tdpur400.refb", s.refb)
        dal.set.field("tdpur400.sorn", s.sorn)

        if not isspace(s.cpay) then
                dal.set.field("tdpur400.cpay", s.cpay)
        endif
ret = dal.save.object("tdpur400")
        if (ret < 0) or (len(tdpur400.orno) <> 9) then
                ret = dal.get.error.message(w.err.msg)
                test.str = "Error in Purchase Order Header"
                error.file.generation(s.trid,s.seqn)
                message("Error......!%s", w.err.msg)
        else
                commit.transaction()
        endif

|************************Lines********************
                dal.new.object("tdpur401")
                dal.set.field("tdpur401.orno", l.orno)
                dal.set.field("tdpur401.item", l.item)
                dal.set.field("tdpur401.qoor", l.qoor)
                dal.set.field("tdpur401.cuqp", l.cuni)
                dal.set.field("tdpur401.cwar", l.cwar)

                if (tdpur401.pric = 0) and (l.pric <> 0) then
                        dal.set.field("tdpur401.pric", l.pric)

                        if l.pric<>0 then
                                dal.set.field("tdpur401.porg",tdgen.porg.manual)
                        endif
                endif

                if l.pric = 0 then
                        dal.set.field("tdpur401.oamt", round(l.oamt, 4, 1))
                endif

                if not isspace(l.cprj) then
                        dal.set.field("tdpur401.cprj", l.cprj)
                endif

                if l.pric = 0 then
                        dal.set.field("tdpur401.oamt", round(l.oamt, 4, 1))
                endif

                ret = dal.save.object("tdpur401", db.return.error)

                if (ret >= 0) and (tdpur401.pono <> 0) then
                        commit.transaction()
                else
                        ret=dal.get.error.message(w.err.msg)
                        test.str = "Error in Purchase Order Lines"
                        error.file.generation(s.trid,s.seqn)
                        message("Error......!%s", w.err.msg)
                endif
        endif
}

Regards,
Sanjay Kathuria

som.papai 27th November 2007 13:35

1 Attachment(s)
Hi kathuria,
thankx for ur suggestion.
I am facing some error on Updation of Production Order Quantity.
If i am able to generate the AFS on session ticst0101m100 for update
Quantity it will solve my problem,but i am getting error "Editable Synchronised Dialog Box".
I am able to change the Quantity field in table tisfc001.qrdr through DAL2.
then why this will not Automatically update Net Quantity field in table ticst001.
So, DAL2 does not work like AFS?
if i am able to generate afs it will Automatically update Net Quantity field in table ticst001.

Suggestion needed.

Regards
Sudipta Som

kathuria 30th November 2007 20:36

Tisfc001 Has Dal2
 
Hi,

Table tisfc001 has DAL2 . You can write dal script on this table.You have to check complete procedure. What do you want to do? You may have to update another table same time by DAL2.


Regards,
Sanjay Kumar

som.papai 1st December 2007 08:57

Hi kathuria,
thankx for ur suggestion.

yes i want to update the quantity Production Quantity through DAL2 in table tisfc001. I made it by DAL2 ,but it not Automatically update Net Quantity field in table ticst001.

this is the problem.
u can see the previously attached file, that will describe how i am doing it.

Suggestion needed.

Regards
Sudipta Som

baanspider 3rd January 2009 11:57

price in PO or SO
 
Hi kathuria,

What is the value of l.pric?

Do you have to calculate the price value?
We wish the price to be taken from the price book.
So can this be done using DAL2

thanks n regards


All times are GMT +2. The time now is 05:14.


vB.Sponsors
©2001-2018 - Baanboard.com - Baanforums.com