Application Development 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: 

Exit from the loop calling BADI in the method of BADI.

Former Member
0 Kudos

Hi

I am doing implementaion on BADI DIWPS_PMPS. This BADI method is being called in a loop i want to exit from the loop where the badi method is called, by coding in my BADI. how can i do so? Exit takes me out of the method only.

Can anybody please help me?

3 REPLIES 3

former_member181962
Active Contributor
0 Kudos

Hi Richa,

Maintain a Global Flag in a variable and check if its value is initial at the start of the badi method's code. Set that value on the condition you need.

check v_flag is initial.

if <condition>.

v_flag = 'X'.

endif.

Regards,

Ravi

Former Member
0 Kudos

I have tried this ...but it will exit from the method . I want to exit from the loop in which this method of BADI is called.. Can i exit from this loop in which i m calling this method of BADI.

LOOP AT it_act01 INTO ls_nw_afvgd.

  • Call BAdI

CALL METHOD lr_badi_pmps->pm_ps_field_comp

EXPORTING

pm_order_field = ls_caufvd-adpsp

ps_activity_field = ls_nw_afvgd-adpsp

revnr = i_revnr

iwerk = i_iwerk

IMPORTING

RESULT = l_result.

endloop.

0 Kudos

Unless you modify code in which LOOP is used, you cannot exit.