Skip to Content
avatar image
Former Member

Add validation for service tab in ME51N

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 ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 06, 2017 at 11:10 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 06, 2017 at 11:16 AM

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

    .

    Add comment
    10|10000 characters needed characters exceeded