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

How to exit from an update Function Module

Former Member
0 Likes
665

Hi Friends,

I am using an Update Function Module in my program.The Program also has various other logics implemented in it. The Update Function Module gets triggered only when it finds COMMIT WORK statement. Now, I want that when the FM gets triggered and inside it, sy-subrc <> 0 at any stage, it should exit the complete processing and come to my main screen.

I tried to use Exit, STOP commands in the FM, but they only make the processing to exit from the FM.

Please suggest what shud I do.

Helpful suggestions will be surely rewarded.

Thanks in advance.

Regards,

Himanshu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
486

Hi Himanshu,

Once you come out the Update FM using EXIT or STOP then check for the sy-subrc in calling program and if it is not 0 then you can once again write the exit commands to the main program screen

Regards,

Atish

3 REPLIES 3
Read only

Former Member
0 Likes
487

Hi Himanshu,

Once you come out the Update FM using EXIT or STOP then check for the sy-subrc in calling program and if it is not 0 then you can once again write the exit commands to the main program screen

Regards,

Atish

Read only

0 Likes
486

in ur calling program just below the FM call write followiing statement -

Check sy-subrc EQ '0'.

Read only

Former Member
0 Likes
486

hi hemansu,

after coming out from function module check value of sy-subrc

and

if sy-subrc ne 0

exit. or leave to screen 0 [module pool progarm] or stop.

endif.

if helpful reward some points.

with regards,

suresh babu aluri.