<?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: ME_PROCESS_REQ_CUST~PROCESS_ITEM validation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398349#M1546495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I prefer not to replicate the validation on check if it can be done at the process_item&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've found on note 611175 the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;If you want to flag the document item as invalid, use method IS_VALID() of interface IF_PURCHASE_REQUISITION_ITEM for this. Do not forget to flag return parameter re_valid as mmpur_rule_invalid.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I flag a return parameter?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Nov 2010 18:10:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-11-04T18:10:18Z</dc:date>
    <item>
      <title>ME_PROCESS_REQ_CUST~PROCESS_ITEM validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398345#M1546491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wish to implement a validation on this BAdI for transaction ME51N, so that when it fails it should block the transaction (just like a missing required field does)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can I make the item invalid and raise an error description to the screen?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;right now I am just trying to fail for all cases, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ITEM.

  data: lv_description(200) type c.

  lv_description = 'fails no matter what'.

  im_item-&amp;gt;FAIL( exporting error = lv_description ).

endmethod.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can this be done inside this bapi/method?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried using the check method, but&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 15:29:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398345#M1546491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-04T15:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: ME_PROCESS_REQ_CUST~PROCESS_ITEM validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398346#M1546492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to add include &lt;STRONG&gt;MM_MESSAGES_MAC&lt;/STRONG&gt; to your class. Furthermore, you cannot raise errors within a BAdI but collect the error messages. For sample coding see class &lt;STRONG&gt;CL_PO_HEADER_HANDLE_MM&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
METHOD po_read.

  INCLUDE mm_messages_mac.   " &amp;lt;&amp;lt;&amp;lt;

  DATA: l_po_number TYPE ekko-ebeln.

  IF im_po_number NE space.
    l_po_number = im_po_number.
  ELSE.
    l_po_number = po_number.
  ENDIF.

* authority check on transaction code disabled
* If called via CALL TRANSACTION, this check is already done by basis
* (see note 358122)
* restriction of T-code authority check to Enjoy only
  IF for_bapi IS INITIAL.
* tcode authorization
    IF NOT im_tcode IS INITIAL.
      CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
        EXPORTING
          tcode  = im_tcode
        EXCEPTIONS
          ok     = 0
          not_ok = 1
          OTHERS = 2.
      IF sy-subrc NE 0.
        MESSAGE e172(00) WITH im_tcode INTO gl_dummy.
        mmpur_message_forced 'E' '00' '172' im_tcode '' '' ''.   " &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;
        ex_result = mmpur_no.
        CALL METHOD set_state( im_state = c_available ).
        EXIT.
      ENDIF.
    ENDIF.
  ENDIF.
...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&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>Thu, 04 Nov 2010 15:48:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398346#M1546492</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2010-11-04T15:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: ME_PROCESS_REQ_CUST~PROCESS_ITEM validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398347#M1546493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;fantastic, error message is now shown, just one more thing to solve the problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can make the item invalid, so as to block the transaction from saving the purchase request? (just raising the error message does not block it)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or does this depends on which message is called?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 16:03:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398347#M1546493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-04T16:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: ME_PROCESS_REQ_CUST~PROCESS_ITEM validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398348#M1546494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think if you implement method &lt;STRONG&gt;CHECK&lt;/STRONG&gt; (Closing check) and return &lt;STRONG&gt;CH_FAILED = 'X'&lt;/STRONG&gt; then the user probably cannot save the PO requisition.&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>Thu, 04 Nov 2010 16:21:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398348#M1546494</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2010-11-04T16:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: ME_PROCESS_REQ_CUST~PROCESS_ITEM validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398349#M1546495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I prefer not to replicate the validation on check if it can be done at the process_item&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've found on note 611175 the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;If you want to flag the document item as invalid, use method IS_VALID() of interface IF_PURCHASE_REQUISITION_ITEM for this. Do not forget to flag return parameter re_valid as mmpur_rule_invalid.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I flag a return parameter?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 18:10:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398349#M1546495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-04T18:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: ME_PROCESS_REQ_CUST~PROCESS_ITEM validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398350#M1546496</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;Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; DATA: L_VALID TYPE MMPUR_BOOL.

  IM_ITEM-&amp;gt;IS_VALID( RECEIVING RE_VALID = L_VALID  ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 18:34:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398350#M1546496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-04T18:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: ME_PROCESS_REQ_CUST~PROCESS_ITEM validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398351#M1546497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Method &lt;STRONG&gt;IS_VALID&lt;/STRONG&gt; just returns the current status of the item.&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>Thu, 04 Nov 2010 18:38:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398351#M1546497</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2010-11-04T18:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: ME_PROCESS_REQ_CUST~PROCESS_ITEM validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398352#M1546498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are absolutely right, SAP's note in incorrect.. either that or I need to implement another.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 09:34:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/me-process-req-cust-process-item-validation/m-p/7398352#M1546498</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-05T09:34:05Z</dc:date>
    </item>
  </channel>
</rss>

