sbn123
30th June 2009, 00:14
Hello Experts,

I am facing a problem in tdsls4402m000 - print picking list AFS. This session basically opens a sunsession tdsls4820s000 for specific order selection. Somehow in the AFS the specific order selection criteria is not working. The session finishes without printing the picking list for specific orders passed through tdsls4820s000 AFS. Find below my code. Please help me to find out the problem with it.

tdslsf4402m000.clear()
tdslsf4402m000.put.Print_Already_Printed_Documents(printed)

if printed = tcyesno.no then
tdslsf4402m000.put.Enter_Specific_Orders(selection)
if selection = tcyesno.yes then
tdslsf4402m000.handle.sub.process("tdsls4820s000","add")
tdslsf4820s000.clear()
tdslsf4820s000.put.Sales_Order(1,orno.1)
tdslsf4820s000.put.Sales_Order(2,orno.2)
tdslsf4820s000.put.Sales_Order(3,orno.3)
tdslsf4820s000.put.Sales_Order(4,orno.4)
tdslsf4820s000.put.Sales_Order(5,orno.5)
tdslsf4820s000.put.Sales_Order(6,orno.6)
tdslsf4820s000.put.Sales_Order(7,orno.7)
tdslsf4820s000.put.Sales_Order(8,orno.8)
tdslsf4820s000.put.Sales_Order(9,orno.9)
tdslsf4820s000.put.Sales_Order(10,orno.10)
orno.temp = tdslsf4820s000.get.Sales_Order(1)
tdslsf4402m000.put.Planned_Delivery_Date_from(ddat.f)
tdslsf4402m000.put.Planned_Delivery_Date_to(ddat.t)
else
tdslsf4402m000.put.Planned_Delivery_Date_from(ddat.f)
tdslsf4402m000.put.Planned_Delivery_Date_to(ddat.t)
tdslsf4402m000.put.Customer_from(cuno.f)
tdslsf4402m000.put.Customer_to(cuno.t)
tdslsf4402m000.put.Sales_Order_from(orno.f)
tdslsf4402m000.put.Sales_Order_to(orno.t)
endif

tdslsf4402m000.put.Finance_Company_from(comp.f)
tdslsf4402m000.put.Finance_Company_to(comp.t)
tdslsf4402m000.put.Warehouse_from(cwar.f)
tdslsf4402m000.put.Warehouse_to(cwar.t)
tdslsf4402m000.put.Project_from(cprj.f)
tdslsf4402m000.put.Project_to(cprj.t)
tdslsf4402m000.put.Item_from(item.f)
tdslsf4402m000.put.Item_to(item.t)
tdslsf4402m000.put.Container_from(cntr.f)
tdslsf4402m000.put.Container_to(cntr.t)
tdslsf4402m000.put.Route_from(crte.f)
tdslsf4402m000.put.Route_to(crte.t)
tdslsf4402m000.put.Print_Shortages(prnt.shortage)
tdslsf4402m000.put.Print_Error_Messages(prnt.error)
tdslsf4402m000.put.sort_Sequence(pseq.i)
else
tdslsf4402m000.put.Picking_List_Number_from(pino.f)
tdslsf4402m000.put.Picking_List_Number_to(pino.t)
tdslsf4402m000.put.Print_Summary_Picking_List(collect)
tdslsf4402m000.put.Print_in_Order_Language(prnt.clan)
tdslsf4402m000.put.sort_Sequence(pseq.i)
endif

tdslsf4402m000.set.report("rtdsls440201000",dev,error)
tdslsf4402m000.continue(error)

If not isspace(error)
then
set.input.error("tdsls4402.01",error)
tdslsf4402m000.handle.sub.process("tdsls4820s000","ignore")
stpapi.end.session("tdsls4820s000",error)
tdslsf4402m000.end()
else
tdslsf4820s000.end(error)
tdslsf4402m000.handle.sub.process("tdsls4820s000","ignore")
tdslsf4820s000.end(error)
error = tdslsf4402m000.get.last.error()
tdslsf4402m000.end()
endif

