Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Data base update concerns and capturing error messages?

Former Member
0 Likes
412

Hi All,

I have to update records to BW data to TABLE (Itu2019s a protected object and direct table update should not be a concern).

I have to delete existing (where version = xxx) records in the table and then I have to insert the new records in the table.

And if everything return code 0 then I have to commit otherwise I have to rollback all the changes in the table.

My question is - What is the good procedure to do this?

1. Currently I am using -

Delete from table.. where version =

if sy-subrc eq 0.

modify table from table lt_itab.

if sy-subrc eq 0.

commit work

else.

rollback work.

2. How to capture the error messages to my lt_message table on delete and modify statements if any errors occur?

Thanks a lot and I appreciate your response on this.

Rajesh.

2 REPLIES 2
Read only

Former Member
0 Likes
373

Hai All,

Any suggestions on my issue?

Thanks.

Read only

Former Member
0 Likes
373

There will not be any messages from a direct update (or delete). You would only have the possibility of a return code (sy-subrc). And, the "modify table from table itab", will most likely never fail. It will either create or update based on the table's key.

If you are just trying to put error in some structure, if sy-subrc is not initial move the data to some variable or issue the message statment. I cannot be more specific without knowing more of the structure of the program or programs involved. If this part of a report, function module, etc. and are there formal parameters that are involved?

If you give more details on the business process, that might help with getting a more detailed reply.

Cheers

John