View Single Post
  #1  
Old 9th August 2017, 13:31
frenny's Avatar
frenny frenny is offline
Member
 
Join Date: Oct 2013
Posts: 48
frenny is on a distinguished road
Baan: ERP LN - DB: sqlserver 2012 - OS: winxp
Planned Order Distribution AFS Issue

Hello All,

I am Trying To create Planned Purchase Order for Manufacturing Item
But It is giving Error During Order Line Distribution

Code:
Quote:
|Get Defult Scenario
select cprpd400.plnc
from cprpd400
where cprpd400.plfd > :1
wherebind(1, utc.num())
selectdo
endselect

stpapi.put.field("cprrp1600m000", "cprrp100.plnc", cprpd400.plnc)
stpapi.put.field("cprrp1600m000", "cprrp100.type", str$(etol(tckoor.cp.pur)))
stpapi.put.field("cprrp1600m000", "cprrp100.item.segment.3", trim$(i.item))
stpapi.put.field("cprrp1600m000", "cprrp100.quan", str$(i.qnty))
if not isspace(i.cwar) then
stpapi.put.field("cprrp1600m000", "cprrp100.dwar", str$(i.cwar))
endif
ret = stpapi.insert("cprrp1600m000", true, error_message)
if ret = 1 then
stpapi.get.field("cprrp1600m000", "cprrp100.orno", get.orno)
stpapi.handle.subproc("cprrp1600m000","cprrp1105m000","add")
stpapi.put.field("cprrp1105m000", "cprrp001.cprj", i.cprj)
stpapi.put.field("cprrp1105m000", "cprrp001.cspa", i.cspa)
stpapi.put.field("cprrp1105m000", "cprrp001.cact", i.cact)
stpapi.put.field("cprrp1105m000", "cprrp105.oqan", str$(i.qnty))
stpapi.enum.answer("cprrp1105m000","cprrp150101",tcokca.ok)
ret = stpapi.insert("cprrp1105m000",true, error_message)
if ret = 1 then
stpapi.end.session("cprrp1105m000")
stpapi.end.session("cprrp1600m000")
return("")
endif
endif
stpapi.end.session("cprrp1105m000")
stpapi.end.session("cprrp1600m000")

return(error_message)
It is Giving Error:
Enter a value for Project Field.:\\n\\n Reason:Project is Mandatory
Reply With Quote