2008 May 19 2:19 PM
Hi All,
I have three select statement at botom of third I am writitng
sy-subrc
will this validat only last select statement or all select statement
regards
shashiknat
2008 May 19 2:21 PM
only the last one that was executed
2008 May 19 2:21 PM
2008 May 19 2:21 PM
2008 May 19 2:58 PM
hi,
only the last select statement will be validated.
if u want to validate all three then check sy-subrc after each select statement.
if you want to execute ur code based on success of all three select queries, you can nest between if and end if
query 1
if sy-subrc = 0
query 2
if sy-subrc = 0
query 3.
if sy-subrc = 0
rest of the code
endif.
endif.
endif.
or
much cleaner way is to set a flag (lets call it l_flag) after each select query if sy-subrc is ne 0.
query 1
if sy-subrc ne 0.
l_flag = 'X'.
endif.
query 2
if sy-subrc ne 0.
l_flag = 'X'.
endif.
query 2
if sy-subrc ne 0.
l_flag = 'X'.
endif.
if l_flag NE 'X'.
proceed further.
endif.
now at the end of all three select statements you can check of the flag. n if it is blank means all three select statements were executed succesffuly.
2008 May 19 3:01 PM
Hi,
Only the last one.
the sy-subrc will be filled according to the execution of jus before the statement.
Regards
Sandeep Reddy.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |