chinaguy
5th May 2010, 08:13
AFS implement "Initiate Inventory Issue..." reference attachment,thanks!

tips: "command disable"

|********启动库存发料
function initiateInventory(){
domain tcstr.200 issu,sitm

stpapi.put.field("ticst0101m100", "ticst001.pdno", trim$(str$(tisfc901.pdno)))
select ticst001.pono
from ticst001
where ticst001.pdno =:tisfc901.pdno and ticst001.sitm =:tisfc901.invnty
selectdo
stpapi.put.field("ticst0101m100", "ticst001.pono", trim$(str$(ticst001.pono)))
selectempty
endselect
|retval = stpapi.change.view("ticst0101m100", error.msg)
retval = stpapi.find("ticst0101m100", error.msg)
if retval then
retval = stpapi.synchronize.dialog("ticst0101m100", "modify", error.msg)
if retval then
stpapi.put.field("ticst0101m100", "ticst001.issu", str$(tisfc901.cwarqana))
retval = stpapi.update("ticst0101m100", true, error.msg)
|stpapi.get.field("ticst0101m100", "ticst001.issu", issu)
|stpapi.get.field("ticst0101m100", "ticst001.sitm", sitm)
|message(sitm&"="&issu)
if retval then
stpapi.handle.subproc("ticst0101m100", "tisfc0207m000", "send")
stpapi.continue.process("ticst0101m100", error.msg)
inventoryIssue()
else
message(error.msg)
retval = stpapi.recover("ticst0101m100", error.msg)
return
endif
endif
endif
stpapi.end.session("tisfc0101m100", error.msg)

|stpapi.get.field("ticst0101m100", "ticst001.sitm", pono)

|message(str$(pono))
}
|*********库存发料
function inventoryIssue(){
|retval = stpapi.synchronize.dialog("tisfc0207m000", "modify", error.msg)
|if retval then
stpapi.put.field("tisfc0207m000", "pdno.f", str$(tisfc901.pdno))
stpapi.put.field("tisfc0207m000", "pdno.t", str$(tisfc901.pdno))
stpapi.put.field("tisfc0207m000", "way.of.selection", str$(tisfc.wybf.all))
stpapi.put.field("tisfc0207m000", "upto.time", sprintf$("%u001", utc.num()))
stpapi.put.field("tisfc0207m000", "upto.time.time", sprintf$("", utc.num()))
|retval = stpapi.update("tisfc0207m000", true, error.msg)
|if not retval then
| retval = stpapi.recover("tisfc0207m000", error.msg)
|endif
stpapi.form.command("tisfc0207m000", 5, "exec.cont.process", error.msg)
stpapi.set.report("tisfc0207m000", "tisfc020701000", "D", error.msg)
stpapi.print.report("tisfc0207m000", error.msg)
message(error.msg)
|message("inventoryIssue")
|endif
stpapi.end.session("tisfc0207m000", error.msg)
}

