king1980
23rd August 2010, 13:14
Hi ,
I have created one AFS session. In this i have given option to user to process
multiple records on the selection basis.
This session is working fine in worktop for multiple records process but same session is not processing multiple records in webtop and it's not showing any error also it's exciting single record in webtop.
Please guide me to resolve this issue
Regards
king1980
george7a
23rd August 2010, 13:21
Can you post the code?
Did you try to debug it by creating a text file and check where does the code stop?
mark_h
23rd August 2010, 16:11
It is my understanding that some AFS code does not work in webtop. You might want to search this this form (http://www.baanboard.com/baanboard/forumdisplay.php?f=59) for that topic.
king1980
5th September 2010, 08:28
Can you post the code?
Did you try to debug it by creating a text file and check where does the code stop?
declaration:
#ident "@(#) SOL 236271, 2009-07-30, B61M_a2_ind3"
#ident "@(#)tdboddll1046 tdB61Ma2ind3 nlbaumn5 Rev.No. 5 11 Sep 09 rvasan"
#ident "@(#) SOL 240472, 2009-09-11, B61M_a2_ind3"
#define PREFIX "P"
#include <bic_dam>
|#include <bic_dal>
#include "itcmcs0012" |* Compare Double - Macros
#include "itcmcs2000" |* DAL(-GUI) Support Defines
#include "itcbod0001" |* Function used for BOD implementations
#pragma used dll ottstpapihand
table twhinh220 | Outbound Order Lines
table twhpcl012
table ttdsls039
table ttccom100
table ttdsls400
table twhinr140 |table added by rekha 5/9/10
extern domain tcitem whpcl012.item
extern domain tcitem item
extern domain tcqst1 qty.ship
extern domain tcyesno chk
extern domain whinh.oorg whinh220.oorg
extern domain tcorno whinh220.orno
extern domain tcsern whinh220.oset
extern domain tcpono whinh220.pono
extern domain tcpono whinh220.seqn
extern domain tcclot clot
extern domain tcqst1 qty.ship
extern domain tcyesno rec_update,rec_insert
extern domain tcmcs.st15 seso
extern domain tccwar cwar
extern domain tcmcs.long seq.id
extern domain tcqiv1 tqty
#pragma used dll ottstpapihand
|****************************** program section ********************************
| long child_group, child_pid
before.program:
tdsls039.seso = ""
select tdsls039.*
from tdsls039
where tdsls039._index1 = {:1}
wherebind(1,logname$)
selectdo
endselect
seso = strip$(tdsls039.seso) & ".*"
on case logname$
case "liveap":
cwar = "DAP"
break
case "livepn":
cwar = "DPN"
break
case "liveas":
cwar = "DAS"
break
case "livebh":
cwar = "DBH"
break
case "livecu":
cwar = "DCU"
break
case "livedl":
cwar = "DDL"
break
case "livegj":
cwar = "DGJ"
break
case "livehr":
cwar = "DHR"
break
case "livekl":
cwar = "DKL"
break
case "livekt":
cwar = "DKT"
break
case "livemp":
cwar = "DMP"
break
case "livepj":
cwar = "DPJ"
break
case "liverj":
cwar = "DRJ"
break
case "livetn":
cwar = "DTN"
break
case "liveup":
cwar = "DUP"
break
case "livewb":
cwar = "DWB"
break
case "bsp": |Need to Remove after testing
cwar = "DAP" |Need to Remove after testing
break |Need to Remove after testing
default:
cwar = ""
endcase
if not isspace(cwar) then
query.extend.where("whpcl012.item=:item and whpcl012.oorg=1 and whpcl012.lsta=5 and whpcl012.cwar=:cwar")
else
query.extend.where("whpcl012.oorg=1 and whpcl012.lsta=5")
| query.extend.where("whpcl012.item=:item and whpcl012.oorg=1 and whpcl012.lsta=5 ")|Need to remove after testing and uncomment above line
endif
seq.id = seq.open("$BSE/log/log.outbound.advice."&logname$,"a")
after.program:
seq.close(seq.id)
choice.abort.program:
before.choice:
seq.close(seq.id)
choice.end.program:
before.choice:
seq.close(seq.id)
|****************************** group section **********************************
form.all:
init.form:
create.extra.toolbar( "get.order","cisli:finalize.gif")
before.form:
refresh()
|disable.commands( "get.order", "whpcl0412m000" )
field.whpcl012.item:
after.input:
item=whpcl012.item
getITEM()
deleteOrder1()
getAllOrder()
|*****************************Function*************************
functions:
function getITEM()
{
select whpcl012.item
from whpcl012 where whpcl012.item=:item
selectdo
get.stock()
endselect
}
function deleteOrder1()
{
select whpcl012.*
from whpcl012 for update
where whpcl012.item = :whpcl012.item
and whpcl012.cwar = :cwar
selectdo
db.delete(twhpcl012,db.retry)
commit.transaction()
endselect
refresh()
}
function extern get.order()
{
select whpcl012.*
from whpcl012
where whpcl012._index1 = {:whpcl012.item}
and whpcl012.cwar = :cwar
and whpcl012.gen = tcyesno.yes
selectdo
if whpcl012.qty.ship >0 then
long retval1
long retval2
long ret
string error.msg(50)
string recover.msg(50)
ret = stpapi.synchronize.dialog("whinh4525m000", "add", error.msg)
if not ret then
message(error.msg & str$(ret))
stpapi.end.session("whinh4525m000")
choice.again()
endif
select whinr140.*
from whinr140
where whinr140.cwar =:whpcl012.cwar and whinr140.item =:whpcl012.item
order by whinr140._index1
as set with 1 rows
selectdo
|tdate
endselect
error.msg=""
stpapi.put.field("whinh4525m000", "whinh225.oorg", str$(etol(whpcl012.oorg)))
stpapi.put.field("whinh4525m000", "whinh225.orno", whpcl012.orno)
stpapi.put.field("whinh4525m000","whinh225.oset", str$(whpcl012.set))
stpapi.put.field("whinh4525m000","whinh225.pono", str$(whpcl012.line))
stpapi.put.field("whinh4525m000","whinh225.seqn", str$(whpcl012.seqn))
stpapi.put.field("whinh4525m000","whinh225.clot", str$(whpcl012.clot))
stpapi.put.field("whinh4525m000","whinh225.idat", whinr140.idat)
stpapi.put.field("whinh4525m000","whinh225.qads", str$(whpcl012.qty.ship))
stpapi.put.field("whinh4525m000","whinh225.item",whpcl012.item)
stpapi.put.field("whinh4525m000","whinh225.runn", logname$)
retval1 = stpapi.insert("whinh4525m000", true, error.msg)
if not isspace(error.msg) then
message(error.msg & str$(retval1))
retval2 = stpapi.recover("whinh4525m000", recover.msg)
seq.puts("Order - "&whpcl012.orno&" Line - "&str$(whpcl012.line)&" Seq - "&str$(whpcl012.seqn)&" Item - "&whpcl012.item&" Error - "&error.msg,seq.id)
else
stpapi.form.command("whinh4525m000", 5, "release.advice", error.msg)
if not isspace(error.msg) then
message(error.msg )
endif
deleteOrder()
seq.puts("Order - "&whpcl012.orno&" Line - "&str$(whpcl012.line)&" Seq - "&str$(whpcl012.seqn)&" Item - "&whpcl012.item&" Shipment Completed.",seq.id)
endif
stpapi.end.session("whinh4525m000",error.msg)
else
message("Please fill the Ship to Qty")
endif
endselect
}
function getAllOrder()
{
select whinh220.*
from whinh220
where
whinh220.item=:item and
whinh220.oorg=1 and
whinh220.lsta=5 and
whinh220.cwar=:cwar and
whinh220.orno not in(select whpcl012.orno from whpcl012 where whpcl012.item=:item)
and whinh220.orno like :seso order by whinh220.orno
selectdo
get.Customer()
whpcl012.set=whinh220.oset
whpcl012.seqn=whinh220.seqn
whpcl012.line=whinh220.pono
whpcl012.item=whinh220.item
whpcl012.clot=whinh220.clot
whpcl012.qoro=whinh220.qoro
whpcl012.qty.ship=0
whpcl012.orno=whinh220.orno
whpcl012.oorg=whinh220.oorg
whpcl012.lsta=whinh220.lsta
whpcl012.cwar=whinh220.cwar
whpcl012.custid=tccom100.bpid
whpcl012.cname=tccom100.nama
whpcl012.gen=tcyesno.no
db.insert(twhpcl012,db.skip.dupl)
rec_update=tcyesno.yes
endselect
if rec_update=tcyesno.yes then
commit.transaction()
|message(" Records Updated successfully")
else
|message(" NO Records found")
endif
}
function deleteOrder()
{
select whpcl012.* from whpcl012 for update
where
whpcl012.set=:whpcl012.set and
whpcl012.seqn=:whpcl012.seqn and
whpcl012.line=:whpcl012.line and
whpcl012.item=:whpcl012.item and
whpcl012.qoro=:whpcl012.qoro and
whpcl012.orno=:whpcl012.orno and
whpcl012.lsta=:whpcl012.lsta and
whpcl012.cwar=:whpcl012.cwar
selectdo
db.delete(twhpcl012,db.retry)
endselect
commit.transaction()
message("Order Processed successfully")
refresh()
}
function get.Customer()
{
select tccom100.nama,tccom100.bpid from
tccom100,tdsls400
where tccom100.bpid=tdsls400.ofbp
and tdsls400.orno=:whinh220.orno
as set with 1 rows
selectdo
endselect
}
function get.stock()
{
select sum(whltc105.qhnd):tqty
from whltc105
where
whltc105.item=:item and whltc105.cwar=:cwar
selectdo
endselect
}