srinivas
30th January 2002, 07:43
I am trying to make a PO. I was able to insert a record in PO header but I am unable to insert a record in PO lines. When I call tdpur4102s000 and insert values I am not getting any error messages but record is not getting stored. From the processes I can see tdpur4503s000 getting activated but don't know from where this is getting activated.

How can I call the lines session and insert a record?

Regards,
Srinivas

mark_h
30th January 2002, 15:35
In my Create PO session I just ignore tdpur4503s000. After inserting a line I just end the session. I was looking at my session and after I do an insert I check the error message and if it is blank,"Command Cancelled",or "Note:" then I continue. Also I just noticed that I use tdpur4101m000 to call tdpur4107s000, I believe this activates the display session tdpur4503s000.

I would suggest trying to create the PO by hand using exactly what the FS would do and make note of any messages or questions the tdpur4102s000 session may come up with. Maybe you could also post a snippet of the code, that might help someone else answer your problem

We are on Baan 4c3 A&D.

Mark

srinivas
31st January 2002, 09:05
Hi Mark,

Thankyou.

This is the code I am using.
I am getting the correct PO number from header session

Regards,
Srinivas


|****************************************
stpapi.get.field("tdpur4101m000", "tdpur040.orno", po.num)
Message("Generated PO is %s",po.num)

stpapi.put.field("tdpur4102s000", "tdpur041.orno", po.num)
stpapi.put.field("tdpur4102s000", "tdpur041.pono", "10")

stpapi.put.field("tdpur4102s000", "tdpur041.item", item)
stpapi.put.field("tdpur4102s000", "tdpur041.cwar", cwar)
stpapi.put.field("tdpur4102s000", "tdpur041.cuqp", cuqp)
stpapi.put.field("tdpur4102s000", "tdpur041.oqua", oqua)
stpapi.put.field("tdpur4102s000", "base.price", pric)

stpapi.handle.subproc( "tdpur4102s000", "tdind0271s000", "add")
stpapi.continue.process("tdind0271s000", error.msg)
stpapi.end.session("tdind0271s000")

stpapi.end.session("tdind0271s000")

stpapi.put.field("tdpur4102s000", "tdpur041.ddta", str$(exp.date))

stpapi.end.session("tdind0271s000")


stpapi.insert("tdpur4102s000",1,error.msg)
Message("Insert error in tdpur041=%s",error.msg)
stpapi.save("tdpur4102s000",err)

Message("Save error in tdpur041=%s",err)


|Endif

stpapi.end.session("tdpur4101m000")

stpapi.end.session("tdpur4102s000")

mark_h
31st January 2002, 15:38
The one thing I do not see is a link between tdpur4101m000 and tdpur4102s000. I am attaching a zip file with a section of my create PO function server. The zip contains a file called po.txt which is a piece of the overall program. It also contains the libraries that get created using ttstpcreatdll. You will see that I do a find in tdpur4101m000, set tdpur4107s000 as a subprocess of tdpur4101m000, launch 4107s000 from 4101m000 using a continue. I do not promise that this will work for you, but I do not see a link between 4101m000 and the subsession. So it is my guess that may be causing the problem.


Good Luck!

Mark

srinivas
1st February 2002, 11:59
Hi Mark,

The session where we maintain lines in PO (manually) is tdpur4102s000. So I was trying this.

Let me have a close look at your program.

Regards,
Srinivas