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
BEGIN OF tp_bankn,
bankn type lfbk-bankn,
END OF tp_bankn.
* Internal Tables to hold the data
it_bankn TYPE TABLE OF tp_bankn.
* variable to keep the count
lv_count type i.
** Begin of logic implementation
If not I_RBKPV-lifnr is INITIAL.
*select a/c details from lfbk table
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.
** End of logic implementation