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

Problem with PR Badi ME_PROCESS_REQ_CUST

Former Member
0 Likes
733

Hi All,

Problem with PR Badi ME_PROCESS_REQ_CUST

My requirement is

At the time of PR creation (ME51N), if the document type (BSART) is 'XX',

Item level Goods Receipt field(WEPOS) should be un-checked automatically.

I am using the badi ME_PROCESS_REQ_CUST

Method PROCESS_ITEM.

When I use the following code, it is going to infinite loop. This method is getting called repeatedlt and going to infinite loop.

Can u plz write your comments.

*************************************************************************************

method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ITEM .

DATA WA_DATA TYPE MEREQ_ITEM.

CALL METHOD IM_ITEM->GET_DATA

RECEIVING

RE_DATA = WA_DATA.

if WA_DATA-BSART = 'FO'.

WA_DATA-WEPOS = ''.

ENDIF.

CALL METHOD IM_ITEM->SET_DATA

EXPORTING

IM_DATA = WA_DATA.

endmethod.

*************************************************************************************

I kept break point after get_data method, I and getting BSART value and changing the WEPOS VALUE.

When I use SE_DATA method, it is going to infinite loop.

Thanks

Narendra

1 REPLY 1
Read only

Former Member
0 Likes
403

Execute the code within IF condition

IF IM_COUNT eq 1.
  Code Lines
ENDIF.