lbencic
15th July 2002, 23:54
OK stpapi gurus:
Has anyone successfully written a Baan V Sales Order interface, specifically having a problem with the Available to Promise Menu that is called in the code. It's a zoom.to programmed in a library. I wish to choose option '10', which is 'No Action'.
I try:
stpapi.handle.subproc("tdsls4101s000", "tdsls00009047", "10")
and many variations of, but I keep getting the error 'Can't find session or object tdsls00009047"
Has anyone see this before, or has anyone used 'stpapi.handle.subproc' to handle a menu on Baan V? Or..what would the proper way be?
~Vamsi
17th July 2002, 02:05
Lisa,
Send a PM to Gordon/Mark and ekrishna :).
mark_h
17th July 2002, 03:07
Hi Lisa,
I am definitely not a Baan 5 guru - but could it possibly be a stpapi.zoom instead of stpapi.handle .subproc? The reason I say this is that I had one function server (4c3) that the code started a sub-session and stpapi.handle.subproc would not work. I had to use stpapi.zoom to get it to work. Just a wild guess.
I am not sure if either of these will work with a menu that the session code automatically starts. I am curious as what you see in the shell. I am use to seeing the FS pid, the session PID, and then any subsessions. What do you see when the menu launches? If you want to cancel the menu could you possibly just end the session?
Just guessing - Gordon probably already knows the answer, but thought I would ask some questions. I would also like to know the answer to this, so please post it if you figure it out. It was also comforting to see your reply to one of the other posts. I thought I was the only one that did a find/insert/save/find/update to get one complete record inserted into a session. :)
Good Luck!
Mark
gfasbender
17th July 2002, 08:48
OK, I usually try and stay away from posts that can get me in trouble (like a Function server discussion I saw today) or I just can't give a definite answer to. But, here goes....
Mark has asked some good questions that may help out in getting an answer. My thoughts, I do not know how to interrupt a zoom.to(menu) call. I'm not even sure if the API handler executes the call. I would even think that the library calling the menu should check the api.mode variable before making this call. That would solve your problem.
Lisa, I haven't used stpapi.handle.subproc() with the Menu in the sub.prog argument and the Menu Choice option in the action argument before. Maybe instead of the "10", it's looking for "No Action"? Your menu in the call stpapi.handle.subproc("tdsls4101s000", "tdsls00009047", "10") seems to be missing a character, I expected to see 14 characters. Did you include the menu level? This may be why you're getting the error 'Can't find session or object tdsls00009047'. Check the object name in the application directory. Just a couple of ideas.
Have you had an opportunity to put the code (library) in debug mode and see if it's actully hanging at the zoom.to() call?
lbencic
22nd July 2002, 16:40
Thanks for your suggestions - kind of low priority right now as we have this working using other methods. I know the stpapi's are a grey area without the source, so I won't hold you to anything *wink*
I tried many ways of calling the menu, with / without the menu level, etc. I tried the stpapi.zoom, but I don't know where I would put an option. The docs. say the handle.subproc for menu's so that's why I chose that, and zoom is not for Baan V. You never know though!
Anyway, to no avail as of yet. I did debug in detail, and it dies on that call. As I go through I see that there is a variable 'uiok' that is controlling to display that menu, but it is hard coded in the Sales Order Lines code to 'true'. Looks like that needs to be changed to an 'api.mode' dependant variable, and I would be good to go.
Looking into patching and/or alternative logic. I'll post back when I come up with something.
Thanks again for your help
sujoy.sen
18th February 2005, 21:54
Lisa,
Did you ever find a way to successfully handle a menu through stpapi.handle.subproc? I have been trying to write an interface to tdsls4501m000/tdsls4101s000 in Baan 5b but I can't find a way to handle the "Sales Order Lines - Zoom" menu that springs up when I am short on inventory. I would like to be able to specify the "No Action" option also. I have tried the following call (with and without the 'm'):
stpapi.handle.subproc("tdsls4101s000", "mtdsls00009045", "100")
I keep getting the same error: Can't find session or object tdsls00009045.
I was using 100 because that's the sequence number for the No Action option in the menu. Do we need to do a stpapi.handle.subproc for the session that's called by the menu, i.e., tdsls4801s000?
After reading this thread, I thought I would check with you or anyone else who might have any further information on working around this problem.
Thanks,
Sujoy.
mark_h
18th February 2005, 22:22
Sujoy,
Have you seen this post (http://www.baanboard.com/baanboard/showthread.php?t=22694&highlight=Menus) by Doug Stroud? Not sure it is relevant or helps, but it looks like he solved it for one session.
Mark
lbencic
18th February 2005, 22:26
Thanks Mark - I never did come back to it myself, but yes, Doug seems to have solved it.
sujoy.sen
18th February 2005, 22:41
Thanks for the link Mark. I tried Doug's solution, but it didn't work for me. This is what my code looks like:
update.successful = false
stpapi.put.field("tdsls4501m000", "tdsls401.orno", orno)
stpapi.put.field("tdsls4501m000", "tdsls401.pono", str$(pono))
stpapi.put.field("tdsls4501m000", "tdsls401.sqnb", str$(sqnb))
|ret1 = stpapi.change.view("tdsls4501m000", error_msg1)
ret1 = stpapi.find("tdsls4501m000", error_msg1)
if ret1 then
ret2 = stpapi.synchronize.dialog("tdsls4501m000", "modify", error_msg2)
if ret2 then
stpapi.put.field("tdsls4101s000", "tdsls401.cups", cups)
stpapi.put.field("tdsls4101s000", "tdsls401.pric", str$(pric))
stpapi.put.field("tdsls4101s000", "tdsls401.cuqs", cuqs)
stpapi.put.field("tdsls4101s000", "tdsls401.oqua", str$(oqua))
stpapi.handle.subproc("tdsls4101s000", "mtdsls00009045", "10")
ret3 = stpapi.update("tdsls4501m000", true, error_msg3)
| stpapi.handle.subproc("tdsls4101s000", "tdpcg0240s000", "kill")
| stpapi.end.session("tdpcg0240s000", error_msg6)
if ret3 then
update.successful = true
else
handle.error("tdsls4101s000", error_msg3)
ret4 = stpapi.recover("tdsls4101s000", error_msg4)
endif
else
handle.error("tdsls4501m000", error_msg2)
endif
stpapi.end.session("tdsls4101s000", error_msg5) |Usually not necessary!
else
handle.error("tdsls4501m000", error_msg1)
endif
stpapi.end.session("tdsls4501m000", error_msg5)
return(update.successful)
I am also attaching a Word document with a screenshot of the Error. Should I be doing anything differently?
Thanks,
Sujoy.
lbencic
18th February 2005, 22:45
I think you need the 1 on the end of the menu code. Quote from Doug:
"I have had this problem in Baan 4 and resolved it with stpapi.handle.subproc("tdsls4101s000", "mtdsls000090461", "10")
Add the 1 and see.
sujoy.sen
18th February 2005, 23:17
I added the 1 but still got the error. Do you think we need to do a stpapi.handle.subproc for the session listed on the menu, i.e., tdsls4801s000? There is something in the documentation that seems to suggest that might be necessary. That's about the only other thing I can think of doing at this point. Thanks.
NPRao
18th February 2005, 23:22
I think you need the 1 on the end of the menu code.
I found some info in my old emails/notes -
The key of the menu is Language, Package, Module, Menu, Sequence Number of Parallel Menu, VRC. The Sequence Number is a remnant of the past. In the ASCII interface you could use the left and right arrow keys to switch between parallel menus (e.g. for display, maintain and print sessions). In the newer versions the sequence number is still part of the key and should be used to select the wanted menu.
This is still valid for the menu dump files which end with "1" and a "0" -
[DEV:bsp]/app/lms/lmss/opt/bse/application/ibaan/zmB52U_a_ibt/mzmusr0>ls
musr1000000010 musr1004000610 musr1009000710 musr2006000610 musr2204000310 musr2209000410
musr1000000110 musr1005000110 musr1009000810 musr2007000110 musr2204000410 musr2209000510
musr1000000210 musr1005000210 musr1009000910 musr2200000010 musr2204000610 musr2209000610
Also PMC info has the "1" at the end of the menu codes -
B52U a mlgs 20050216A ABC Migrations Menu wh wmd100400031 2
B52U a mlgs 20050216A ABC Migrations Menu zm mig000000021 2
B52U a mlgs 20050216A ABC Migrations Menu zm usr410200021 2
B52U a mlgs 20050216A ABC Migrations Menu zm usr700200021 2
lbencic
18th February 2005, 23:39
NP - right, it's the 1 as in the sequence number you see in Maintain Menus (not always a 1, but it is in this case).
Sujoy - you will definatly need to handle the 4801 session. Try:
stpapi.handle.subproc("tdsls4101s000", "tdsls4801s000", "ignore")
(Again, from Doug's notes). But, still, I don't see why it's giving the SAME error. Did the error at least add the 1 to the end of the name it was looking for?
Heading home (TGIF!!!). Post up what your current code is for this section, and I'll try to run it over the weekend.
lbencic
18th February 2005, 23:45
O - I missed 1 thing, not sure if it makes a diff. You are trying to reach the 'No Action' option, that is position 90 on the menu (my version, anyway). Is it 100 for you? According to what Doug found, if it's 90 like mine, you need to give it option 9 (Sequence Number / 10). 10 does not exist, as sequence 100 does not exist, maybe that is the issue.
stpapi.handle.subproc("tdsls4101s000", "mtdsls000090451", "9")
sujoy.sen
21st February 2005, 15:21
Lisa,
Sorry I had to leave before your last two posts on Friday. Tried your suggestions this morning. Still getting the same error. I am attaching a Word doc with a screenshot of the error I got this morning along with a screenshot of the menu showing "No Action" as sequence 100. The error messages kick off as a continuous stream of thousands of error messages (all of them the same!). The Error dialog box takes over the Baan client and I have to kill it through Windows Task Manager on my PC. Never seen anything quite like it!
The code I ran this morning is as follows:
|******************************************************************************
|* tdsls9103 0 VRC B50C b tdev
|* Simple Sales Order Lines
|* Sen, Sujoy tdev
|* 2005-02-09
|******************************************************************************
|* Main table tdsls903 Simple Sales Order Lines, Form Type 3
|******************************************************************************
|****************************** declaration section ***************************
declaration:
table ttdsls903 | Simple Sales Order Lines
table ttdsls401 | Sales Order Lines
table ttccom100 | Business Partners
domain tcorno orno.f
domain tcorno hold.orno
extern domain tcnama hold.nama
domain tcbool unprocessed.line.exists
#pragma used dll ottstpapihand
|****************************** program section *******************************
before.program:
|****************************** zoom from section *****************************
zoom.from.tdsls9203m000:
on.entry:
import("orno.f", orno.f)
tdsls903.orno = orno.f
if tdsls.dll4100.set.appl.lock(orno.f, true) then
choice.again()
endif
|****************************** form section **********************************
form.1:
init.form:
mess("tdtdsls91032", 0) |Make changes and click on Specific --> Update Sales Order Lines
execute(find.data)
execute(first.set)
|****************************** field section *********************************
field.hold.nama:
before.field:
select tccom100._index1, tccom100.nama:hold.nama
from tccom100
where tccom100._index1 = {:tdsls401.ofbp}
selectdo
endselect
|****************************** choice section ********************************
choice.modify.set:
before.choice:
if tdsls.dll4100.set.appl.lock(tdsls903.orno, true) then
choice.again()
endif
choice.end.program:
before.choice:
hold.orno = tdsls903.orno
unprocessed.line.exists = true
select tdsls903.orno
from tdsls903
where tdsls903._index1 = {:hold.orno}
and tdsls903.proc = tcyesno.no
selectdo
selectempty
unprocessed.line.exists = false
endselect
if unprocessed.line.exists then
if ask.enum("tdsls91031", tcyesno.no) = tcyesno.yes then |All lines have not been processed. Exit?
delete.records.and.appl.lock()
else
choice.again()
endif
else
delete.records.and.appl.lock()
endif
choice.abort.program:
before.choice:
hold.orno = tdsls903.orno
unprocessed.line.exists = true
select tdsls903.orno
from tdsls903
where tdsls903._index1 = {:hold.orno}
and tdsls903.proc = tcyesno.no
selectdo
selectempty
unprocessed.line.exists = false
endselect
if unprocessed.line.exists then
if ask.enum("tdsls91031", tcyesno.no) = tcyesno.yes then |All lines have not been processed. Exit?
delete.records.and.appl.lock()
else
choice.again()
endif
else
delete.records.and.appl.lock()
endif
|********************************* function section ******************************
functions:
function delete.records.and.appl.lock()
{
tdsls.dll4100.delete.appl.lock()
select tdsls903.*
from tdsls903 for update
where tdsls903._index1 = {:hold.orno}
selectdo
db.retry.point()
db.delete(ttdsls903, db.retry)
commit.transaction()
endselect
}
function extern update.sales.order.lines()
{
hold.orno = tdsls903.orno
select tdsls903.*
from tdsls903 for update
where tdsls903._index1 = {:hold.orno}
and tdsls903.proc = tcyesno.no |select only unprocessed records
selectdo
if field.values.changed(tdsls903.orno, tdsls903.pono, tdsls903.sqnb, tdsls903.cups,
tdsls903.pric, tdsls903.cuqs, tdsls903.oqua) then
if update.changes.to.tdsls401(tdsls903.orno, tdsls903.pono, tdsls903.sqnb, tdsls903.cups,
tdsls903.pric, tdsls903.cuqs, tdsls903.oqua) then
db.retry.point()
tdsls903.proc = tcyesno.yes |tdsls401 update successful
db.update(ttdsls903, db.retry)
commit.transaction()
else
db.retry.point()
tdsls903.proc = tcyesno.no |tdsls401 update not successful
db.update(ttdsls903, db.retry)
commit.transaction()
endif
else
db.retry.point()
tdsls903.proc = tcyesno.yes |no changes; update not required
db.update(ttdsls903, db.retry)
commit.transaction()
endif
endselect
execute(find.data)
execute(first.set)
}
function domain tcbool field.values.changed(domain tcorno orno,
domain tcpono pono,
domain tcpono sqnb,
domain tccuni cups,
domain tcpric pric,
domain tccuni cuqs,
domain tcqsl1 oqua)
{
domain tcbool values.changed
values.changed = false
select tdsls401.*
from tdsls401
where tdsls401._index1 = {:orno, :pono, :sqnb}
selectdo
if tdsls401.cups <> cups then
values.changed = true
endif
if double.cmp(tdsls401.pric, pric, 0.0001) <> 0 then
values.changed = true
endif
if tdsls401.cuqs <> cuqs then
values.changed = true
endif
if double.cmp(tdsls401.oqua, oqua, 0.0001) <> 0 then
values.changed = true
endif
endselect
return(values.changed)
}
function domain tcbool update.changes.to.tdsls401(domain tcorno orno,
domain tcpono pono,
domain tcpono sqnb,
domain tccuni cups,
domain tcpric pric,
domain tccuni cuqs,
domain tcqsl1 oqua)
{
long ret1
long ret2
long ret3
long ret4
string error_msg1(100)
string error_msg2(100)
string error_msg3(100)
string error_msg4(100)
string error_msg5(100)
| string error_msg6(100)
domain tcbool update.successful
update.successful = false
stpapi.put.field("tdsls4501m000", "tdsls401.orno", orno)
stpapi.put.field("tdsls4501m000", "tdsls401.pono", str$(pono))
stpapi.put.field("tdsls4501m000", "tdsls401.sqnb", str$(sqnb))
|ret1 = stpapi.change.view("tdsls4501m000", error_msg1)
ret1 = stpapi.find("tdsls4501m000", error_msg1)
if ret1 then
ret2 = stpapi.synchronize.dialog("tdsls4501m000", "modify", error_msg2)
if ret2 then
stpapi.put.field("tdsls4101s000", "tdsls401.cups", cups)
stpapi.put.field("tdsls4101s000", "tdsls401.pric", str$(pric))
stpapi.put.field("tdsls4101s000", "tdsls401.cuqs", cuqs)
stpapi.put.field("tdsls4101s000", "tdsls401.oqua", str$(oqua))
stpapi.handle.subproc("tdsls4101s000", "mtdsls000090451", "10")
stpapi.handle.subproc("tdsls4101s000", "tdsls4801s000", "ignore")
ret3 = stpapi.update("tdsls4501m000", true, error_msg3)
| stpapi.handle.subproc("tdsls4101s000", "tdpcg0240s000", "kill")
| stpapi.end.session("tdpcg0240s000", error_msg6)
if ret3 then
update.successful = true
else
handle.error("tdsls4101s000", error_msg3)
ret4 = stpapi.recover("tdsls4101s000", error_msg4)
endif
else
handle.error("tdsls4501m000", error_msg2)
endif
stpapi.end.session("tdsls4101s000", error_msg5) |Usually not necessary!
else
handle.error("tdsls4501m000", error_msg1)
endif
stpapi.end.session("tdsls4501m000", error_msg5)
return(update.successful)
}
function handle.error( string session_str(13),
ref string error_msg)
{
string root_error(100)
string error_code(100)
string output_str(113)
while true
root_error = strip$(shiftl$(error_msg))
error_code = stpapi.get.mess.code(session_str, error_msg)
if isspace(error_msg) then
break
endif
endwhile
error_msg = root_error
output_str = strip$(shiftl$(concat$(":", session_str, root_error)))
message(output_str)
}
From running it in debug mode, it seems the errors are generated at the following line:
ret3 = stpapi.update("tdsls4501m000", true, error_msg3)
Let me know if you see anything amiss.
Thanks,
Sujoy.
DStroud
22nd February 2005, 14:35
I have successfully added Sales Order Lines in Baan 5c using the code below. The key is making sure that you are handling the correct menu and actual sequence number for the option that you want to use. The stpapi.handle.subproc("tdsls4101s000", "mtdsls00009047", "13") the 13 is for No Action.
stpapi.handle.subproc("tdsls4100s000", "tdsls4501m000", "add")
stpapi.form.command("tdsls4100s000", 5, "to.lines", error.msg)
ret = stpapi.synchronize.dialog("tdsls4501m000", "add", error.msg)
if ret then
stpapi.handle.subproc("tdsls4101s000", "mtdsls00009047", "13")
stpapi.put.field("tdsls4101s000", "tdsls401.pono", str$(in.pono))
stpapi.put.field("tdsls4101s000", "tdsls401.item.segment.1", "")
stpapi.put.field("tdsls4101s000", "tdsls401.item.segment.2", (in.item))
stpapi.put.field("tdsls4101s000", "tdsls401.oqua", str$(in.qty))
stpapi.put.field("tdsls4101s000", "tdsls401.cwar", in.whse)
ret = stpapi.insert("tdsls4501m000", true, error.msg)
if not ret then
rprt_send()
ret = seq.puts(in.buff, errorfile)
ret = stpapi.recover("tdsls4101s000", recover.msg)
else
line.count = line.count + 1
error.msg = "Line Record Added"
rprt_send()
endif
endif
sujoy.sen
24th February 2005, 23:26
Doug,
Thanks for your post. Appreciate the input. I am still trying to make this work in our Baan 5b environment. I have the following questions for you:
1. When specifying the menu code, should we use "mtdsls00009047" or "mtdsls000090471"?
2. When using the Actual Sequence Number for the option on the menu are you dividing by 10? So if the Actual Sequence Number is 130, are you specifying "13" in your call? Or is the Sequence Number actually 13 in this case, and there is no division by 10 going on?
3. Did you have to make a stpapi.handle.subproc() call for the session specified on the menu at any point? In my case, I am using the mtdsls00009045 menu, and the session specified on the menu is tdsls4801s000. So this is what part of my code looks like:
stpapi.handle.subproc("tdsls4101s000", "tdsls4801s000", "ignore")
stpapi.handle.subproc("tdsls4101s000", "mtdsls000090451", "10")
Look forward to your input on the above three questions.
Thanks,
Sujoy.
Francesco
25th February 2005, 18:51
Looks like I'm next in line to face this problem. I thought you guys had already done the work for me, but unfortunately my order lines still hang whenever inventoy shortage comes into play.
I am fairly sure I picked the correct menu, based on what I see when entering the order manually, but I cannot debug tdsls4102s000 to make sure.
Anyway, here is my code. I'm at my wits end. Any suggestions will be greatly appreciated.
stpapi.put.field("tdsls4101m000", "tdsls040.orno", order.number)
if not stpapi.find("tdsls4101m000", error.message) then
error.code = 2001
handle.error()
endif
stpapi.handle.subproc("tdsls4101m000", "tdsls4102s000", "add")
stpapi.continue.process("tdsls4101m000", error.message)
api.session = "tdsls4102s000"
|****QUESTIONS*******
| Define product options immediately?
ret = stpapi.enum.answer(api.session, "tdsls41045", tcyesno.no)
| Calculate Sales Price Structure of Variant?
ret = stpapi.enum.answer(api.session, "tdsls4102p", tcyesno.yes)
| Delivery address has been changed; Recalculate Tax Code for order line?
|ret = stpapi.enum.answer("tdsls4102s000", "tdsls41022l.02", tcyesno.no)
| Add additional costs to order?
ret = stpapi.enum.answer(api.session, "tdsls027.inta", tcyesno.no)
if tccom976.ptyp = tccom.ptyp906.generic then
generic.item = tccom976.part(1;7)
stpapi.put.field(api.session, "tdsls041.item", generic.item)
stpapi.put.field(api.session, "tdsls041.cpva", strip$(tccom976.pvno))
stpapi.put.field(api.session, "tdsls041.cprj", strip$(tccom976.cprj))
else
stpapi.put.field(api.session, "tdsls041.item", strip$(tccom976.part))
endif
| Start handler for insufficient inventory zoom session.
| This should pick the 10th option (no action) from the zoom menu.
| Plus handler for session invoked by menu option 10
stpapi.handle.subproc("tdsls4102s000", "tdsls4801s000", "ignore")
stpapi.handle.subproc("tdsls4102s000", "mtdsls000090451", "10")
stpapi.put.field(api.session, "tdsls041.oqua", str$(tccom976.pqty))
stpapi.put.field(api.session, "tdsls041.opdt", str$(date.num()))
stpapi.put.field(api.session, "tdsls041.svia", "59")
stpapi.put.field(api.session, "tdsls041.frmt", "tdsls.frm.nocharge")
stpapi.put.field(api.session, "tdsls041.dlev", "tddlev.manual")
stpapi.put.field(api.session, "tdsls041.eono", strip$(tccom976.orno))
stpapi.put.field(api.session, "tdsls041.epos", str$(tccom976.lino))
ret = stpapi.insert(api.session, true, error.message)
sujoy.sen
25th February 2005, 19:22
I have tried pretty much every thing that I can think of at this point and my code still hangs when I hit an inventory shortage scenario. The fact that Doug is able to make this work in Baan 5c is encouraging. So, I looked on the Baan Support Site for latest solutions for ttstpapihand, etc. For Baan 5b, it turns out that there was a solution (#144243) released in 2004 that addresses Defect 147669 (AFS zoom.to.menu correction). I don't have any more details on this defect but I am hoping that it refers to the problem we are encountering and that this solution may resolve this problem. Solution #144243 is part of Service Pack 16 for Baan 5b.
Have you looked on the Baan Support Site for your version of Baan to see if there are any solutions for ttstpapihand, etc. that might address this problem?
DStroud
25th February 2005, 19:25
First please verify that you are looking at the correct menu because I also thought that mtdsls00009045 but it really was mtdsls00009047. I actually changed the menu to add another session and that how I found out that I was not looking at the right menu.
Secondly you don't need the Language as indicated by my statement below.
Finally, the 13 - No Action was the 13th item in the menu. If the menu is sequenced by 10 the you can take the menu sequence number and divide by 10 but if it is not sequenced by 10 the you MUST count the item on the menu until you get the one you want.
stpapi.handle.subproc("tdsls4101s000", "mtdsls00009047", "13")
sujoy.sen
25th February 2005, 19:39
Doug,
I am quite certain that mtdsls00009045 is the correct menu in my case. I am attaching a screenshot of the debug screen in tdsls4101. Also, mtdsls00009047 is expired in our system. "No Action" is the 10th option in the mtdsls0009045 menu so we should be okay there.
I think I have already tried to run it without the 1 at the end but I will try that again.
Did you need a call similar to the following for the session on the menu?
stpapi.handle.subproc("tdsls4101s000", "tdsls4801s000", "ignore")
Thanks,
Sujoy.
DStroud
25th February 2005, 21:53
Sujoy,
The code that I posted on Feb 22 is the exact code I used. I didn't have to put in a handle for tdsls4801s000.
Good Luck.
sujoy.sen
25th February 2005, 22:10
Thanks Doug. I tried my code without the 1 at the end for the menu code and still got the same error. At this point, I am just going to wait till the Solution I mentioned in an earlier post is installed and then try out my code to see if it works or not.
Francesco
25th February 2005, 22:48
I dug deep in my vaults and actually found some IVc source code for tdsls4102.
Here is what I am seeing:
Depending on the setting of your MPS variable "available to promise", the displayed menu will be:
mtdsls000090551, mtdsls000090461, mtdsls000090541 or mtdsls000090451.
However, and this is where it gets REALLY interesting...
When in API mode, the stock shortage handler should DEFAULT to option 10...no action.
I'm going to see if there are any other places where the menus might get invoked and will keep you guys posted of the results.
DStroud
25th February 2005, 23:36
Francesco,
The handling of the menu works different in Baan 4 and should look like this:
stpapi.handle.subproc("tdsls4102s000", "mtdsls000090451", "10")
Francesco
25th February 2005, 23:36
I put in handlers for all 4 of the menus above and kaching!
stpapi.handle.subproc("tdsls4102s000", "mtdsls000090451", "10")
stpapi.handle.subproc("tdsls4102s000", "mtdsls000090551", "10")
stpapi.handle.subproc("tdsls4102s000", "mtdsls000090461", "10")
stpapi.handle.subproc("tdsls4102s000", "mtdsls000090541", "10")
| Plus handler for session invoked by menu option 10
stpapi.handle.subproc("tdsls4102s000", "tdsls4801s000", "ignore")
Notice that I did use the 1 at the end. I'll make a note to try it without as well.
sujoy.sen
9th March 2005, 22:26
Just wanted to confirm that installing the Tools solution I had mentioned earlier resolved our problem. To recap, I believe Baan Solution # 144243 was instrumental in fixing the problem I was encountering. However, I should also mention that we installed all the Standard Tools Solutions up to January 2005. These solutions include: 149526, 147759, 145784, 142808, 142503, etc.
The relevant section of the code that is now working, is as follows:
stpapi.handle.subproc("tdsls4101s000", "tdsls4801s000", "ignore")
stpapi.handle.subproc("tdsls4101s000", "mtdsls00009045", "10")
I haven't tested any variants of the above so I am not sure if the handle for tdsls4801s000 is necessary but it seems to work fine with it in there!
Also wanted to thank everyone who contributed to this thread. Much appreciated.
-Sujoy.