Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Display Error message for items in ME21N

Former Member
0 Kudos

Hi everybody,

i made some controls for items order using the User-Exit EXIT_SAPMM06E_006.

If the control don't pass, i display an error message using MESSAGE instruction.

The probleme is when i'm doing it, the Error message is display in the task bar, as a general message and not just for the item controlled (statut field).

So how can i do to display my message with the message list for the item ?

Thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try to use the macro mmpur_message for displaying the errors in the list..

Also check for all the macros in the include MM_MESSAGES_MAC..

Thanks,

Naren

7 REPLIES 7

Former Member
0 Kudos

Hi,

Try to use the macro mmpur_message for displaying the errors in the list..

Also check for all the macros in the include MM_MESSAGES_MAC..

Thanks,

Naren

venkata_ramisetti
Active Contributor
0 Kudos

Hi,

You have to use function module ME_LOG_SAVE for including your messages in the application log.

Please check the below similar code. You may have to use OOPs concepts to add messages to the application log.

FORM mepo_save_aplg_messages.

DATA: l_log_handles TYPE bal_t_logh.

FIELD-SYMBOLS: <l_hdl> LIKE LINE OF l_log_handles.

CHECK fc_vorga EQ cva_en.

CHECK NOT gf_id IS INITIAL.

CHECK ekko-memory NE space OR

*ekko-memory NE space.

IF NOT gf_log_handle_read[] IS INITIAL.

INSERT LINES OF gf_log_handle_read[] INTO TABLE l_log_handles.

  • prepare old logs for deletion

LOOP AT gf_log_handle_read ASSIGNING <l_hdl>.

CALL FUNCTION 'ME_LOG_DELETE'

EXPORTING

im_log_handle = <l_hdl>

EXCEPTIONS

error_message = 1

OTHERS = 2.

ENDLOOP.

ENDIF.

IF NOT gf_log_handle_save IS INITIAL.

INSERT gf_log_handle_save INTO TABLE l_log_handles.

ENDIF.

CHECK NOT l_log_handles[] IS INITIAL.

  • save deleted and new logs

CALL FUNCTION 'ME_LOG_SAVE'

EXPORTING

im_log_handles = l_log_handles

im_update_task = 'X'

EXCEPTIONS

OTHERS = 1.

ENDFORM.

Thanks,

ramakrishna

0 Kudos

Thanks for your answers

it seems to work with mmpur_message macro.

The message is not added on the item messages list but on header message list. The result is the same, i can't save my order so it's why i want

I tried to use ME_LOG_SAVE function, but it appears to be very difficult to use.

So i think my problem is resolved. thanks

0 Kudos

Hi Oliver,

How did you solve your problem. I am also looking for the same type of issue.

It would be grate full to me, if you provide the answer.

Thanks.

0 Kudos

I just used macro

mmpur_message

, as indicated above.

For exemple, to display an error message :

mmpur_message 'E' '00' '398' 'Error :' 'Table unknown' '' ''

Syntax is :

mmpur_message 'Type' 'ID' 'N°Message' 'var1' 'var2' 'var3' 'var4'

0 Kudos

Hi Oliver I did the same thing....

But still I can able to hold the PO, I don't want to post or hold the PO.

Thanks,

Former Member
0 Kudos

Hi,

Please award the points if it is answered.

Thanks,

Naren