<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: endless loop on BADI ME_PROCESS_PO_CUST Process_item method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-on-badi-me-process-po-cust-process-item-method/m-p/6419055#M1409046</link>
    <description>&lt;P&gt;I met the same issue ，how to fix it ？&lt;/P&gt;</description>
    <pubDate>Mon, 23 Nov 2020 08:18:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2020-11-23T08:18:55Z</dc:date>
    <item>
      <title>endless loop on BADI ME_PROCESS_PO_CUST Process_item method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-on-badi-me-process-po-cust-process-item-method/m-p/6419053#M1409044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I encountered an error message "Data from Business Add-In ME_PROCESS_PO_CUST not adopted" when trying to use BADI &lt;/P&gt;&lt;P&gt;ME_PROCESS_PO_CUST Process_item method as below code.  The error is saying:&lt;/P&gt;&lt;P&gt;Message no. MEPO151&lt;/P&gt;&lt;P&gt;An endless loop occurred during the processing of the Business Add-In ME_PROCESS_PO_CUST. The system terminated the processing.&lt;/P&gt;&lt;P&gt;Check whether standard fields are changed in the implementation of the Business Add-In ME_PROCESS_PO_CUST.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT, ekpo-eeind is not part of the standard fields declared on the above structures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is to suppose to overwrite the ekpo-delivery date from contract end date, Any idea why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;METHOD if_ex_me_process_po_cust~process_item.&lt;/P&gt;&lt;P&gt;  DATA: w_poitem TYPE mepoitem,&lt;/P&gt;&lt;P&gt;        wlf_kdate TYPE ekko-kdate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF im_item-&amp;gt;is_persistent( ) EQ mmpur_no. "Only check for new items&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Retrieve item data into BADI buffer&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  w_poitem = im_item-&amp;gt;get_data( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT w_poitem-konnr IS INITIAL.   "If there is a contract agreement number entered&lt;/P&gt;&lt;P&gt;    SELECT SINGLE kdate FROM ekko INTO (wlf_kdate) WHERE ebeln = w_poitem-konnr.&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;       w_poitem-eeind = wlf_kdate.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Update changes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD im_item-&amp;gt;set_data&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_data = w_poitem.&lt;/P&gt;&lt;P&gt; ENDIF.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: BWer on Dec 7, 2009 11:49 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Dec 2009 22:43:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-on-badi-me-process-po-cust-process-item-method/m-p/6419053#M1409044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-07T22:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: endless loop on BADI ME_PROCESS_PO_CUST Process_item method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-on-badi-me-process-po-cust-process-item-method/m-p/6419054#M1409045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Resolved this myself.&lt;/P&gt;&lt;P&gt;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.  &lt;/P&gt;&lt;P&gt;Totally weird but itu2019s solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;METHOD if_ex_me_process_po_cust~process_item.&lt;/P&gt;&lt;P&gt;  DATA: w_poitem    TYPE mepoitem,&lt;/P&gt;&lt;P&gt;        wlf_kdate   TYPE ekko-kdate,&lt;/P&gt;&lt;P&gt;        wlf_kdate_c TYPE mepoitem-eeind,&lt;/P&gt;&lt;P&gt;        wlf_dd      TYPE CHAR2,&lt;/P&gt;&lt;P&gt;        wlf_mm      TYPE CHAR2,&lt;/P&gt;&lt;P&gt;        wlf_yyyy    TYPE CHAR4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF im_item-&amp;gt;is_persistent( ) EQ mmpur_no. "Only check for new items&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Retrieve item data into BADI buffer&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    w_poitem = im_item-&amp;gt;get_data( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF NOT w_poitem-konnr IS INITIAL.   "If there is a contract agreement number entered&lt;/P&gt;&lt;P&gt;      SELECT SINGLE kdate FROM ekko INTO (wlf_kdate) WHERE ebeln = w_poitem-konnr.&lt;/P&gt;&lt;P&gt;      IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            date_external            = wlf_kdate&lt;/P&gt;&lt;P&gt;          IMPORTING&lt;/P&gt;&lt;P&gt;            date_internal            = wlf_kdate_c&lt;/P&gt;&lt;P&gt;          EXCEPTIONS&lt;/P&gt;&lt;P&gt;            date_external_is_invalid = 1&lt;/P&gt;&lt;P&gt;            OTHERS                   = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           wlf_yyyy = wlf_kdate_c+0(4).&lt;/P&gt;&lt;P&gt;           wlf_mm = wlf_kdate_c+4(2).&lt;/P&gt;&lt;P&gt;           wlf_dd = wlf_kdate_c+6(2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           CONCATENATE wlf_yyyy '/' wlf_mm '/' wlf_dd INTO wlf_kdate_c.&lt;/P&gt;&lt;P&gt;            w_poitem-eeind           = wlf_kdate_c.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     update changes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        im_item-&amp;gt;set_data( w_poitem ).&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Dec 2009 23:25:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-on-badi-me-process-po-cust-process-item-method/m-p/6419054#M1409045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-10T23:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: endless loop on BADI ME_PROCESS_PO_CUST Process_item method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-on-badi-me-process-po-cust-process-item-method/m-p/6419055#M1409046</link>
      <description>&lt;P&gt;I met the same issue ，how to fix it ？&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 08:18:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/endless-loop-on-badi-me-process-po-cust-process-item-method/m-p/6419055#M1409046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-11-23T08:18:55Z</dc:date>
    </item>
  </channel>
</rss>

