jayugandhi
3rd April 2014, 09:45
Hi,
I have written a afs on session tpptc1512m000. when i inserts data throgh it gives me an error "specified activity not found in activities".

urgent help is required.
here is my code.

stpapi.put.field("tpptc1512m000", "tpptc140.cprj", i.cprj)
stpapi.put.field("tpptc1512m000", "tpptc140.cspa", i.cspa)
ret = stpapi.change.view("tpptc1512m000 ",err)
ret = stpapi.synchronize.dialog("tpptc1512m000", "add", err)
if ret then
stpapi.put.field("tpptc1112s000", "tpptc140.cprj", i.cprj)
stpapi.put.field("tpptc1112s000", "tpptc140.cspa", i.cspa)
stpapi.put.field("tpptc1112s000", "tpptc140.cequ", i.cequ)
stpapi.put.field("tpptc1112s000", "tpptc140.qutm", str$(i.qutm))
stpapi.put.field("tpptc1112s000", "tpptc140.cuti", i.cuti)
stpapi.put.field("tpptc1112s000", "tpptc140.exeq", str$(etol(i.exeq)))
stpapi.put.field("tpptc1112s000", "tpptc140.stat", str$(etol(i.stat)))
stpapi.put.field("tpptc1112s000", "tpptc140.btdt", str$(i.btdt))
stpapi.put.field("tpptc1112s000", "tpptc140.ratc", str$(i.ratc))
stpapi.put.field("tpptc1112s000", "tpptc140.cocu", i.cocu)
stpapi.put.field("tpptc1112s000", "tpptc140.sacu", i.cocu)
stpapi.put.field("tpptc1112s000", "tpptc140.clas", i.clas)
stpapi.put.field("tpptc1112s000", "tpptc140.lcta", str$(i.lcta))
stpapi.put.field("tpptc1112s000", "tpptc140.cpla", i.cpla)
stpapi.put.field("tpptc1112s000", "tpptc140.cact", i.cact)

ret = stpapi.insert("tpptc1112s000",true,err)
if ret then
stpapi.end.session("tpptc1112s000")
stpapi.end.session("tpptc1512m000")
return(true)
else
ret.err = err
ret = stpapi.recover("tpptc1112s000",err)
stpapi.end.session("tpptc1112s000",err)
stpapi.end.session("tpptc1512m000",err)
return(false)
endif
else
stpapi.end.session("tpptc1512m000")
return(false)
endif
stpapi.end.session("tpptc1512m000")
return(false)

mark_h
3rd April 2014, 18:52
Is this LN? I notice you use sync dialog - is it really needed? If so then I would expect the insert to be on the main session verses the subsession. This is based off the documentation.


EXAMPLE
stpapi.put.field("dtfsa1501m000", "dtfsa101.seno", str$(i.seno))
ret = stpapi.find("dtfsa1501m000", error.msg)
if ret then
ret = stpapi.synchronize.dialog("dtfsa1501m000", "modify", error.msg)
if ret then
stpapi.put.field("dtfsa1101s000", "dtfsa101.name", new.name)
ret = stpapi.update("dtfsa1501m000", true, error.msg)
endif
endif

mark_h
3rd April 2014, 19:03
Also make sure activity is aligned correctly to the domain.