[Series] ABAP SAP ABAP SY-SUBRC parse the meaning of

No public: SAP Technical
Author: Matinal
 

 

The preface

We can focus on my public number, the number public in the layout better, read more comfortable.

Body part

Select query using a SELECT statement:
SY-SUBRC is = 0: at least one row of data, when executing the statement ENDSELECT, SY-DBCNT number stored in the record.
SY-SUBRC = 4: No data.
SY-SUBRC = 8: Only use "SELECT SINGLE FOR UPDATE" when there will be,
he expressed: WHERE conditions specified record more than one row, the result is no records are selected.


INSERT statement, insert row to the table, care must be taken in order INSERT order consistent with field in the table:
SY-SUBRC is = 0: Successful insertion, SY-DBCNT includes several rows inserted, 0 or 1.
SY-SUBRC = 4: KEY due to the presence of the same, the insertion fails.


Using a LOOP statement to traverse the table:
SY-SUBRC is = 0: loop is executed at least once.
SY-SUBRC = 4: loop is not executed, no data may be, it may not meet the recording criteria.


Using the DELETE statement to delete a record:
SY-SUBRC is = 0: to find and delete the line, if the table has a primary key is not unique, that is, a number of duplicate records, delete only the first record.
SY-SUBRC = 4: No matching record is found, have not deleted.


Use the UPDATE statement to update a record:
SY-SUBRC is = 0: find and record updates (if multiple records it?)
SY-SUBRC is = 4: No matching record is found, there is no update.

Guess you like

Origin www.cnblogs.com/SAPmatinal/p/11183161.html