cancel
Showing results for 
Search instead for 
Did you mean: 

endless loop in ME_PROCESS_PO_CUST->PROCESS_SCHEDULE: clear BOM by SET_BOM

former_member185943
Participant
2,065

Hi,

I am trying to use ME_PROCESS_PO_CUST BADI in order to change BOM. Inside the method PROCESS_SCHEDULE I am calling GET_BOM and SET_BOM. It works well for all the cases where I am making changes, as well as for deletions, if at least one BOM item is left behind.

However, in one case I should completely remove the whole BOM so I call SET_BOM with empty IT_BOM internal table, in which case I am getting the well known endless loop error message "Data from Business Add-In ME_PROCESS_PO_CUST not adopted". I understand the long text documentation: I should not change certain "forbidden" fields. But complete deletion should not mean that.

I found a blog Endless loop in BADI ME_PROCESS_PO_CUST which looks complex, but I think that the bottom line could be: "do not call SET statement if there are no actual changes". This does not work for me, as my attempt to delete BOMs is always unsuccessful - they re-appear in next loop pass.

In this thread there was a suggestion to clear the MY_RECHECK_QUEUE public attribute of header object. I did it - the error disappeared, but there was also no effect of my method call (exactly as stated in the thread).

The same happens if I programmatically limit the SET_BOM # of calls to 1 - no error, but also no effect.

Does anyone has any more ideas before I create OSS note?

Thanks!

KR,

Igor

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

HI Igor,

Try this please:

im_schedule->get_bom( IMPORTING et_bom = lt_bom ).

IF lt_bom[] IS NOT INITIAL.

CLEAR lt_bom.

io_sched->set_bom( it_bom = lt_bom ).

ENDIF.

Cheers

RaymondGiuseppi
Active Contributor
0 Kudos

Could you try some trick such as only refresh BOM when schedule 'IS_VALID' then and only then immediately 'INVALIDATE' the schedule (with some dummy error message such as 'BOW refreshed') does it prevent the infinite loop and is the BOM cleared?