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

logic needed

Former Member
0 Likes
692

my logic goes this way

i have a loop which is on material numbers

inside the loop we have a 4 performs

inside my first perform i have a function module

now my requirement is

after comming out from function module if sy-subrc = 0.

i need to proceed further

and if sy-subrc <> 0

i need to come out of the perform and i should not process

the other preceeding performs.

finally i have to go to next material in the loop.

can any one help me in this..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
673

HI

data: flag typ c.

write code inside perform

if sy-subrc <> 0.

flag = 'X'.

exit.

endif.

Outside perform write down

Perform xyz.

if flag = 'X'

continue.

endif.

Aditya

6 REPLIES 6
Read only

Former Member
0 Likes
674

HI

data: flag typ c.

write code inside perform

if sy-subrc <> 0.

flag = 'X'.

exit.

endif.

Outside perform write down

Perform xyz.

if flag = 'X'

continue.

endif.

Aditya

Read only

Former Member
0 Likes
673

Loop at itab.

perform first changing subrc.

if subrc NE 0.

continue.

endif.

perform second

perform third

perform fourth .

endloop.

Read only

Former Member
0 Likes
673

try something like this

Loop at it_mat_tab.
  
 perform do_something changing rc.
 check rc = 0.
 perform do_more.
Endloop.

form do_something changing rc.
  
 CALL FUNCTION 'XYZ'.

  check sy-subrc eq 0.
  rc = sy-subrc
  exit
Endform.

cheers

VJ

Read only

Former Member
0 Likes
673

hi

loop at itab.

clear flag.

perform a1.

if flag = X..

perform a2.

perform a3.

perform a4.

else.

exit.

endif.

endloop.

form a1.

call function ''ABC".

.

.

.

if sy-subrc = 0.

flag = 'X'.

endif.

endform.

Thanks & Regards

vinsee

Read only

Former Member
0 Likes
673

thanks guys

Read only

Former Member
0 Likes
673

HI,

you can have this code:

loop at itab.

.

.

perform1

perform2

perform3

.

.

endloop.

let us take

form1

call function module 'fm'.

.

.

.

if sy-subrc ne 0.

continue.

endif.

endform.

this will work.

so reward me if is useful.

thanks

AM