deepaksachdeva
17th August 2008, 10:08
Hi,

I m planning to Automate Warehouse Receipt thru DAL, i am able to create Warehouse REceipt header without any bugs.

While Creating Warehousehouse receipt in table whinh312, i am not even getting any error, nor i am able to suceed.

code is pasted below. Urgent Help required.

thanks in advance.
Deepak

function generate.afs.wh.rec.header()
{
odat = utc.num()
long e
select whinh310.* from whinh310
for update
as set with 1 rows
selectdo
select tccom121.* from tccom121
where tccom121.sfbp = :tisfc903.bpid
selectempty
message("Ship-from Roles are not defined for BP %S",tisfc903.bpid)
choice.again()
selectdo
whinh310.shda = tccom121.cadr
endselect

get.first.free.number.whr()
dal.new.object("whinh310")
dal.set.field("whinh310.rcno", hold.orno)
dal.set.field("whinh310.sfbp",tisfc903.bpid)
dal.set.field("whinh310.cwar",rwar)
dal.set.field("whinh310.conf",tcyesno.no)
dal.set.field("whinh310.pddt",odat)
dal.set.field("whinh310.crdt",odat)
ret = dal.save.object("whinh310")

message("%s",whinh310.rcno)
if ret< 0 then
ret=dal.get.error.message(error )
message("Error......!%s",error)
else
commit.transaction()
endif


endselect
}

function post.afs.wh.receipt.lines()
{

dal.new.object("whinh312")
dal.set.field("whinh312.rcno", hold.orno)
whinh312.rcln = whinh312.rcln + 10
dal.set.field("whinh312.rcln", whinh312.rcln)
dal.set.field("whinh312.oorg", whinh.oorg.purchase)
dal.set.field("whinh312.orno", tisfc904.orno)
dal.set.field("whinh312.pono", tisfc904.opno)
whinh312.seqn= 1
whinh312.oset = 1
dal.set.field("whinh312.seqn", whinh312.seqn)
dal.set.field("whinh312.oset", whinh312.oset)
dal.set.field("whinh312.sfbp", tisfc903.bpid)
dal.set.field("whinh312.item", tisfc904.sitm)
dal.set.field("whinh312.rcun", tisfc904.rcun)
dal.set.field("whinh312.qrec", tisfc904.cqty)
dal.set.field("whinh312.qrcr", tisfc904.cqty)
dal.set.field("whinh312.qapr", tisfc904.cqty)
dal.set.field("whinh312.qadv", tisfc904.cqty)
dal.set.field("whinh312.qpur", tisfc904.cqty)
dal.set.field("whinh312.psqr", tisfc904.cqty)
dal.set.field("whinh312.psqu", tisfc904.cqty)
dal.set.field("whinh312.psun", tisfc904.rcun)
dal.set.field("whinh312.psno", tisfc903.chno)
dal.set.field("whinh312.cwar", rwar)
|dal.set.field("whinh312.lsta", whinh.lstc.confirmed)
dal.set.field("whinh312.cmpl", tcyesno.yes)
dal.set.field("whinh312.fire", tcyesno.yes)
dal.set.field("whinh312.conf", tcyesno.yes)
dal.set.field("whinh312.insp", tcyesno.no)
dal.set.field("whinh312.cdck", tcyesno.no)
dal.set.field("whinh312.cdcr", tcyesno.no)
dal.set.field("whinh312.dmse", whinh.dmse.not.appl)
dal.set.field("whinh312.arej", tcyesno.no)
dal.set.field("whinh312.ardt", odat)

dal.set.field("whinh312.trdt", odat)
|dal.set.field("whinh312.logn", "baan")

ret1 = dal.save.object("whinh312")
if ret1< 0 then
ret2=dal.get.error.message(error )
message("Error......!%s",error)
commit.transaction()
else
commit.transaction()
endif

}

Anuraag
23rd October 2008, 10:18
can u share the function get.first.free.number.whr()

ARijke
23rd October 2008, 12:40
What if you change
if ret < 0 then ret=dal.get.error.message(error )

into
if ret <> 0 then ret=dal.get.error.message(error )


Possible return values of dal.save.object are:

0 Record is saved
DALHOOKERROR One of the hooks blocked the save action
DALDBERROR A domain or reference error occurred (only in Integration context (e.g. via a BOL))
DALNOSETPERM No table level permission
DALNOOBJPERM No record level permission
>0 The error code of the db.insert() or db.update() function

loveubaan
28th May 2009, 14:13
hi,

i am getting the same error..

1. Able to create the Receipt Header/Number...but not able to create the lines using DAL..
2. Tried to created a record through GTM(DAL Active) .. again no success.. :(
here it doesn't allow to change the Order Origin Field even ..

Anybody having any idea about this situation.... plz reply....

Thanks,
Sumeet