cancel
Showing results for 
Search instead for 
Did you mean: 

Why message displayed shows no text, only the variable 1? (BAdI BD_MMPUR_FINAL_CHECK_PO)

Sandra_Rossi
Active Contributor
0 Kudos
123

I implemented the BAdI BD_MMPUR_FINAL_CHECK_PO to do custom checks in ME22N and F0842A (purchase order).

I fill the return parameter MESSAGES with message 001 in message class ZPO ("there is an error concerning item &1") with variable 1 "00020" but the displayed error message is "00020" alone.

I expect "there is an error concerning item 00020"

Note that the message exists in English language, and ABAP code running in English.

MESSAGE e001(zpo) WITH '00020' INTO DATA(lv_message).
messages = VALUE #( ( messageid        = sy-msgid
                      messagetype      = sy-msgty
                      messagenumber    = sy-msgno
                      messagevariable1 = sy-msgv1
                      messagevariable2 = sy-msgv2
                      messagevariable3 = sy-msgv3
                      messagevariable4 = sy-msgv4 ) ).

What's the problem with the code?

Thanks.

Sandra

System: S/4HANA 2023 FPS 01 / On premises.

 

View Entire Topic
Sandra_Rossi
Active Contributor

It's a weird behavior but "normal" as documented in the BAdI definition.

Sandra_Rossi_0-1745322697449.png

This can also be seen in the code of the BAdI invocation and message MEPO 250:

Sandra_Rossi_0-1745317965407.png

Sandra_Rossi_1-1745322760528.png

Code:

" IMG documentation of BAdI BD_MMPUR_FINAL_CHECK_PO:
"   Parameter MESSAGES
"   This BAdI currently does not support the full scope of message handling.
"   Therefore, you can only use the attributes MESSAGETYPE and MESSAGEVARIABLE1 of the parameter.
"   The messages contain the following information:
"   - MESSAGETYPE
"     This key field contains one of the following values:◦A: Abort
"     - E: Error
"     - W: Warning
"     - I: Information
"   - MESSAGEVARIABLE1
"     This parameter contains the message text.
"     Maximum 50 characters.
MESSAGE e001(zpo) WITH '00020' INTO ls_message-messagevariable1.
ls_message-messagetype = 'E'.
APPEND ls_message TO messages.