<?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 PO validating while creating... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/po-validating-while-creating/m-p/4556417#M1075670</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to validate some item level data with the header data, So i wrote the code in User Exit. Its validating well, but if i press save button its simple asking a dialog and the PO is getting saved when i have errro also.&lt;/P&gt;&lt;P&gt;i have tried  EXIT_SAPMM06E_007, EXIT_SAPMM06E_006 and EXIT_SAPMM06E_012 also. In call cases, its validating properly with throwing a message. But i am able to save...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please let me know your views on this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnks,&lt;/P&gt;&lt;P&gt;Raghu Posani.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Sep 2008 11:39:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-30T11:39:27Z</dc:date>
    <item>
      <title>PO validating while creating...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/po-validating-while-creating/m-p/4556417#M1075670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to validate some item level data with the header data, So i wrote the code in User Exit. Its validating well, but if i press save button its simple asking a dialog and the PO is getting saved when i have errro also.&lt;/P&gt;&lt;P&gt;i have tried  EXIT_SAPMM06E_007, EXIT_SAPMM06E_006 and EXIT_SAPMM06E_012 also. In call cases, its validating properly with throwing a message. But i am able to save...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please let me know your views on this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnks,&lt;/P&gt;&lt;P&gt;Raghu Posani.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2008 11:39:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/po-validating-while-creating/m-p/4556417#M1075670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-30T11:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: PO validating while creating...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/po-validating-while-creating/m-p/4556418#M1075671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Raghu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you look through the signatures of the exit-fm's you have mentioned then you see that there is no parameter available to send back an "error flag" to the main application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not very familiar with this user-exit function group but if you have BAdI &lt;STRONG&gt;ME_PROCESS_PO_CUST&lt;/STRONG&gt; available on your system you can easily implement your logic in interface method &lt;STRONG&gt;IF_EX_ME_PROCESS_PO_CUST~CHECK&lt;/STRONG&gt;, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
METHOD if_ex_me_process_po_cust~check.
* define local data
  DATA:
    lt_items      TYPE purchase_order_items,
*    ls_item       LIKE LINE OF lt_items,  " alternatively
    ls_item       TYPE purchase_order_item,
*
    ld_netwr_sum  TYPE netwr,
*
    ls_header     TYPE mepoheader,
    ls_detail     TYPE mepoitem,
    lt_details    TYPE tab_mepoitem.


"  check ( im_hold = 'X' ).  " hold purchase order



* Get the order items
  lt_items = im_header-&amp;gt;get_items( ).

  REFRESH: lt_details.
  LOOP AT lt_items INTO ls_item.
    ls_detail = ls_item-item-&amp;gt;get_data( ).

    ADD ls_detail-netwr TO ld_netwr_sum.  " Total of net price
  ENDLOOP.

* Check condition
  IF ( ld_netwr_sum &amp;gt; 1000 ).
    MESSAGE 'Net price &amp;gt; 1000 =&amp;gt; create purchase requisition' TYPE 'E'.
    ch_failed = 'X'.  "
  ENDIF.


ENDMETHOD.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "error flag" for the main program is CH_FAILED. If this CHANGING parameter is set CH_FAILED = 'X' the PO cannot be saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 03:30:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/po-validating-while-creating/m-p/4556418#M1075671</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-10-01T03:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: PO validating while creating...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/po-validating-while-creating/m-p/4556419#M1075672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Uwe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the beautiful example...&lt;/P&gt;&lt;P&gt;But when i am trying to execute the below code with warning message, the warning message is not populating. Can you please tell me, why iam unable to display the warning messages??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    SELECT SINGLE *   FROM marc
                          INTO wa_marc
                     WHERE matnr = ls_detail-matnr
                        AND   werks = ls_detail-werks
                        AND   ekgrp = ls_header-ekgrp.
      IF sy-subrc NE 0.
        +*MESSAGE W072(zmm) WITH ls_detail-ebelp.*+ 
      ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnks,&lt;/P&gt;&lt;P&gt;Raghu Posani.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 05:49:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/po-validating-while-creating/m-p/4556419#M1075672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-01T05:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: PO validating while creating...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/po-validating-while-creating/m-p/4556420#M1075673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi raghu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try issuing an Error Message instead of Warning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then why you have enclosed message statement with +* ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try removing that and try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;
&amp;gt;         +*MESSAGE W072(zmm) WITH ls_detail-ebelp.*+ 
&amp;gt; &lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 06:27:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/po-validating-while-creating/m-p/4556420#M1075673</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-01T06:27:34Z</dc:date>
    </item>
  </channel>
</rss>

