Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

After Giving Error Message how to make Field Ready For Input Again in MIRO

Hey Friends,

Iam using BADI MRM_HEADER_CHECK.

I need to Provide an error message if Posting Date of Vendor Incoice Verification (MIRO) is Greater then Goods Reciept Date(GRN).

This is wht i have Coded in The Implementation.

METHOD if_ex_mrm_header_check~headerdata_check.

TYPES: BEGIN OF sty_grn,

ebeln TYPE ekbe-ebeln,

ebelp TYPE ekbe-ebelp,

vgabe TYPE ekbe-vgabe,

belnr TYPE ekbe-belnr,

budat TYPE ekbe-budat,

END OF sty_grn.

DATA: wa_grn TYPE sty_grn,

i_grn TYPE STANDARD TABLE OF sty_grn,

wa_drseg LIKE LINE OF ti_drseg,

v_budat_grn TYPE ekbe-budat.

  • BREAK-POINT.

IF NOT ti_drseg IS INITIAL.

SELECT ebeln ebelp vgabe belnr budat

FROM ekbe

INTO TABLE i_grn

FOR ALL ENTRIES IN ti_drseg

WHERE belnr = ti_drseg-mblnr AND

gjahr = ti_drseg-mjahr AND

vgabe = '1'.

LOOP AT ti_drseg INTO wa_drseg.

READ TABLE i_grn INTO wa_grn WITH KEY belnr = wa_drseg-mblnr.

IF sy-subrc EQ 0.

IF wa_grn-budat GT i_rbkpv-budat.

MESSAGE W001(zatg) WITH 'Posting date less than Grn Posting date'.

ENDIF.

ENDIF.

Now the Problem is that it always Gives Error message with 'Posting date less than Grn Posting date'.

Its Not letting me to Change the Posting Date in Miro.

i have to cancel the Miro and Create a new Doc.

How Do i Make the Posting Date Field 'INVFO-BUDAT' Ready For Input Again.

Please Guide.

Regards,

Essam

ENDLOOP.

ENDIF.

ENDMETHOD.

Former Member
replied

Hi,

try something like:

    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: <fs_errprot> TYPE table.
    ASSIGN (c_errprot) TO <fs_errprot>.

    REFRESH gt_errtab[].
    gt_errtab[] = <fs_errprot>[].

* First clear the message because the user might have corrected
* the situation that causes the error
    LOOP AT gt_errtab INTO gs_errtab
    WHERE msgty = 'E'
    AND msgid = 'ZATG'
    AND msgno = '001'.
      DELETE gt_errtab0 INDEX sy-tabix.
    ENDLOOP.

    <fs_errprot>[] = gt_errtab[].

* if the condition is not met, trigger the message
    IF wa_grn-budat GT i_rbkpv-budat.
      gs_errtab-msgty = 'E'.
      gs_errtab-msgid = 'ZATG'.
      gs_errtab-msgno = '001'.
      gs_errtab-source = 'EC'.
      APPEND gs_errtab TO gt_errtab.

      CALL FUNCTION 'MRM_PROT_FILL'
        TABLES
          t_errprot = gt_errtab.
    ENDIF.

Have a look too at function group MRMF.

Best regards.

Edited by: Pablo Casamayor on May 10, 2010 8:05 AM

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question