on 12-07-2009 3:24 PM
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!
Hi,
solved by myself by calling BAPI only for one element values in loop thru context node... not a best solution, but working solution....
Many thanks for all replies
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
There is a key combintaion to identify the record right...when the error is thrown you need to check with the old tbale contetnts against thekey combintaion..
Or
Before you click on SAVE then try to save the data in another table...based on this the resultant DB changes can be mapped..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
many thanks for your answer.
My second point can be solved very easily by: context->get_context_change_log( and_reset = abap_false ).
But first point is a bit harder to solve: I have a context node with changed and inserted values:
1. changed
2. inserted - BAPI error
3. changed - BAPI error
4. changed
I split this context node to two itabs, one for change-BAPI one for insert-BAPI. When I call update BAPI I get back in TABLE OF bapiret2 that on row on index 1(zero-bsed index) is error (position 3. in context node). How can I find mapping between row of itab and it's context element (itab is created from context node)?
Many thanks for answer!
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.