nileshsamsonite
22nd June 2009, 07:40
Hi,
I have written a AFS script to generate a Purchase Order . I am passing all the required fields . But the purchase price is not updated which is passed as argument. The generated PO contains the default purchase price. I want to generate a PO where PO price should be same to which I am passing as argument.

Here is the code:

f4102s000.put.Purchase_Order(rep.pur.order)
f4102s000.put.Position_Number(hold.pono)
hold.pono = hold.pono + 1
f4102s000.put.tdpur041.item(std.item) |IMP - Convert to STD item
f4102s000.put.Ordered_Quantity(tddps504.pqty) | domain should be tcqrd1
get.FOB.price(sspo.item,sspo.item)
stpapi.put.field( "tdpur4102s000", "tdpur041.pric", str$(hold.price) )
stpapi.handle.subproc("tdpur4102s000", "tdind0271s000", "add")
stpapi.put.field("tdind0271s000", "tdind020.bdat", str$(tddps503.sdat))
stpapi.put.field("tdind0271s000", "tdind020.exci", str$(hold.no)) | Excise applicable
stpapi.put.field("tdind0271s000", "sls.app", str$(hold.no)) | Sales tax applicable
stpapi.put.field("tdind0271s000", "octr.app", str$(hold.no)) | Octroi applicable
stpapi.put.field("tdind0271s000", "tdind020.srtx", str$(hold.no)) | Service Tax
stpapi.insert("tdind0271s000", true, seserr)
if not isspace(seserr) then
message ("Cannot update the Localised data - %s", seserr)
endif
stpapi.end.session("tdind0271s000")
f4102s000.insert(1,err)





Thanks
Nilesh Banait

grzegorz
22nd June 2009, 15:08
I had the same problem some time ago, and in my case it was solved by upgrading Porting Set and applying missing service packs. For me, update purchase price started working on SP18.

nileshsamsonite
23rd June 2009, 07:12
hi grzegorz,

We are having SP 13 . We cannot upgrade to SP 18 in the current scenario. Is there any alternate solution ?

Nilesh

avpatil
26th June 2009, 22:02
I have a question, why do we use AFS for creating a PO, when there exists much simpler way- Just create a Planned PO say INV PO and do a transfer. This I feel is much simpler way of creating a PO and is not depedent upon any form fields.


Arvind Patil

mark_h
28th June 2009, 17:00
You do not necessarily upgrade to SP18 - you can try the portingset and libraries to see if it fixes your problem. Then you might try a new session object. Just keep in might about dependencies and patches.