Skip to Content
author's profile photo Former Member
Former Member

if statement

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Nov 23, 2007 at 01: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.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 23, 2007 at 01: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.