2008 Aug 23 10:24 AM
Why We need to use SY-SUBRC check after SELECT Statement?If we do'nt use whether it will give dump?
Thanks
Umesh
2008 Aug 23 10:31 AM
Why We need to use SY-SUBRC check after SELECT Statement?Below is what i got from F1 help.
The SELECT statement sets the values of the system fields sy-subrc and sy-dbcnt.
sy-subrc Relevance
0 The SELECT statement sets sy-subrc to 0 for every pass by value to an ABAP data object. The ENDSELECT statement sets sy-subrc to 0 if at least one row was transferred in the SELECT loop.
4 The SELECT statement sets sy-subrc to 4 if the result set is empty, that is, if no data was found in the database.
8 The SELECT statement sets sy-subrc to 8 if the FOR UPDATE addition is used in result, without the primary key being specified fully after WHERE.
After every value that is transferred to an ABAP data object, the SELECT statement sets sy-dbcnt to the number of rows that were transferred. If the result set is empty, sy-dbcnt is set to 0.
If we do'nt use whether it will give dump?No.But good practice if your use.
Amit.
Why We need to use SY-SUBRC check after SELECT Statement?Below is what i got from F1 help.
The SELECT statement sets the values of the system fields sy-subrc and sy-dbcnt.
sy-subrc Relevance
0 The SELECT statement sets sy-subrc to 0 for every pass by value to an ABAP data object. The ENDSELECT statement sets sy-subrc to 0 if at least one row was transferred in the SELECT loop.
4 The SELECT statement sets sy-subrc to 4 if the result set is empty, that is, if no data was found in the database.
8 The SELECT statement sets sy-subrc to 8 if the FOR UPDATE addition is used in result, without the primary key being specified fully after WHERE.
After every value that is transferred to an ABAP data object, the SELECT statement sets sy-dbcnt to the number of rows that were transferred. If the result set is empty, sy-dbcnt is set to 0.
If we do'nt use whether it will give dump?No.But good practice if your use.
Amit.
2008 Aug 23 10:27 AM
Hi
Well SY-SUBRC is a system field when ever any operation successfully completes then its value is 0 and if fails then its value will be not equal to zero.So to know wheteher the SELECt operation is succesful or not we are validating teh SY-SUBRC eq 0 or not that'sa ll.
Regards
pavan
2008 Aug 23 10:30 AM
hi,
its not goin to give any dump.
but if u want to execute other statements after u r select statement u can give sy-subrc condition
regards
prasad
2008 Aug 23 10:31 AM
Why We need to use SY-SUBRC check after SELECT Statement?Below is what i got from F1 help.
The SELECT statement sets the values of the system fields sy-subrc and sy-dbcnt.
sy-subrc Relevance
0 The SELECT statement sets sy-subrc to 0 for every pass by value to an ABAP data object. The ENDSELECT statement sets sy-subrc to 0 if at least one row was transferred in the SELECT loop.
4 The SELECT statement sets sy-subrc to 4 if the result set is empty, that is, if no data was found in the database.
8 The SELECT statement sets sy-subrc to 8 if the FOR UPDATE addition is used in result, without the primary key being specified fully after WHERE.
After every value that is transferred to an ABAP data object, the SELECT statement sets sy-dbcnt to the number of rows that were transferred. If the result set is empty, sy-dbcnt is set to 0.
If we do'nt use whether it will give dump?No.But good practice if your use.
Amit.
2008 Aug 23 10:50 AM
Good question
instead of asking this question just execute and see the result wether it give dump or not.
Either u are very new to ABAP and do not bother to study or u are asking such qustion just for the sake of points
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |