Skip to Content
0

Add validation for service tab in ME51N

Mar 05, 2017 at 01:30 PM

106

avatar image

Hello,

I want to add some validation on entries in Service tab in ME51N , and to show error message when the validation fails, and remove that error when it is corrected.

What is the best place to put the validation logic in the BADI function CHECK or PROCESS_ITEM, as I don't want to save until the errors are corrected?

For showing messages I am using mmpur_message ,how can I remove the message when the error is correctdd ?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Raymond Giuseppi
Mar 06, 2017 at 11:10 AM
0

Better use PROCESS_ITEM if information is available. to remove your own error messages in the method, use the context. Sample (at start of method implementation)

  ls_item = im_item->get_data( ). " get item data
  mmpur_context mmcnt_context_badi. " set context to 'BAdI'
  if not ls_item-id is initial. " if relevant
    mmpur_remove_msg_by_context ls_item-id mmcnt_context_badi. " remove your previous message
  endif.

Regards,
Raymond

Share
10 |10000 characters needed characters left characters exceeded
Raymond Giuseppi
Mar 06, 2017 at 11:16 AM
1

To access service data assign im_item to a ref to if_services_mm and use method get_srv_data.

.

Share
10 |10000 characters needed characters left characters exceeded