<?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: MRM_DUPLICATE_INVOICE_CHECK in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/mrm-duplicate-invoice-check/m-p/12259878#M1986989</link>
    <description>&lt;P&gt;Thanks Raymond, but we are still on ECC and the note 2511288 won't help us.&lt;/P&gt;&lt;P&gt;And regarding the MESSAGE statement, the program execution does not even reach the 'IF Sy-SybRc &amp;lt;&amp;gt; 0' statement. The Error message screen shown in my original post, comes up before that. I understand that probably is because of the configuration but I want to trap the Error and then move to the next record.&lt;/P&gt;&lt;P&gt;-Amit.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Oct 2020 21:25:31 GMT</pubDate>
    <dc:creator>amitpurohit</dc:creator>
    <dc:date>2020-10-19T21:25:31Z</dc:date>
    <item>
      <title>MRM_DUPLICATE_INVOICE_CHECK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mrm-duplicate-invoice-check/m-p/12259874#M1986985</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;I have a requirement to create an Incoming Invoice, with an additional check to avoid duplicate invoice creation. For this I am calling MRM_DUPLICATE_INVOICE_CHECK FM but the program gives out an Error (see the image below) and exits. My goal is to trap the error that is displayed and then display a summary for the user. Is there a way to do that?&lt;/P&gt;
  &lt;P&gt;I have tried MRM_FI_DOCUMENT_CHECK and FI_DUPLICATE_INVOICE_CHECK with the same results.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'MRM_DUPLICATE_INVOICE_CHECK'
  EXPORTING
    i_bukrs                      = 'IM21'
    i_lifnr                      = '00139'
    i_waers                      = 'USD'
    i_xblnr                      = 'VENDORINV001'
    i_bldat                      = '20201006'
    i_rmwwr                      = '931.2'
    i_xrech                      = 'X'
*   I_BELNR                      =
*   I_BLART                      =
*   I_PREPAY_AWKEY               =
 EXCEPTIONS
   INVOICE_ALREADY_EXISTS       = 1
   OTHERS                       = 2
          .

BREAK-POINT.
 IF sy-subrc &amp;lt;&amp;gt; 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE. 
   WRITE : / 'Invoice already created for given Reference #'.
 ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1851764-capture.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 20:27:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mrm-duplicate-invoice-check/m-p/12259874#M1986985</guid>
      <dc:creator>amitpurohit</dc:creator>
      <dc:date>2020-10-13T20:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: MRM_DUPLICATE_INVOICE_CHECK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mrm-duplicate-invoice-check/m-p/12259875#M1986986</link>
      <description>&lt;P&gt;Hi Amit &lt;/P&gt;&lt;P&gt;Can you confirm if at the vendor master data you checked
