ulrich.fuchs
26th October 2007, 18:14
I am trying to create production planning with AFS - basically I want to be able to copy over the operation sequence, work centers etc. from some other order. However I always get an "Production Item not Valid" error message back from AFS. The item field (tisfc010.item) however is a readonly field in the session
Any ideas? Has anyone already succeeded in inserting a sequence of tisfc010 lines automatically?
System is LN6.1 FP2 and any help greatly appreciated...
function long add.sfc010 () {
long ret
domain tcmcs.str132 errmess
select tisfc010.*,
tisfc001.*
from tisfc010,
tisfc001
where tisfc010._index1 = {:pdno.to.split}
and tisfc010.pdno refers to tisfc001
order by tisfc010._index1
selectdo
stpapi.put.field ("tisfc0110m000", "tisfc010.pdno", new.pdno)
ret = stpapi.change.view ("tisfc0110m000")
stpapi.synchronize.dialog("tisfc0110m000", "add", errmess)
stpapi.put.field ("tisfc0110m000", "tisfc010.pdno", new.pdno)
stpapi.put.field ("tisfc0110m000", "tisfc010.opno", str$(tisfc010.opno))
stpapi.put.field ("tisfc0110m000", "tisfc010.tano", tisfc010.tano)
stpapi.put.field ("tisfc0110m000", "tisfc010.cwoc", tisfc010.cwoc)
stpapi.put.field ("tisfc0110m000", "tisfc010.rutm", str$(tisfc010.rutm))
stpapi.put.field ("tisfc0110m000", "tisfc010.sutm", str$(tisfc010.sutm))
| Does not help
|stpapi.put.field ("tisfc0110m000", "tisfc010.item.segment.1", tisfc010.item (1;9))
|stpapi.put.field ("tisfc0110m000", "tisfc010.item.segment.2", tisfc010.item (10;55))
ret = stpapi.insert("tisfc0110m000", false, errmess)
if not ret then
message (errmess)
stpapi.end.session ("tisfc0110m000")
return (DALHOOKERROR)
endif
ret = stpapi.save("tisfc0110m000", errmess)
if not ret then
message (errmess)
stpapi.end.session ("tisfc0110m000")
return (DALHOOKERROR)
endif
selecteos
stpapi.end.session ("tisfc0110m000")
endselect
return (0)
}
Any ideas? Has anyone already succeeded in inserting a sequence of tisfc010 lines automatically?
System is LN6.1 FP2 and any help greatly appreciated...
function long add.sfc010 () {
long ret
domain tcmcs.str132 errmess
select tisfc010.*,
tisfc001.*
from tisfc010,
tisfc001
where tisfc010._index1 = {:pdno.to.split}
and tisfc010.pdno refers to tisfc001
order by tisfc010._index1
selectdo
stpapi.put.field ("tisfc0110m000", "tisfc010.pdno", new.pdno)
ret = stpapi.change.view ("tisfc0110m000")
stpapi.synchronize.dialog("tisfc0110m000", "add", errmess)
stpapi.put.field ("tisfc0110m000", "tisfc010.pdno", new.pdno)
stpapi.put.field ("tisfc0110m000", "tisfc010.opno", str$(tisfc010.opno))
stpapi.put.field ("tisfc0110m000", "tisfc010.tano", tisfc010.tano)
stpapi.put.field ("tisfc0110m000", "tisfc010.cwoc", tisfc010.cwoc)
stpapi.put.field ("tisfc0110m000", "tisfc010.rutm", str$(tisfc010.rutm))
stpapi.put.field ("tisfc0110m000", "tisfc010.sutm", str$(tisfc010.sutm))
| Does not help
|stpapi.put.field ("tisfc0110m000", "tisfc010.item.segment.1", tisfc010.item (1;9))
|stpapi.put.field ("tisfc0110m000", "tisfc010.item.segment.2", tisfc010.item (10;55))
ret = stpapi.insert("tisfc0110m000", false, errmess)
if not ret then
message (errmess)
stpapi.end.session ("tisfc0110m000")
return (DALHOOKERROR)
endif
ret = stpapi.save("tisfc0110m000", errmess)
if not ret then
message (errmess)
stpapi.end.session ("tisfc0110m000")
return (DALHOOKERROR)
endif
selecteos
stpapi.end.session ("tisfc0110m000")
endselect
return (0)
}