<?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 Tcode MIRO with BADI: MRM_HEADER_CHECK in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-miro-with-badi-mrm-header-check/m-p/6057801#M1353520</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;in MIRO i will use badi: MRM_HEADER_CHECK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i implementedt it and use in method: IF_EX_MRM_HEADER_CHECK~HEADERDATA_CHECK&lt;/P&gt;&lt;P&gt;this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  DATA: GT_ERRPROT    TYPE TABLE OF MRM_ERRPROT,
        GS_ERRPROT    TYPE          MRM_ERRPROT.
*
  APPEND GS_ERRPROT TO GT_ERRPROT.
*
  IF NOT I_RBKPV-LIFNR IS INITIAL
     AND I_RBKPV-LANDL &amp;lt;&amp;gt; 'DE'
     AND I_RBKPV-LZBKZ IS INITIAL.
*
    CLEAR GS_ERRPROT.
    GS_ERRPROT-MSGTY = 'E'.
    GS_ERRPROT-MSGID = 'ZZ'.
    GS_ERRPROT-MSGNO = '010'.
    GS_ERRPROT-MSGV1 =
     'ERROR in LZB'.
*
    CALL FUNCTION 'MRM_PROT_FILL'
      TABLES
        T_ERRPROT = GT_ERRPROT.
*
  ENDIF.
*
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In MIRO i get the message wich i need, but the user is able to save (post) in MIRO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i avoid saving when i generate the above message?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Sep 2009 10:12:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-14T10:12:56Z</dc:date>
    <item>
      <title>Tcode MIRO with BADI: MRM_HEADER_CHECK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-miro-with-badi-mrm-header-check/m-p/6057801#M1353520</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;in MIRO i will use badi: MRM_HEADER_CHECK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i implementedt it and use in method: IF_EX_MRM_HEADER_CHECK~HEADERDATA_CHECK&lt;/P&gt;&lt;P&gt;this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  DATA: GT_ERRPROT    TYPE TABLE OF MRM_ERRPROT,
        GS_ERRPROT    TYPE          MRM_ERRPROT.
*
  APPEND GS_ERRPROT TO GT_ERRPROT.
*
  IF NOT I_RBKPV-LIFNR IS INITIAL
     AND I_RBKPV-LANDL &amp;lt;&amp;gt; 'DE'
     AND I_RBKPV-LZBKZ IS INITIAL.
*
    CLEAR GS_ERRPROT.
    GS_ERRPROT-MSGTY = 'E'.
    GS_ERRPROT-MSGID = 'ZZ'.
    GS_ERRPROT-MSGNO = '010'.
    GS_ERRPROT-MSGV1 =
     'ERROR in LZB'.
*
    CALL FUNCTION 'MRM_PROT_FILL'
      TABLES
        T_ERRPROT = GT_ERRPROT.
*
  ENDIF.
*
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In MIRO i get the message wich i need, but the user is able to save (post) in MIRO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i avoid saving when i generate the above message?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 10:12:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-miro-with-badi-mrm-header-check/m-p/6057801#M1353520</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T10:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Tcode MIRO with BADI: MRM_HEADER_CHECK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-miro-with-badi-mrm-header-check/m-p/6057802#M1353521</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;check this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*----------------------------------------------------------------------*
* If there is any error do not allow saving, posting, ....
*----------------------------------------------------------------------*
    DATA: gt_errtab    TYPE TABLE OF mrm_errprot,
          gs_errtab    TYPE mrm_errprot.
    CONSTANTS:     c_errprot(23)   TYPE c VALUE '(SAPLMRMF)TAB_ERRPROT[]'.

    FIELD-SYMBOLS: &amp;lt;fs_errprotj_dt&amp;gt; TYPE table.
    ASSIGN (c_errprot) TO &amp;lt;fs_errprotj_dt&amp;gt;.

    REFRESH gt_errtab[].
    gt_errtab[] = &amp;lt;fs_errprotj_dt&amp;gt;[].

    IF NOT gt_errtab[] IS INITIAL.

      READ TABLE gt_errtab INTO gs_errtab WITH KEY msgty = 'E'.
      IF sy-subrc = 0.

        DATA: c_okqx(17)   TYPE c VALUE '(SAPLMR1M)OK-CODE'.
        FIELD-SYMBOLS: &amp;lt;fs_okqx&amp;gt; TYPE ANY.
        ASSIGN (c_okqx) TO &amp;lt;fs_okqx&amp;gt;.
        CASE &amp;lt;fs_okqx&amp;gt;.
          WHEN 'COMP' OR 'BU'. "Saving as complete/Post
            READ TABLE gt_errtab INTO gs_errtab WITH KEY msgty = 'E'
            msgid = 'ZZ' msgno = '010'.
            IF sy-subrc = 0.
* delete the ok-code.
              CLEAR &amp;lt;fs_okqx&amp;gt;.
              MESSAGE s0XX(zxx). "Invoice still has error messages
            ENDIF.
        ENDCASE.

      ENDIF.

    ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something more: in your code you should clear the message if the condition is not met (that is, the user has done something in the transaction to correct the condition producing the message).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: GT_ERRPROT    TYPE TABLE OF MRM_ERRPROT,
        GS_ERRPROT    TYPE          MRM_ERRPROT.
