jmawuh
4th August 2004, 15:20
Hi,

I'm having problems with the session tdilc4102s000.

First of all -we are using Baan4c4 with sp 15

first we generate clots in lotcontrol, then we generate sales orders which gets this item on stock. and there is the problem - the session tdilc4102s000 doesent work and the errormessage "Item/serialno does not exist" comes up every time - but when i finish the generated salesorder manually the session tdilc4102s000 works without any problems

- enclused you'll find the part of the code which doesnt work


function long create.sls.order(domain tccuno cuno.or, long grno.or, domain tcitem item.or, domain tdltc.clot clot.or, domain tcqsl1 oqua.or)
{
long retval
string err_msg(40)
string orno.or(6)
string pono.or(4)


if grno.or = 9 then | 9 = Nummernkreis für Rücklieferungen

stpapi.put.field(SornoK, "tdsls040.orno", str$(grno.or)) |Nummernkreis
stpapi.put.field(SornoK, "tdsls040.cuno", str$(cuno.or)) |Kundennummer
stpapi.put.field(SornoK, "tdsls040.cotp", "RL1")

retval = stpapi.insert(SornoK,true, err_msg) |DS einfügen
if not retval then | --> Errormessages ausgeben
while true
stpapi.get.mess.code(SornoK,err_msg)
message(err_msg)
if isspace(err_msg) then
break
endif
error=1

endwhile
stpapi.recover(SornoK,err_msg)
else
|Auftragspositionen anlegen
stpapi.handle.subproc(SornoK, SornoF, "add") |Handler für Subprog erstellen
err_msg = ""
stpapi.get.field(SornoK, "tdsls040.orno", orno.or)
|stpapi.application.option(SornoK, 1, 1, err_msg)
stpapi.continue.process(SornoK, err_msg)

stpapi.put.field(SornoF, "tdsls041.orno", orno.or)
stpapi.put.field(SornoF, "tdsls041.pono", "10")
stpapi.put.field(SornoF, "tdsls041.item", item.or)
stpapi.put.field(SornoF, "tdsls041.oqua", str$(oqua.or))
stpapi.put.field(SornoF, "tdsls041.clot", clot.or)

retval = stpapi.insert(SornoF,true, err_msg)
if not retval then | --> Errormessages ausgeben
while true
stpapi.get.mess.code(SornoF,err_msg)
message(err_msg)
if isspace(err_msg) then
break
endif
error=1

endwhile
stpapi.recover(SornoF,err_msg)

else
|Auslagerung mit MINUS Menge erstellen
stpapi.handle.subproc(SornoF, SIlc, "add") |Handler für Subprog erstellen
err_msg = ""
stpapi.get.field(SornoF, "tdsls041.pono", pono.or)
stpapi.continue.process(SornoF, err_msg)

|stpapi.put.field(SIlc, "tdilc401.koor", str$(tdilc.koob.act.sls))
|stpapi.put.field(SIlc, "tdilc401.orno", orno.or)
stpapi.put.field(SIlc, "tdilc401.pono", pono.or)
|stpapi.put.field(SIlc, "tdilc401.sera", "0")
|stpapi.put.field(SIlc, "tdilc401.serb", "1")
stpapi.put.field(SIlc, "tdilc401.item",item.or)
stpapi.put.field(SIlc, "tdilc401.clot"," clot.or)
stpapi.put.field(SIlc, "tdilc401.qstr", str$(oqua.or))
stpapi.put.field(SIlc, "tdilc401.qsts", str$(oqua.or))
stpapi.put.field(SIlc, "tdilc401.stun", "st")
retval = stpapi.insert(SIlc,true, err_msg)
if not retval then | --> Errormessages ausgeben
while true
stpapi.get.mess.code(SIlc,err_msg)
message(err_msg)
if isspace(err_msg) then
break
endif
error=1

endwhile stpapi.recover(SIlc,err_msg)

else
stpapi.continue.process(SIlc, err_msg)
endif

endif

endif
stpapi.end.session("tdilc4513s000")
stpapi.end.session(SIlc, err_msg)
stpapi.handle.subproc(SornoF, SIlc, "kill")
stpapi.end.session(SornoF, err_msg) | Subsession schliessen
stpapi.handle.subproc(SornoK, SornoF, "kill") | Handler für Subsession zerstören


stpapi.end.session(SornoK, err_msg) | Session schliessen

endif

return(retval)
}


sorry, but all formating has been lost, when i copied the code !!!

Thanx alot

June

mark_h
4th August 2004, 23:06
We do not use these session, but I have some questions - When running the session manually and tdilc4102s000 comes up you insert the data. Do you get this same error message("Item/serialno does not exist")? If you do then - what do you do manually? I am wondering if you can just ignore this error in the function server and continue.

Mark

jmawuh
5th August 2004, 07:46
Hi and thanks for your reply - the error doesn't come up when i manually use the session - this error only comes up if i use a wrong clot - but the generating of the clots works well.

regards

June

mark_h
5th August 2004, 15:43
When this session comes up does it come up in insert or modify mode? I am not sure if this is the case, but one of our function servers just started getting an error every time you ran it. The sub-session started in insert mode, what I did was put a stpapi.save right after the sub-session started. This cleared the error and the code started working again. One thing to try. Also you may need to get an update of your object and stpapi libraries - thought I would mention this. Do you have source code that you could compile in debug mode?

Also what is in the lot after the insert? Something could be resetting it. Other things to try include retval = stpapi.insert(SornoF,false, err_msg) followed by a save. You may also have to re-input the lot after the insert. You can also try save or update instead of insert. These are some things I have had to do in the past.

Mark

jmawuh
5th August 2004, 15:46
hey mark_h - thanks - will try all your hints tomorrow....

regards

Jmawuh

jmawuh
19th August 2004, 10:47
after alot of testing i decided to use the session tdilc1120m000 and tdilc1121m000 to get the items on stock and now it works :) .

I've also generated sales orders for this items with afs and it worked fine, but now i have the problem, that sometimes the user has to change something in this sales order (tdsls4101m000 or tdsls4101s000) - i've tried to use zoom.to - the session opens, but i think this sessions cant import order number- so is there a chance to open with afs - find record and then show the session

ciao

June

mark_h
19th August 2004, 15:30
There is not a method to open the session with AFS - then pop it up on the screen. As far as I know if you set the correct fields then the zoom.to on the tdsls4101s000 session usually should work.

Mark