11-23-2007 1:16 PM
hi gurus,
need to seek advice on this.
any way to make the [perform no] only show once? as abap not supports goto, what can i streamline this kind of code so that only show once.
thanks
select single .......
if sy-subrc = 0.
select single ......
if sy-subrc = 0 .
select single ....
if sy-subrc = 0.
perform yes.
else.
perform no.
endif.
else.
perform no.
endif.
else.
perform no.
endif.
11-23-2007 1:21 PM
if i understood the problem correctly... can this be the solution?
SELECT SINGLE .......
IF sy-subrc = 0.
SELECT SINGLE ......
IF sy-subrc = 0 .
SELECT SINGLE ....
IF sy-subrc = 0.
PERFORM yes.
ENDIF.
ENDIF.
ENDIF.
IF sy-subrc <> 0 .
PERFORM no.
ENDIF.
11-23-2007 1:21 PM
if i understood the problem correctly... can this be the solution?
SELECT SINGLE .......
IF sy-subrc = 0.
SELECT SINGLE ......
IF sy-subrc = 0 .
SELECT SINGLE ....
IF sy-subrc = 0.
PERFORM yes.
ENDIF.
ENDIF.
ENDIF.
IF sy-subrc <> 0 .
PERFORM no.
ENDIF.
11-23-2007 1:37 PM
hi,
thanks and point given.
so i do not need to have else and when sy-subrc <> 0 will all perform no. right?
rgds
11-23-2007 1:48 PM
if any of select statement fails the corresponding if statenment will not be executed and execution will come to to IF SY-SUBRC <> 0 with non zero sy-subrc value .
so answer is yes.. just remove all ELSEs
11-23-2007 1:45 PM
hi Eliana,
do like this:
PERFORM select_singles.
IF sy-subrc eq 0.
PERFORM yes.
ELSE.
PERFROM no.
ENDIF.
FORM select_singles.
SELECT SINGLE ...
CHECK sy-subrc EQ 0.
SELECT SINGLE ...
CHECK sy-subrc EQ 0.
SELECT SINGLE ...
ENDFORM.
hope this helps
ec