Application Development 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: 

SM35: no update at all if error

manthana_c
Contributor
0 Kudos

Hi:

is there any way to tell system that if I have 100 records for batch input.

if 1 record error, I will not write/save any record at all.

1 ACCEPTED SOLUTION

former_member213204
Participant
0 Kudos

Hi Mandy,

Its not possible. If there was no error, then data was written and terminated by a commit work, so it's not possible to roll back the records that are processed. Record by record the data is uploaded by commit work.

regards,

Revanth

2 REPLIES 2

former_member184569
Active Contributor
0 Kudos

I am not sure. This is just a suggestion.

I had come across the ok codes /bbeg , /bend.

You can interrupt the interactive execution of a session by entering the /bend OK code on any screen. /bend terminates the transaction currently being executed in the session and marks the transaction with the status Incorrect.  The session is kept in the queue and is displayed in the Errors section of the list.  Changes made by the interrupted transaction are rolled back as long as the transaction uses only the R/3 update facility.  Direct database changes made by the transaction are not rolled back. 

You can restart processing of a transaction by entering the /bbeg OK code on any screen.  /bbeg terminates the transaction that is currently being processed and then restarts the transaction fresh, as it is recorded in the batch input session.  Any changes made by the transaction are rolled back, as long as they were made only by way of the R/3 update facility.  Changes made directly to the database are not rolled back. 


http://help.sap.com/saphelp_46c/helpdata/En/69/c250684ba111d189750000e8322d00/content.htm

So if you use the call transaction in Error mode and update in S mode, then you could arrive at a workaround to acheive your requirement.

CALL TRANSACTION 'SM04' USING lt_bdcdata MODE 'E' UPDATE 'S'.
Or check sy-subrc = 0, for each screen or field processing in the bdc.
If sy-subrc ne 0, or in case of error, set the next ok code to /bbeg or /bend to restart or stop the session.

former_member213204
Participant
0 Kudos

Hi Mandy,

Its not possible. If there was no error, then data was written and terminated by a commit work, so it's not possible to roll back the records that are processed. Record by record the data is uploaded by commit work.

regards,

Revanth