*
  APPEND GS_ERRPROT TO GT_ERRPROT.
*
  IF NOT I_RBKPV-LIFNR IS INITIAL
     AND I_RBKPV-LANDL  'DE'
     AND I_RBKPV-LZBKZ IS INITIAL.
*
    CLEAR GS_ERRPROT.
    GS_ERRPROT-MSGTY = 'E'.
    GS_ERRPROT-MSGID = 'ZZ'.
    GS_ERRPROT-MSGNO = '010'.
    GS_ERRPROT-MSGV1 =
     'ERROR in LZB'.
*
    CALL FUNCTION 'MRM_PROT_FILL'
      TABLES
        T_ERRPROT = GT_ERRPROT.
 
 ELSE.

* This is the code added

    FIELD-SYMBOLS: &amp;lt;fs_errprot&amp;gt; TYPE table.
    ASSIGN (c_errprot) TO &amp;lt;fs_errprot&amp;gt;.

    REFRESH gt_errtab[].
    gt_errtab[] = &amp;lt;fs_errprot&amp;gt;[].

    LOOP AT gt_errtab INTO gs_errtab
    WHERE msgty = 'E'
    AND msgid = 'ZXX'
    AND msgno = '010'.
      DELETE gt_errtab INDEX sy-tabix.
    ENDLOOP.

    &amp;lt;fs_errprot&amp;gt;[] = gt_errtab[].

*
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Pablo Casamayor on Sep 14, 2009 12:55 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 10:40:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-miro-with-badi-mrm-header-check/m-p/6057802#M1353521</guid>
      <dc:creator>former_member182371</dc:creator>
      <dc:date>2009-09-14T10:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Tcode MIRO with BADI: MRM_HEADER_CHECK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-miro-with-badi-mrm-header-check/m-p/6057803#M1353522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pablo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your answer. I do it in this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA: GT_ERRPROT    TYPE TABLE OF MRM_ERRPROT,
        GS_ERRPROT    TYPE          MRM_ERRPROT.
*
  DATA: I_OKCODE(17)   TYPE C VALUE '(SAPLMR1M)OK-CODE'.
  FIELD-SYMBOLS: &amp;lt;FS_OKCODE&amp;gt; TYPE ANY.
  ASSIGN (I_OKCODE) TO &amp;lt;FS_OKCODE&amp;gt;.
*
  IF NOT I_RBKPV-LIFNR IS INITIAL
     AND I_RBKPV-LANDL &amp;lt;&amp;gt; 'DE'
     AND I_RBKPV-LZBKZ IS INITIAL.
*
    CLEAR GS_ERRPROT.
    GS_ERRPROT-MSGTY = 'E'.
    GS_ERRPROT-MSGID = 'ZZ'.
    GS_ERRPROT-MSGNO = '010'.
    GS_ERRPROT-MSGV1 =
     'Ausl. Lieferanten erfordern ein LZB-Kennzeichen'.
*
    APPEND GS_ERRPROT TO GT_ERRPROT.
*
    CALL FUNCTION 'MRM_PROT_FILL'
      TABLES
        T_ERRPROT = GT_ERRPROT.
*
    CASE &amp;lt;FS_OKCODE&amp;gt;.
      WHEN 'BU' OR 'PB' OR 'COMP'. "Buchen oder Simulieren
        CLEAR &amp;lt;FS_OKCODE&amp;gt;.
        MESSAGE S010(ZZ) WITH 'Es sind noch Fehler in der Buchung'.
    ENDCASE.
*
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you think, that i can also use BADI: INVOICE_UPDATE, it's a newer BADI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 12:38:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-miro-with-badi-mrm-header-check/m-p/6057803#M1353522</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T12:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Tcode MIRO with BADI: MRM_HEADER_CHECK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-miro-with-badi-mrm-header-check/m-p/6057804#M1353523</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;yes you can use  badi INVOICE_UPDATE as well.&lt;/P&gt;&lt;P&gt;Just bear in mind that INVOICE_UPDATE will be triggered before MRM_HEADER_CHECK.&lt;/P&gt;&lt;P&gt;I´ve used INVOICE_UPDATE to send a message and MRM_HEADER_CHECK to receive it and act accordingly (usually if the message was found i cleared the ok-code and stopped the flow of the program until the error was fixed).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a few words:&lt;/P&gt;&lt;P&gt;INVOICE_UPDATE  -&amp;gt; just send the message here&lt;/P&gt;&lt;P&gt;MRM_HEADER_CHECK -&amp;gt; look for the message and if it is found do something (e.g. clear ok-code)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Pablo Casamayor on Sep 14, 2009 2:46 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 12:45:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-miro-with-badi-mrm-header-check/m-p/6057804#M1353523</guid>
      <dc:creator>former_member182371</dc:creator>
      <dc:date>2009-09-14T12:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Tcode MIRO with BADI: MRM_HEADER_CHECK</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-miro-with-badi-mrm-header-check/m-p/6057805#M1353524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;helped a lot,thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2009 08:22:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tcode-miro-with-badi-mrm-header-check/m-p/6057805#M1353524</guid>
      <dc:creator>sachin_soni</dc:creator>
      <dc:date>2009-11-23T08:22:19Z</dc:date>
    </item>
  </channel>
</rss>