manish_patel
30th June 2009, 06:38
tdslsf4820s000.put.Sales_Order(1,orno.1)
tdslsf4820s000.put.Sales_Order(2,orno.2)
tdslsf4820s000.put.Sales_Order(3,orno.3)
tdslsf4820s000.put.Sales_Order(4,orno.4)
tdslsf4820s000.put.Sales_Order(5,orno.5)
tdslsf4820s000.put.Sales_Order(6,orno.6)
tdslsf4820s000.put.Sales_Order(7,orno.7)
tdslsf4820s000.put.Sales_Order(8,orno.8)
tdslsf4820s000.put.Sales_Order(9,orno.9)
tdslsf4820s000.put.Sales_Order(10,orno.10)


Use put.orno.select instead of put.Sales_Order.
i.e.
tdslsf4820s000.put.orno.select (1,orno.1)
tdslsf4820s000.put.orno.select (2,orno.2)
...
...
tdslsf4820s000.put.orno.select (10,orno.10)

DSchneider
30th June 2009, 09:13
Start bshell with option "-- -AFSLOG=1" and then find the file "afslog" in the users home or $BSE/tmp. It will show you what exactly happens. You can also post this file here, so we can search for the error, too.

Regards
Daniel

mark_h
30th June 2009, 15:22
Well I see several things that could be wrong - the first has to do with this statement
tdslsf4402m000.put.Enter_Specific_Orders(selection). When your AFS code in debug mode step until you get to this statement. Use option dialog, shell out and check your processes. At this point you should only have tdsls4402m000 running. Then step and execute this statement - check your processes again. According to your code you should have tdsls4402m000 as the parent and tdsls4820s000 as the child in the process list. On 4c4 this did not work for me on print purchase orders - so what I did was just process the orders one at a time. I think the tdsls4820s000 is not getting launched correctly(plus your stpapi.handle.sub.process should come before the session is launched). If you do not get the sessions launching correctly first the rest of the code will not work. If it is like my 4c4 system then just putting the selection to yes would not work like it does when running it manually.

Also noticed that after putting the fields on the 4820s000 session you do not do a continue to return control to the 4402m000 main program. Again - if you can't get the above to work then this really does not matter.

Do you own source code? You might be able to trick the session by just setting the order variables and exporting from the AFS code. This might be possible, but I think it is easier to just run the tdsls4402m000 program one at a time for each order and not messing with the tdsls4820s000 session.

sbn123
30th June 2009, 21:57
Hi All

Thanks for your response & suggestions. I got the AFS working . I checked the thread 'afs tdsls4404m000 and tdsls4820s000 ' & got the hint. Find below the working code

tdslsf4402m000.clear()
tdslsf4402m000.put.Print_Already_Printed_Documents(printed)

if printed = tcyesno.no then
tdslsf4402m000.put.Enter_Specific_Orders(selection)
if selection = tcyesno.yes then
tdslsf4402m000.handle.sub.process("tdsls4820s000","add")
stpapi.zoom.option("tdsls4402m000",1,"tdsls4820s000",error)

tdslsf4820s000.clear()
tdslsf4820s000.put.Sales_Order(1,orno.1)
tdslsf4820s000.put.Sales_Order(2,orno.2)
tdslsf4820s000.put.Sales_Order(3,orno.3)
tdslsf4820s000.put.Sales_Order(4,orno.4)
tdslsf4820s000.put.Sales_Order(5,orno.5)
tdslsf4820s000.put.Sales_Order(6,orno.6)
tdslsf4820s000.put.Sales_Order(7,orno.7)
tdslsf4820s000.put.Sales_Order(8,orno.8)
tdslsf4820s000.put.Sales_Order(9,orno.9)
tdslsf4820s000.put.Sales_Order(10,orno.10)
stpapi.continue.process("tdsls4820s000",error)
tdslsf4820s000.end(error)

tdslsf4402m000.set.report("rtdsls440201000",dev,error)
tdslsf4402m000.handle.sub.process("tdsls4820s000","kill")
tdslsf4402m000.continue(error)