<?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: Purchase Order amount  validation. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488970#M2002382</link>
    <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;abaplearner&lt;/SPAN&gt; I see that you want to capture 1905.92 of condition type(Total Value) on PO header, not PO item. &lt;/P&gt;&lt;P&gt;Then the easiest is to implement exit in EXIT_SAPMM06E_012(same in MM06E005). This exit will be triggered when you save the PO. &lt;/P&gt;&lt;P&gt;Below is a sample code and it's working for me. The error message will be prompted if the amount exceeds and prevent user from saving.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  READ TABLE TKOMV ASSIGNING FIELD-SYMBOL(&amp;lt;LS_TKOMV&amp;gt;)&lt;BR /&gt;    WITH KEY&lt;BR /&gt;    KSCHL = 'Your condition type'.   "Search for total amount&lt;BR /&gt;&lt;BR /&gt;  IF SY-SUBRC = 0.&lt;BR /&gt;    IF &amp;lt;LS_TKOMV&amp;gt;-KAWRT &amp;gt; '20000000'.&lt;BR /&gt;      MESSAGE 'Item amount not allowed. Please correct the net price or quantity' TYPE 'E'.&lt;BR /&gt;    ENDIF.&lt;BR /&gt;  ENDIF.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 24 Jan 2022 13:12:25 GMT</pubDate>
    <dc:creator>aoyang</dc:creator>
    <dc:date>2022-01-24T13:12:25Z</dc:date>
    <item>
      <title>Purchase Order amount  validation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488963#M2002375</link>
      <description>&lt;P&gt;My requirement is to apply the po amount check validation. User cannot able to create the Po with amount more than 2 lakh. If the user try to create the po with 2 lakh system throw a message .&lt;/P&gt;
  &lt;P&gt;Is it feasible using user exit or badi or any other way ?&lt;/P&gt;
  &lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 10:54:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488963#M2002375</guid>
      <dc:creator>former_member605939</dc:creator>
      <dc:date>2022-01-21T10:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Purchase Order amount  validation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488964#M2002376</link>
      <description>&lt;P&gt;There are plenty of similar questions and blogs too on the topic, you just need to google "SAP PO BADI CHECK" and you'll find them, like &lt;A href="https://blogs.sap.com/2017/11/28/sap-po-error-handling-using-badi-me_process_po_cust/" target="_blank"&gt;this one&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 11:04:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488964#M2002376</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2022-01-21T11:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Purchase Order amount  validation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488965#M2002377</link>
      <description>&lt;P&gt;Look at the multiple threads/questions suggesting BAdI &lt;A href="https://community.sap.com/search/?ct=all&amp;amp;q=ME_PROCESS_PO_CUST"&gt;ME_PROCESS_PO_CUST&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;You can use method CHECK which allows error message and is always executed before save, you could also use method PROCESS_ITEM if you want to raise the error as soon as the user override the amount limit. In both case get list of items and sum their amount.&lt;/P&gt;&lt;P&gt;NB: Usually this kind of check is part of the &lt;A href="https://community.sap.com/search/?ct=blog&amp;amp;q=Purchase%20Order%20Release%20Strategy"&gt;Purchase Order Release Strategy&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 11:10:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488965#M2002377</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2022-01-21T11:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Purchase Order amount  validation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488966#M2002378</link>
      <description>&lt;P&gt;Alternatively, you can use customer exit MM06E005. Implement a project and put below code in  EXIT_SAPMM06E_017 component, inside include ZXM06U42. You can add the logic to check currency if you want(assuming lakh is currency expression in INR).&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  IF I_EKPO-NETWR &amp;gt; 'Your amount limit'.&lt;BR /&gt;    MESSAGE 'Item amount not allowed. Please correct the net price or quantity' TYPE 'E'.&lt;BR /&gt;  ENDIF.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jan 2022 11:27:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488966#M2002378</guid>
      <dc:creator>aoyang</dc:creator>
      <dc:date>2022-01-21T11:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Purchase Order amount  validation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488967#M2002379</link>
      <description>&lt;P&gt;I checked the BAdI &lt;A href="https://community.sap.com/search/?ct=all&amp;amp;q=ME_PROCESS_PO_CUST"&gt;ME_PROCESS_PO_CUST&lt;/A&gt; with  method IF_EX_ME_PROCESS_PO_CUST~CHECK. In this case find out the following&lt;/P&gt;&lt;P&gt;CALL METHOD im_header-&amp;gt;get_items&lt;/P&gt;&lt;P&gt;   RECEIVING&lt;/P&gt;&lt;P&gt;      re_items = lt_items.&lt;/P&gt;&lt;P&gt;  LOOP AT lt_items INTO ls_item.&lt;/P&gt;&lt;P&gt;    CALL METHOD ls_item-item-&amp;gt;get_data&lt;/P&gt;&lt;P&gt;      RECEIVING&lt;/P&gt;&lt;P&gt;        re_data = ls_item_data.&lt;/P&gt;&lt;P&gt;      CALL METHOD lo_po_doc-&amp;gt;get_tkomv&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          ex_tkomv = lt_conditions.&lt;/P&gt;&lt;P&gt;      SORT lt_conditions BY kschl.&lt;/P&gt;&lt;P&gt;collected the line item wise data.  Now need to write the logic based on lt_conditions table using kschl.&lt;/P&gt;&lt;P&gt;Is it right way to do the processing.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;similarly if i am using exit EXIT_SAPMM06E_017. the  following structures are updated &lt;/P&gt;&lt;P&gt;     TEKPO STRUCTURE  BEKPO OPTIONAL&lt;/P&gt;&lt;P&gt;     TEKET STRUCTURE  BEKET OPTIONAL&lt;/P&gt;&lt;P&gt;     TEKKN STRUCTURE  EKKNU OPTIONAL&lt;/P&gt;&lt;P&gt;      TKOMV STRUCTURE  KOMV OPTIONAL&lt;/P&gt;&lt;P&gt;need to do the calculations based on po line item and  komv .&lt;/P&gt;&lt;P&gt;Is it right way to do the processing.&lt;/P&gt;&lt;P&gt;Is there any other way that can i get the total amount (directly  no need to do calculations )  and trigger a message based on amount. Like it is populating in the PO Header conditions Total Value 1905.92&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I want to capture the Total Value 1905.92 and trigger the message .&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2010837-po-total-amount.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 11:00:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488967#M2002379</guid>
      <dc:creator>former_member605939</dc:creator>
      <dc:date>2022-01-24T11:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Purchase Order amount  validation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488968#M2002380</link>
      <description>&lt;P&gt; EXIT_SAPMM06E_017.  used the structures &lt;/P&gt;&lt;P&gt;TEKPO STRUCTURE BEKPO OPTIONAL&lt;/P&gt;&lt;P&gt;TEKET STRUCTURE BEKET OPTIONAL&lt;/P&gt;&lt;P&gt;TEKKN STRUCTURE EKKNU OPTIONAL&lt;/P&gt;&lt;P&gt;TKOMV STRUCTURE KOMV OPTIONAL&lt;/P&gt;&lt;P&gt;need to do the calculations based on po line item and komv . If po has multiple line items need to loop at line item and prosess the TKOMV table.&lt;/P&gt;&lt;P&gt;Is it right way to do the processing.&lt;/P&gt;&lt;P&gt;Is there any other way that can i get the total amount (directly no need to do calculations ) and trigger a message based on amount. Like it is populating in the PO Header conditions Total Value 1905.92&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 12:00:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488968#M2002380</guid>
      <dc:creator>former_member605939</dc:creator>
      <dc:date>2022-01-24T12:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Purchase Order amount  validation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488969#M2002381</link>
      <description>&lt;P&gt;Try to  read in CHECK or PROCESS_HEADER the conditions at header level using GET_CONDITIONS on IM_HEADER&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 12:38:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488969#M2002381</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2022-01-24T12:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Purchase Order amount  validation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488970#M2002382</link>
      <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;abaplearner&lt;/SPAN&gt; I see that you want to capture 1905.92 of condition type(Total Value) on PO header, not PO item. &lt;/P&gt;&lt;P&gt;Then the easiest is to implement exit in EXIT_SAPMM06E_012(same in MM06E005). This exit will be triggered when you save the PO. &lt;/P&gt;&lt;P&gt;Below is a sample code and it's working for me. The error message will be prompted if the amount exceeds and prevent user from saving.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  READ TABLE TKOMV ASSIGNING FIELD-SYMBOL(&amp;lt;LS_TKOMV&amp;gt;)&lt;BR /&gt;    WITH KEY&lt;BR /&gt;    KSCHL = 'Your condition type'.   "Search for total amount&lt;BR /&gt;&lt;BR /&gt;  IF SY-SUBRC = 0.&lt;BR /&gt;    IF &amp;lt;LS_TKOMV&amp;gt;-KAWRT &amp;gt; '20000000'.&lt;BR /&gt;      MESSAGE 'Item amount not allowed. Please correct the net price or quantity' TYPE 'E'.&lt;BR /&gt;    ENDIF.&lt;BR /&gt;  ENDIF.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Jan 2022 13:12:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488970#M2002382</guid>
      <dc:creator>aoyang</dc:creator>
      <dc:date>2022-01-24T13:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Purchase Order amount  validation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488971#M2002383</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;raymond.giuseppi&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;I checked the IF_EX_ME_PROCESS_PO_CUST~CHECK and IF_EX_ME_PROCESS_PO_CUST~POST. It is working fine for TCODE :ME21N/ME22N but the BADI is not triggering for  T-CODE :ME21/ME22 .Is this badi for Enjoy transactions only ?&lt;/P&gt;&lt;P&gt;My requirement is getting fulfilled for ME21N AND ME22N.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 07:47:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488971#M2002383</guid>
      <dc:creator>former_member605939</dc:creator>
      <dc:date>2022-01-28T07:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Purchase Order amount  validation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488972#M2002384</link>
      <description>&lt;P&gt;HI &lt;SPAN class="mention-scrubbed"&gt;aocheng&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I implemented the EXIT_SAPMM06E_012(same in MM06E005).  it is working fine for ME21N/ME22N but but for ME21/ME22 it is giving dump.&lt;/P&gt;&lt;P&gt;  The system attempted to use dynpro 0111 in program "SAPLXM06".&lt;/P&gt;&lt;P&gt;  This dynpro does not exist.&lt;/P&gt;&lt;P&gt;"DYNPRO_NOT_FOUND" " "&lt;/P&gt;&lt;P&gt;"SAPLXM06" or "MM06EO0C_CUSTSCR1_ITEM_SET_DAT"&lt;/P&gt;&lt;P&gt;"EXIT_SAPMM06E_006"&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 07:51:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488972#M2002384</guid>
      <dc:creator>former_member605939</dc:creator>
      <dc:date>2022-01-28T07:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Purchase Order amount  validation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488973#M2002385</link>
      <description>&lt;P&gt;Yes this BAdI is only for Enjoy transactions.&lt;/P&gt;&lt;P&gt;NB: The old transactions are now obsolete from some time (&lt;A href="https://launchpad.support.sap.com/#/notes/1803189"&gt;1803189 - FAQ: End of Support of ME21, ME51, BAPI_PO_CREATE and Archiving Reports etc.&lt;/A&gt; - '... from April 2013 onwards ...')&lt;/P&gt;&lt;P&gt;The question is 'why these old transactions are still active in your systems', do users really need them or are some old BDC programs still active and have not yet migrated to BAPI processing?&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NB: Even if you try to use an 'old' customer exit such as MM06E005, the behavior of the old transactions can (and will, Murphy's Law) differ from that of the Enjoy transactions, you may have to process some customer screens for customer fields and the like, and you will have some difficulties maintaining the exit to perform well for both versions (9 years difference).&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 10:05:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/purchase-order-amount-validation/m-p/12488973#M2002385</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2022-01-31T10:05:19Z</dc:date>
    </item>
  </channel>
</rss>

