rp.chowdary
15th September 2011, 08:19
string err.msg(2024), lino(4), orno(10), rsno(4)
long ret

stpapi.put.field( "tssoc2121m000", "tssoc220.orno", "007000010" )
ret = stpapi.find("tssoc2121m000",err.msg)
if ret = 0 then
message(" Error in Finding %s",err.msg)
else
message("Record Found %d", ret)
endif

if ret = 1 then
err.msg = ""
ret = stpapi.mark("tssoc2121m000",err.msg)
ret = stpapi.change.view( "tssoc2121m000")
ret = stpapi.synchronize.dialog("tssoc2121m000", "add", err.msg)
stpapi.put.field( "tssoc2121m000", "tssoc220.item.segment.1", "" )
stpapi.put.field( "tssoc2121m000", "tssoc220.item.segment.2", str$("TEST-SERVICING-ITEM"))
stpapi.put.field( "tssoc2121m000", "tssoc220.ccmp", str$("1122") )
stpapi.put.field( "tssoc2121m000", "tssoc220.awrh", str$("072501") )
stpapi.put.field( "tssoc2121m000", "tssoc220.ccty", str$("IND") )
stpapi.put.field( "tssoc2121m000", "tssoc220.cvat", str$("ZERO_AGG") )
stpapi.put.field( "tssoc2121m000", "tssoc220.qtdl", str$("10") )
stpapi.put.field( "tssoc2121m000", "tssoc220.rnsc.l", str$("492") )
stpapi.get.field( "tssoc2121m000", "tssoc220.lino", lino )
stpapi.get.field( "tssoc2121m000", "tssoc220.rnsc.l", rsno )
|message("%s, %s", lino, rsno)
ret = stpapi.insert("tssoc2121m000", 1, err.msg)
if not isspace(err.msg) then
message("Error while inserting item - %s",err.msg)
endif
|stpapi.recover("tssoc2121m000",err.msg)

if ret = 1 then
stpapi.get.field( "tssoc2121m000", "tssoc220.orno", orno )
stpapi.get.field( "tssoc2121m000", "tssoc220.lino", lino )
message("Item Inserted at Pos.%s/ %s", orno, lino)
endif


stpapi.end.session("tssoc2121m000")
else
stpapi.end.session("tssoc2121m000")
endif


in the above mentioned one while performing stpapi.insert I am getting Order line 00700010- 30 has zero value for ECC Code message. but i am assigning the value and getting the value for that ECC Code. but still i am getting the same error. previously i did the same thing and that worked for PO Line inserting through AFS.

Please help me in this regard.

bdittmar
15th September 2011, 11:07
Hello,
that's the wrong forum. There exist a special forum for AFS.

Hope a Moderator moves this threat.

Regards

mark_h
15th September 2011, 21:35
Yep - needs to be moved to the AFS forum.

Using AFS is not exactly like running the session manually. Just putting the fields does not fire off all the events. So when you execute an insert there could be something in some event that is resetting the field or causing the error. Do you own source for tssoc2121m000?

I am not familiar with this session so I do not know if it needs a sync dialog(or change.view). Assuming it is just a simple multi-occurence session I have no clue what these lines are for:


ret = stpapi.mark("tssoc2121m000",err.msg)
ret = stpapi.change.view( "tssoc2121m000")
ret = stpapi.synchronize.dialog("tssoc2121m000", "add", err.msg)

The first thing you do is find a record - usually that is enough. I know on my multio-ccurence sessions I just put all the fields and do an insert.