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: 

ME21N validation at transaction Level

Former Member
0 Kudos

Hi All,

I want validate at SAP Transaction level (ME21N). When I am going to create PO i need to validate the EKGRP maintained at PO level and maintained at Info record level. if both are different i need to throw an error??

So can you please tell me the procedure to go ahead? if i need to write the code in the exit, please let me know the procedure where to write.

Thnks,

Raghu.

1 REPLY 1

uwe_schieferstein
Active Contributor
0 Kudos

Hello Raghu

Having BAdI ME_PROCESS_PO_CUST available on your system you can use its method CHECK to do final validations which allow you to cancel saving of the PO (in case of failed validations set CH_FAILED = 'X' ).

IMPORTING parameter IM_HEADER (IF_PURCHASE_ORDER_MM) has a method GET_DATA which returns the header data (structure MEPOHEADER). Here you can find EKGRP at header level.

If I am correct then info records are found at item level. Thus, call IM_HEADER->GET_ITEMS to retrieve them.

Items are TYPE REF TO IF_PURCHASE_ORDER_ITEM_MM -> implementing class CL_PURCHASE_ORDER_ITEM_MM).

Loop over the item instances and call method lo_item->GET_DATA in order to retrieve the item data (structure MEPOITEM) which contain field INFNR ( Number of Purchasing Info Record ).

Well, from here on it should be possible to find the way on your own.

Regards

Uwe