-   AFS/DDC/OLE: Function servers (
-   -   Purchase Order Generation error from AFS IN ERP_LN FP2 (

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."CDMA00001"
ret_val =stpapi.synchronize.dialog("tdpur4100m000", "add", error)
ret_val = stpapi.insert( "tdpur4100m900", true, error )

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.

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”.

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

Sudipta Som.

kathuria 16th November 2007 23:13

Create PO & LINes by DAL

DAL Script to Create Purchase Order and Lines.


********* Header**********************"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)
ret ="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"
                message("Error......!%s", w.err.msg)

                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

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

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

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

                ret ="tdpur401", db.return.error)

                if (ret >= 0) and (tdpur401.pono <> 0) then
                        test.str = "Error in Purchase Order Lines"
                        message("Error......!%s", w.err.msg)

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.

Sudipta Som

kathuria 30th November 2007 20:36

Tisfc001 Has Dal2

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.

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.

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 08:57.

©2001-2018 - -