double inv checkbox&lt;/P&gt;&lt;P&gt;This can also be handled by the config not sure if you still
want to use the Function module? &lt;/P&gt;&lt;P&gt; SPRO-&amp;gt;Materials
Magement -&amp;gt; Logistics invoice verification -&amp;gt; Incoming invoice -&amp;gt; Set
check for Duplicate invoices.&lt;/P&gt;&lt;P&gt;Follow a document here which also explains the checks you
need to maintain at vendor master record level &lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2013/01/24/duplicate-invoice-check-part-1/" target="test_blank"&gt;https://blogs.sap.com/2013/01/24/duplicate-invoice-check-part-1/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also refer to this note &lt;/P&gt;&lt;P&gt;2036775 - Duplicate Invoice Check in Logistics Invoice
Verification&lt;/P&gt;&lt;P&gt;it talks about using the FM you are using&lt;/P&gt;&lt;P&gt;Both of them are called in functions
MRM_DUPLICATE_INVOICE_CHECK and MRM_FI_DOCUMENT_CHECK respectively and can be
set as errors or information messages in transaction OMRM.&lt;/P&gt;&lt;P&gt;It also mentions a BADI &lt;/P&gt;&lt;P&gt;"NOTE: Method HEADERDATA_CHECK from the BAdI MRM_HEADER_CHECK
could be used to check additional fields."&lt;/P&gt;&lt;P&gt;Last line says " the check will only work for the
documents created after the customizing has been done as per this KBA. If a
document has been created before the settings, the duplicate check will not be
raised for a new one even though the customizing is set."&lt;/P&gt;&lt;P&gt;So you probably need to follow the note and then try again &lt;/P&gt;&lt;P&gt;Let me know if that helped. &lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vinita&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 21:24:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mrm-duplicate-invoice-check/m-p/12259875#M1986986</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-10-13T21:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: MRM_DUPLICATE_INVOICE_CHECK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mrm-duplicate-invoice-check/m-p/12259876#M1986987</link>
      <description>&lt;P&gt;Thanks Vinita for the lucid details. Actually, the things that you have mentioned are already done and the settings are working as expected in MIRO: Error message comes up when user enters a duplicate Vendor Invoice.&lt;/P&gt;&lt;P&gt;Now we want to automate Incoming Invoice creation: Vendor will send Invoice data in Excel and we on our end will upload data and create the invoice (via BAPI_INCOMINGINVOICE_CREATE).&lt;/P&gt;&lt;P&gt;BAPI_INCOMINGINVOICE_CREATE is working great but it is not giving 'Duplicate Invoicing' error (even after the SPRO changes), so I have to resort to MRM_DUPLICATE_INVOICE_CHECK (or other FM's) and try to trap the 'Duplicate Invoice' error. That is where I got stuck. The source code that I have pasted in my original post, uses hard coded data for checking purposes but I will have multiple Vendor References for which I need to trap the 'Duplicate invoice' error and present it to the user.&lt;/P&gt;&lt;P&gt;I can of course check table RBKP to check if Invoice is already created for the Vendor Reference in Excel, but would prefer if the 'DUPLICATE INVOICE CHECK' FM's can be used.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 22:16:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mrm-duplicate-invoice-check/m-p/12259876#M1986987</guid>
      <dc:creator>amitpurohit</dc:creator>
      <dc:date>2020-10-13T22:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: MRM_DUPLICATE_INVOICE_CHECK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mrm-duplicate-invoice-check/m-p/12259877#M1986988</link>
      <description>&lt;P&gt;Don't raise the error with the MESSAGE statement, but add it to some &lt;A href="https://help.sap.com/viewer/search?q=Application%20Log%20%E2%80%93%20Guidelines%20for%20Developers%20%28BC-SRV-BAL%29"&gt;application log&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;In the meantime, correct your code, e.g.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF sy-subrc &amp;lt;&amp;gt; 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
          INTO l_text
  WRITE : / l_text.
   " Skip and go to Next record
 ELSE. 
   " Call BAPI
 ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Also read OSS note &lt;A href="https://launchpad.support.sap.com/#/notes/2511288"&gt;2511288 - Logistics invoice verification APIs: Check for duplicate invoices&lt;/A&gt; ('Up to now, no check has been carried out for duplicate invoices for the interfaces specified....')&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 10:07:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mrm-duplicate-invoice-check/m-p/12259877#M1986988</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2020-10-15T10:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: MRM_DUPLICATE_INVOICE_CHECK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mrm-duplicate-invoice-check/m-p/12259878#M1986989</link>
      <description>&lt;P&gt;Thanks Raymond, but we are still on ECC and the note 2511288 won't help us.&lt;/P&gt;&lt;P&gt;And regarding the MESSAGE statement, the program execution does not even reach the 'IF Sy-SybRc &amp;lt;&amp;gt; 0' statement. The Error message screen shown in my original post, comes up before that. I understand that probably is because of the configuration but I want to trap the Error and then move to the next record.&lt;/P&gt;&lt;P&gt;-Amit.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 21:25:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mrm-duplicate-invoice-check/m-p/12259878#M1986989</guid>
      <dc:creator>amitpurohit</dc:creator>
      <dc:date>2020-10-19T21:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: MRM_DUPLICATE_INVOICE_CHECK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mrm-duplicate-invoice-check/m-p/12259879#M1986990</link>
      <description>&lt;P&gt;Also change your EXCEPTIONS clause in the call&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;...

    EXCEPTIONS
      invoice_already_exists = 1
      others                 = 2
      error_message          = 3.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Oct 2020 07:23:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mrm-duplicate-invoice-check/m-p/12259879#M1986990</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2020-10-20T07:23:24Z</dc:date>
    </item>
  </channel>
</rss>