524dll->serv (getxml)
524dll->serv (startticst0101m100100)
526serv<-4gl (init.ready)
ticst0101m100(526)-RUNNING:
LOGGING STARTED
05-05-2010
>ticst0101m100(526) put.field:ticst001.pdno 100000080
>ticst0101m100(526) put.field:ticst001.pono 20
>ticst0101m100 Find
524dll->serv (def.find526)
ticst0101m100(526)-RUNNING:def.find
526serv<-4gl (def.find01)
ticst0101m100(526)-RUNNING:
<ticst0101m100 record found (1)
524dll->serv (startticst0101m1001ticst0101m100121)
527serv<-4gl (init.ready)
ticst0101m100(527)-RUNNING:
524dll->serv (syncmodify526)
ticst0101m100(526)-RUNNING:syncmodify
526serv<-4gl (syncmodify0)
ticst0101m100(526)-RUNNING:
>ticst0101m100(526) put.field:ticst001.issu 340.96
>ticst0101m100 update
524dll->serv (modify.set+save527)
ticst0101m100(527)-RUNNING:modify.set+save
527serv<-4gl (modify.set+save01)
ticst0101m100(527)-RUNNING:
<ticst0101m100
>ticst0101m100 handle.subproc tisfc0207m000 send
524dll->serv (handle.subsessiontisfc0207m0003526)
>ticst0101m100 continue.process
524dll->serv (cont.process526)
ticst0101m100(526)-RUNNING:cont.process
526serv<-4gl (cont.process1)
ticst0101m100(526)-RUNNING:
<ticst0101m100 Command disabled
524dll->serv (starttisfc0207m000100)
528serv<-4gl (init.ready)
tisfc0207m000(528)-RUNNING:
>tisfc0207m000(528) put.field:pdno.f 100000080
>tisfc0207m000(528) put.field:pdno.t 100000080
>tisfc0207m000(528) put.field:way.of.selection 1
>tisfc0207m000(528) put.field:upto.time 05-05-10
>tisfc0207m000(528) put.field:upto.time.time 16:23
>tisfc0207m000 form.command command type: 5 command prog: exec.cont.process
524dll->serv (form.command5exec.cont.process528)
tisfc0207m000(528)-RUNNING:form.command
528serv<-4gl (form.command1)
tisfc0207m000(528)-RUNNING:
<tisfc0207m000 ?未?填?入?报?表?名?称
>tisfc0207m000 set.report
524dll->serv (set.reporttisfc020701000D528)
tisfc0207m000(528)-RUNNING:set.report
528serv<-4gl (set.report0)
tisfc0207m000(528)-RUNNING:
<tisfc0207m000
>tisfc0207m000 print.report
524dll->serv (print.data528)
tisfc0207m000(528)-RUNNING:print.data
528serv<-4gl (print.data1)
tisfc0207m000(528)-RUNNING:
<tisfc0207m000 Command disabled
>tisfc0207m000 end.session
524dll->serv (end.program528)
tisfc0207m000(528)-RUNNING:end.program
528serv<-4gl (end.program0)
tisfc0207m000(528)-RUNNING:
528dll->serv (tisfc0207m000: exit(528))
>tisfc0101m100 end.session

mark_h
5th May 2010, 14:56
Okay - for LN dal2 functionality is recommended. Just based off the screen print I did what I thought(which could be completely wrong) would possibly work. I noticed you mixed commands - not sure why the sync dialog was used. I do not have any ln experience and this is pure speculation on my part - hope it helps.


function initiateInventory()
{
domain tcstr.200 issu,sitm

stpapi.put.field("ticst0101m100", "ticst001.pdno", trim$(str$(tisfc901.pdno)))
select ticst001.pono
from ticst001
where ticst001.pdno =:tisfc901.pdno and ticst001.sitm =:tisfc901.invnty
selectdo
stpapi.put.field("ticst0101m100", "ticst001.pono", trim$(str$(ticst001.pono)))
selectempty
endselect
retval = stpapi.find("ticst0101m100", error.msg)
if retval then
stpapi.put.field("ticst0101m100", "ticst001.issu", str$(tisfc901.cwarqana))
| Is this the correct command for ln? I am not sure
retval = stpapi.update("ticst0101m100", true, error.msg)
if retval then
| Assuming the continue process launches tisfc0207m000
stpapi.handle.subproc("ticst0101m100", "tisfc0207m000", "add")
stpapi.form.command("ticst0101m100", 5, "exec.cont.process", error.msg)
inventoryIssue()
else
message(error.msg)
retval = stpapi.recover("ticst0101m100", error.msg)
return
endif
endif
stpapi.end.session("tisfc0101m100", error.msg)
}
|*********????
function inventoryIssue()
{
stpapi.put.field("tisfc0207m000", "pdno.f", str$(tisfc901.pdno))
stpapi.put.field("tisfc0207m000", "pdno.t", str$(tisfc901.pdno))
stpapi.put.field("tisfc0207m000", "way.of.selection", str$(tisfc.wybf.all))
stpapi.put.field("tisfc0207m000", "upto.time", sprintf$("%u001", utc.num()))
stpapi.put.field("tisfc0207m000", "upto.time.time", sprintf$("", utc.num()))
stpapi.form.command("tisfc0207m000", 5, "exec.cont.process", error.msg)
stpapi.set.report("tisfc0207m000", "tisfc020701000", "D", error.msg)
stpapi.print.report("tisfc0207m000", error.msg)
message(error.msg)
stpapi.end.session("tisfc0207m000", error.msg)
}

chinaguy
5th May 2010, 15:21
I am just learning.If you don't use sync dialog is tips "Editable synchronized dialog not start"

mark_h
5th May 2010, 16:59
I am sorry I just do not know enough about LN to answer that or know what may be going on in the session. From just looking at the session it does not seem like it is one to have a sync'ed subsession.