diogo.obpa
15th June 2005, 15:46
hi all !
i'm using the session tisfc0202m000 to automate baan but i'm finding one thing difficult...
i've looked throughout the dll but i can't find the function to deliver the quantity...in baan we have to put yes in the order_completed field and then press a button to deliver the desired quantity and the order gets terminated...i can't find the function linked to that button in the dll...can anyone help me ?
just another doubt...i do this in order to put YES in the completed order :
yes=01
dllFunction = "tisfc0202m000f.put.order_completed(" & yes & ")"
dllname = "otisfc0202m000f"
returnvalue = SendToBaan(dllname, dllFunction)
is it correct ?
thanks in advanced
Diogo
lbencic
15th June 2005, 16:35
I have not written one to tisfc0202, or generated the library for it. Is there an option in the library for 'continue process' (choice.cont.process or something similar)? That should be linked to the 'Rep Complete' button on the screen.
diogo.obpa
15th June 2005, 16:57
function extern void tisfc0202m000f.handle.sub.process( const string sub.process, const string action )
{
DLLUSAGE
Function to define an action when a sub process is started.
Possible actions are: add/send/ignore/kill
add - add child session to internal structure,
session dll of child can be used
send - send all api calls to child instead of parent
ignore - child process is ignored, parent will wait
until child exits (for background processes)
kill - child process is killed immediately
ENDDLLUSAGE
stpapi.handle.subproc( "tisfc0202m000", sub.process, action )
}
i found no continue process function but the one above...do u think that's the one ?
thanks,
Diogo
mark_h
15th June 2005, 17:00
Here is a copy of my code:
stpapi.put.field("tisfc0202m000","tisfc001.pdno",str$(prod.pdno))
rc = stpapi.find("tisfc0202m000",msg)
if not isspace(msg) or rc<>1 then
stpapi.end.session("tisfc0507m000")
stpapi.end.session("tisfc0202m000")
return
endif
| Update the warehouse
stpapi.put.field("tisfc0202m000","tisfc001.cwar",prod.cwar)
rc = stpapi.update("tisfc0202m000",1,msg)
if not isspace(msg) or rc<>1 then
stpapi.end.session("tisfc0202m000")
return
endif
stpapi.get.field("tisfc0202m000","tisfc001.osta",qcmp)
stpapi.get.field("tisfc0202m000","tisfc001.pdno",qcmp)
stpapi.get.field("tisfc0202m000","qdlv.frm",qcmp)
rc = stpapi.enum.answer("tisfc0202m000","tisfc02024",tcyesno.yes)
rc = stpapi.enum.answer("tisfc0202m000","tisfc02029",tcyesno.yes)
stpapi.put.field("tisfc0202m000","tisfc001.cwar",prod.cwar)
stpapi.continue.process("tisfc0202m000",msg)
if isspace(msg) then
rc = stpapi.update("tisfc0202m000",1,msg)
stpapi.get.mess.code("tisfc0202m000",msg)
endif
stpapi.end.session("tisfc0202m000")
This is how I complete a production order. On our system when I complete the last operation on the production order this flag is already set to yes.
lbencic
15th June 2005, 17:04
I just ran the create dll on that, the continue process is in there, just called 'continue':
function extern void tisfc0202m000f.continue( ref string error ).
Also, the call for Order Complete field is:
function extern void tisfc0202m000f.put.Order_Completed( const domain tcyesno value )
I think you need to provide the enumerate for the yes / no in the Order Complete field. Use "tcyesno.yes" if you want to say yes there.
diogo.obpa
15th June 2005, 17:11
it may sound really stupid but i dont' have that function :eek: :confused:
how can i solv the problem ?
lbencic
15th June 2005, 17:16
The tisfc0202m000f.continue function? Hmm. Try backing up your current library and regenerating? I don't use the darn thing as a rule. The next thing I would do is write it like Mark has shown, you can write the calls directly instead of generating the library to do it. You eliminate a layer this way, and do not depend on the generator. If you look at the code the generator makes, you will see it just does the same thing that Mark has shown.
mark_h
15th June 2005, 17:37
Except you do not need the stpapi.get fields. That was from where I was debugging a problem with service pack 18. Never pulled the code back out. Oops.
diogo.obpa
15th June 2005, 17:59
thanks mark and lisa !
another problem arrives in session tisfc0102m000...
when i try to introduce the completed quantity i get an error message:
arg error tisfc0102m000f put.quantity_completed(69) : (LONG, expected: DOUBLE)...
any sugestions ???
thanks once again,
Diogo
mark_h
15th June 2005, 18:08
If you notice in my code I do not put qty completed. The only thing I allow the user to change is the warehouse. I also generated a new version of tisfc0202m000f on my system and there is not a put function like you mention.
diogo.obpa
15th June 2005, 18:16
sorry my mistake
when i first posted my last reply i misplled the session's name...now i'm getting an error on tisfc0102m000 and not tisfc0202m000 ;)
mark_h
15th June 2005, 20:11
Try calling it direct using stpapi.put.field("tisfc0102m000","tisfc010.qcmp",str$(qcmp)). I do not have code for this session - we developed our own version along time ago.
diogo.obpa
16th June 2005, 16:21
hi !
problem solved ;) i had to insert the quantity equal for instance to 2.0 and not only to 2 like i was doing :)
thanks once again ;)
diogo