Premahari
28th May 2018, 15:33
Hi In production orders ,Whenever quantity is rejected, it was moved to quarantine. In quarantine inventory it will create one quarantine ID.
How to get that quarantine ID through AFS. The session i used for move to quarantine is tisfc0209m000. It was moved to quarantine and ID generated in whwmd2171m000 session.How to get that ID Can anyone please help?

mark_h
28th May 2018, 21:38
Not exactly sure what you are looking for. Is there a reason you need in thru AFS? Is it not possible to just read it from a table. I mean if you are running thru a process and generating the id and just want to read it from a form you would use the stpapi.get command.

Premahari
29th May 2018, 07:11
iam trying to read using stpapi.get.field command only. But its returning wrong Quarantine ID. Here is my code I used for move to quarantine. BUt don know how to get quarantine ID. Its creating ID in session whwmd2171m000 session I checked. But through AFS when I tried returning wrong ID


stpapi.put.field( "tisfc0130m000", "tisfc010.pdno", orno)
stpapi.put.field( "tisfc0130m000", "tisfc010.opno", str$(opno) )
ret = stpapi.find( "tisfc0130m000" , err.msg)
if ret = 1 then
stpapi.form.command( "tisfc0130m000", 2, "tisfc0209m000", error )
stpapi.put.field( "tisfc0209m000", "f.dir.proc.wo", str$(tcyesno.yes) )
stpapi.form.command( "tisfc0209m000", 5, "reject.to.quarantine", error )
stpapi.end.session("tisfc0209m000")
else
dal.get.error.message (err.msg)
abort.transaction()
message(err.msg)
endif
stpapi.end.session("tisfc0130m000")

giggty
29th May 2018, 11:43
Quarantine ID is not displayed on tisfc0209m000 form, so... Well, it could be stored in some extern variable (then you can get it with stpapi.get.field()), but without sources you won't know, so the easiest way is to query whwmd271 for ID.