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

endless loop on BADI ME_PROCESS_PO_CUST Process_item method

Former Member
0 Likes
5,222

Hi

I encountered an error message "Data from Business Add-In ME_PROCESS_PO_CUST not adopted" when trying to use BADI

ME_PROCESS_PO_CUST Process_item method as below code. The error is saying:

Message no. MEPO151

An endless loop occurred during the processing of the Business Add-In ME_PROCESS_PO_CUST. The system terminated the processing.

Check whether standard fields are changed in the implementation of the Business Add-In ME_PROCESS_PO_CUST.

Changes to standard fields that are part of the Include structure MEPOITEM_TECH and/or MEPOSCHEDULE_TECH are generally not allowed. In addition, no field values that are not changeable through the field settings in the Enjoy transactions can be changed in the BAdI. Correct the implementation accordingly.

BUT, ekpo-eeind is not part of the standard fields declared on the above structures.

My code is to suppose to overwrite the ekpo-delivery date from contract end date, Any idea why?

Thanks in advance

METHOD if_ex_me_process_po_cust~process_item.

DATA: w_poitem TYPE mepoitem,

wlf_kdate TYPE ekko-kdate.

IF im_item->is_persistent( ) EQ mmpur_no. "Only check for new items

  • Retrieve item data into BADI buffer

w_poitem = im_item->get_data( ).

IF NOT w_poitem-konnr IS INITIAL. "If there is a contract agreement number entered

SELECT SINGLE kdate FROM ekko INTO (wlf_kdate) WHERE ebeln = w_poitem-konnr.

IF SY-SUBRC = 0.

w_poitem-eeind = wlf_kdate.

ENDIF.

ENDIF.

  • Update changes

CALL METHOD im_item->set_data

EXPORTING

im_data = w_poitem.

ENDIF.

ENDMETHOD.

Edited by: BWer on Dec 7, 2009 11:49 PM

Hi

I encountered an error message "Data from Business Add-In ME_PROCESS_PO_CUST not adopted" when trying to use BADI

ME_PROCESS_PO_CUST Process_item method as below code. The error is saying:

Message no. MEPO151

An endless loop occurred during the processing of the Business Add-In ME_PROCESS_PO_CUST. The system terminated the processing.

Check whether standard fields are changed in the implementation of the Business Add-In ME_PROCESS_PO_CUST.

Changes to standard fields that are part of the Include structure MEPOITEM_TECH and/or MEPOSCHEDULE_TECH are generally not allowed. In addition, no field values that are not changeable through the field settings in the Enjoy transactions can be changed in the BAdI. Correct the implementation accordingly.

BUT, ekpo-eeind is not part of the standard fields declared on the above structures.

My code is to suppose to overwrite the ekpo-delivery date from contract end date, Any idea why?

Thanks in advance

METHOD if_ex_me_process_po_cust~process_item.

DATA: w_poitem TYPE mepoitem,

wlf_kdate TYPE ekko-kdate.

IF im_item->is_persistent( ) EQ mmpur_no. "Only check for new items

  • Retrieve item data into BADI buffer

w_poitem = im_item->get_data( ).

IF NOT w_poitem-konnr IS INITIAL. "If there is a contract agreement number entered

SELECT SINGLE kdate FROM ekko INTO (wlf_kdate) WHERE ebeln = w_poitem-konnr.

IF SY-SUBRC = 0.

w_poitem-eeind = wlf_kdate.

ENDIF.

ENDIF.

  • Update changes

CALL METHOD im_item->set_data

EXPORTING

im_data = w_poitem.

ENDIF.

ENDMETHOD.

Edited by: BWer on Dec 7, 2009 11:49 PM

2 REPLIES 2
Read only

Former Member
0 Likes
1,993

Resolved this myself.

Alright, I finally managed to resolve the delivery date problem. I had to perform an internal date conversion from date to character format and the eeind (delivery date) MUST BE formatted to u201Cyyyy/mm/ddu201D. Otherwise, the error u2018not all dates are adoptedu2019 occurs.

Totally weird but itu2019s solved.

This routine will get executed at new po item creation with a valid contract agreement number entered, contract item will need to be entered if you have multiple line items. (default system behavior)

METHOD if_ex_me_process_po_cust~process_item.

DATA: w_poitem TYPE mepoitem,

wlf_kdate TYPE ekko-kdate,

wlf_kdate_c TYPE mepoitem-eeind,

wlf_dd TYPE CHAR2,

wlf_mm TYPE CHAR2,

wlf_yyyy TYPE CHAR4.

IF im_item->is_persistent( ) EQ mmpur_no. "Only check for new items

  • Retrieve item data into BADI buffer

w_poitem = im_item->get_data( ).

IF NOT w_poitem-konnr IS INITIAL. "If there is a contract agreement number entered

SELECT SINGLE kdate FROM ekko INTO (wlf_kdate) WHERE ebeln = w_poitem-konnr.

IF sy-subrc = 0.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

date_external = wlf_kdate

IMPORTING

date_internal = wlf_kdate_c

EXCEPTIONS

date_external_is_invalid = 1

OTHERS = 2.

wlf_yyyy = wlf_kdate_c+0(4).

wlf_mm = wlf_kdate_c+4(2).

wlf_dd = wlf_kdate_c+6(2).

CONCATENATE wlf_yyyy '/' wlf_mm '/' wlf_dd INTO wlf_kdate_c.

w_poitem-eeind = wlf_kdate_c.

  • update changes

im_item->set_data( w_poitem ).

ENDIF.

ENDIF.

ENDIF.

ENDMETHOD.

Read only

Former Member
0 Likes
1,993

I met the same issue ,how to fix it ?