hs.emg
2nd April 2014, 11:11
Need help for a problem using AFS for setting NetQty in Manufactory-Order materialposition.
In following script I try to change the value of the maskfield qune, but after provessing the fieldvalue in database ist unchanged.
select ticst001.*
from ticst001
where ticst001._index1 = {:i.pdno}
and ticst001.sitm = :i.item
selectdo
if i.issu > 0 then
if ticst001.qune > i.issu then
ticst001.qune = ticst001.qune - i.issu
i.issu = 0
else
i.issu = i.issu - ticst001.qune
ticst001.qune = 0
endif
stpapi.clear( "ticst0101m100")
stpapi.put.field("ticst0101m100", "ticst001.pdno", i.pdno)
ret = stpapi.change.view("ticst0101m100", error)
stpapi.put.field("ticst0101m100", "ticst001.pdno", i.pdno)
stpapi.put.field("ticst0101m100", "ticst001.pono", str$(ticst001.pono))
ret = stpapi.find("ticst0101m100", error)
if ret = 1 then
ret = stpapi.synchronize.dialog("ticst0101m100", "modify", error)
if not ret then
retval2 = stpapi.recover("ticst0101m100", recover.msg)
else
stpapi.put.field("ticst0101m100", "ticst001.qune", str$(ticst001.qune))
retval1 = stpapi.update("ticst0101m100", true, error)
if not retval1 then
retval2 = stpapi.recover("ticst0101m100", recover.msg)
else
rtn.code = true
endif
endif
else
retval2 = stpapi.recover("ticst0101m100", recover.msg)
if isspace(strip$(error)) then
error = "Datensatz nicht gefunden!"
endif
endif
stpapi.end.session( "ticst0101m100" )
endif
selectempty
error = "Datensatz in ticst001 nicht vorhanden!"
endselect
Thanks for any tips or help in advance!
In following script I try to change the value of the maskfield qune, but after provessing the fieldvalue in database ist unchanged.
select ticst001.*
from ticst001
where ticst001._index1 = {:i.pdno}
and ticst001.sitm = :i.item
selectdo
if i.issu > 0 then
if ticst001.qune > i.issu then
ticst001.qune = ticst001.qune - i.issu
i.issu = 0
else
i.issu = i.issu - ticst001.qune
ticst001.qune = 0
endif
stpapi.clear( "ticst0101m100")
stpapi.put.field("ticst0101m100", "ticst001.pdno", i.pdno)
ret = stpapi.change.view("ticst0101m100", error)
stpapi.put.field("ticst0101m100", "ticst001.pdno", i.pdno)
stpapi.put.field("ticst0101m100", "ticst001.pono", str$(ticst001.pono))
ret = stpapi.find("ticst0101m100", error)
if ret = 1 then
ret = stpapi.synchronize.dialog("ticst0101m100", "modify", error)
if not ret then
retval2 = stpapi.recover("ticst0101m100", recover.msg)
else
stpapi.put.field("ticst0101m100", "ticst001.qune", str$(ticst001.qune))
retval1 = stpapi.update("ticst0101m100", true, error)
if not retval1 then
retval2 = stpapi.recover("ticst0101m100", recover.msg)
else
rtn.code = true
endif
endif
else
retval2 = stpapi.recover("ticst0101m100", recover.msg)
if isspace(strip$(error)) then
error = "Datensatz nicht gefunden!"
endif
endif
stpapi.end.session( "ticst0101m100" )
endif
selectempty
error = "Datensatz in ticst001 nicht vorhanden!"
endselect
Thanks for any tips or help in advance!