Skip to Content
0
Former Member
Dec 11, 2013 at 12:34 PM

Error message issued using BADI MRM_HEADER_CHECK appears more than once

477 Views


hi,

I have used the BADI MRM_HEADER_CHECK to display an error/warning message in MIRO t-code.

I am able to issue it but the message appears more more than once (every time it returns to the posting screen). What can be done to avoid it ?

Below is the code -

* Types for internal table
TYPES:
BEGIN OF tp_bankn,
bankn type lfbk-bankn,
END OF tp_bankn.

* Internal Tables to hold the data
DATA:
it_bankn TYPE TABLE OF tp_bankn.

* variable to keep the count
DATA:
lv_count type i.
refresh it_bankn.
clear:
it_bankn,
lv_count.

** Begin of logic implementation
If not I_RBKPV-lifnr is INITIAL.

*select a/c details from lfbk table
SELECT BANKN
FROM lfbk
INTO TABLE it_bankn
WHERE lifnr EQ I_RBKPV-lifnr.
*getting count of bank a/c
DESCRIBE TABLE it_bankn LINES lv_count.

* When the user has more than one bank a/c
* Pop up will appear with message "More than one bank account exist for the vendor"

If lv_count GT 1.
MESSAGE I031(ZF).
ENDIF.
ENDIF.
** End of logic implementation