vikky28
9th March 2012, 12:02
Need your help as I am stuck in maintaing simple AFS session. It is baan5 and service pack 11.
the session name is copy item production session. Source item and target item given, also tick copy bom and copy routing in session tiipd0202m000. When I click on copy button manually it is working fine.
The same thing I wanted to do through AFS and I write below code :
main.item = " " & "STF-RO-S-TEST-18"
temp.item = " " & "STF-RO-S-TEST-23"
stpapi.put.field("tiipd0202m000","source.item.1","")
stpapi.put.field("tiipd0202m000","source.item.2",shiftl$(strip$(main.item)))
stpapi.put.field("tiipd0202m000","target.item.1","")
stpapi.put.field("tiipd0202m000","target.item.2",shiftl$(strip$(temp.item)))
stpapi.put.field("tiipd0202m000","copy.bom",str$(etol(tcyesno.yes)))
stpapi.put.field("tiipd0202m000","copy.routing",str$(etol(tcyesno.yes)))
stpapi.form.command("tiipd0202m000",5,"continue.process",err)
if(not isspace(err)) then
message("Error! %s",err)
endif
stpapi.end.session("tiipd0202m000",err)
Error : Items not availbe in general item. Unable to find out the error. As it is working fine in manually but not through AFS. Please correct me if I am doing wrong codding.
Thanks.
the session name is copy item production session. Source item and target item given, also tick copy bom and copy routing in session tiipd0202m000. When I click on copy button manually it is working fine.
The same thing I wanted to do through AFS and I write below code :
main.item = " " & "STF-RO-S-TEST-18"
temp.item = " " & "STF-RO-S-TEST-23"
stpapi.put.field("tiipd0202m000","source.item.1","")
stpapi.put.field("tiipd0202m000","source.item.2",shiftl$(strip$(main.item)))
stpapi.put.field("tiipd0202m000","target.item.1","")
stpapi.put.field("tiipd0202m000","target.item.2",shiftl$(strip$(temp.item)))
stpapi.put.field("tiipd0202m000","copy.bom",str$(etol(tcyesno.yes)))
stpapi.put.field("tiipd0202m000","copy.routing",str$(etol(tcyesno.yes)))
stpapi.form.command("tiipd0202m000",5,"continue.process",err)
if(not isspace(err)) then
message("Error! %s",err)
endif
stpapi.end.session("tiipd0202m000",err)
Error : Items not availbe in general item. Unable to find out the error. As it is working fine in manually but not through AFS. Please correct me if I am doing wrong codding.
Thanks.