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: 

Validation on ITEM level in ME21n or ME22n

Former Member
0 Kudos

Hi,

I have a requirement on ME21n or ME22n, I need to do validation on material type and it is not successful, I need to trough error message. I made that development according to requirement in EXIT ME_PROCESS_PO_CUST (PROCESS_ITEM).


But issue is after showing error message user fill the required field but error message is not deleting from message box.

Please let me a suggest where we need to check the validation.

1 ACCEPTED SOLUTION

former_member194965
Active Participant
0 Kudos

Hi Suprit,

Use this exit MM06E005 -> EXIT_SAPMM06E_017 it will work.

Regards,

E.Ananthachari

5 REPLIES 5

raymond_giuseppi
Active Contributor
0 Kudos

Did you forget to reset your error/validate status of item in your BAdI implementation (not an exit...) like in following sample?


* Remove previous message

mmpur_context mmcnt_context_badi.

IF NOT ls_item-id IS INITIAL.

  mmpur_remove_msg_by_context ls_item-id mmcnt_context_badi.

ENDIF.

* here some check set an error and invalidate item

IF ls_material_plant-mmsta EQ '30'.

  im_item->invalidate( ).

  mmpur_metafield mmmfd_matnr.

  mmpur_message_forced 'E' 'ZXXX' '999' <itemdata>-matnr <itemdata>-werks space space.

ENDIF.

Regards,

Raymond

0 Kudos

Hi Raymond,

Thank you for replying.

I'm explaining you my full requirement, When user create PO using ME21n with Document type NB and material type ROH that time system check RFQ number; When RFQ number is not available then system trough an error.

So according that I'm using badi ME_PROCESS_PO_CUST and method PROCESS_ITEM

Also check my below code and suggest me where we need to correct this.

0 Kudos

Just

  • Keep the "Remove previous message" part of my sample at start of method
  • Replace the MESSAGE statement adapting my sample

Also you should replace the sy-tcode check by using the transaction type, you received it in method OPEN and should save it an instance attribute of the implementing class.

Regards,

Raymond

former_member194965
Active Participant
0 Kudos

Hi Suprit,

Use this exit MM06E005 -> EXIT_SAPMM06E_017 it will work.

Regards,

E.Ananthachari

satyapriyanka_vana
Active Participant
0 Kudos

Hi Suprit,

If I am not wrong, the method PROCESS_ITEM is triggered in case of  user commands 'check' or 'save'.Hence,even after correcting the line item, the messages are not cleared.

Regards,

Priyanka.