Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

check

Former Member
0 Likes
535

hi,

if i use check not within a loop is it possible? i have a function module where in this FM my coding as follows:

at any point of sy-subrc not eq 0, can it goes out of the FM? thanks

  • IF vbrk-field1 = '5678'.

check vbrk-field1 = '5678'.

SELECT SINGLE fielda FROM tablea INTO wa_fielda

WHERE fieldb EQ 'ABC'.

  • IF sy-subrc = 0.

check sy-subrc = 0.

SELECT SINGLE fieldb FROM tableb INTO wa_fieldb

WHERE fieldc EQ wa_fielda.

  • IF sy-subrc = 0.

check sy-subrc = 0.

SELECT SINGLE fieldc FROM tablec INTO wa_fieldc

WHERE fieldd EQ wa_fieldb.

  • IF sy-subrc = 0.

check sy-subrc = 0.

do something.

  • ENDIF.

  • ENDIF.

  • ENDIF.

  • ENDIF.

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
421

Yes, it should come directly out of the FM if the CHECK is not inside a looping mechanism like LOOP, DO, WHILE.

Regards,

RIch Heilman

Read only

former_member194669
Active Contributor
0 Likes
421

Please use check statement out side of the loop.

<u>

at any point of sy-subrc not eq 0, can it goes out of the FM?

</u>

this depends on your code

aRs

Read only

Former Member
0 Likes
421

el,

Yes it will come out of FM.

Thanks