Hi,
I'm creating small WDA application for CATS. I have a table control where cats record are created, updated and deleted. For each action there is CATS BAPI. For deleting I have to created context node, where I store deleted records before BAPI for deletion deletes them from DB (called after user press "Save changes" button on page). For inserting and deleting I'm using context change log. I have a few problems with it:
1. I can distinguish between updated and inserted records, by reading element attribute counter of CATSDB node. After user press "Save changes" button updated records are readed from context node to TABLE OF bapicats3 and by BAPI_CATIMESHEETMGR_CHANGE are saved back to DB. But If there is a problem, BAPI returns a TABLE OF bapiret2 where the problems are described with row number, where error come. I don't know how to map this number back to context element index to report this error back to user by REPORT_ELEMENT_T100_MESSAGE.
2.Application have read context change log and thru BAPI send update and insert back to DB,but there is error reported to user, but If user in this situation clicks button "Save changes" (where is logic for insert, update and delete) context change log is deleted-> application finds there is nothing to insert or update->no error reported to user-> user thinks everything OK. What is best approach in this scenario?
Many thanks for answer!