09-24-2012 8:06 AM
Hi Sap User,
I want restrict same material no. in 2 line at po creation time.
Guide me ........
Moderator message: please do more research before posting.
Message was edited by: Thomas Zloch
09-24-2012 8:15 AM
I think you will need to define new order process strategy in SPRO.
Copy the existing one program and need to write own routine to validate the material numbers.
This is just a clue by looking at question, will try and post detail one.
Thanks and regards,
Ravindra Sonar.
09-24-2012 8:39 AM
Hi,
Try the following code in badi ME_PROCESS_PO_CUST.
METHOD IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM.
INCLUDE MM_MESSAGES_MAC.
DATA: LW_POSTED_ITEM TYPE MEPOITEM.
Get currently being modified data for the PO line item
CALL METHOD IM_ITEM->GET_DATA
RECEIVING
RE_DATA = LW_ITEM.
Get posted data for the PO line item
CALL METHOD IM_ITEM->GET_PERSISTENT_DATA
IMPORTING
EX_DATA = LW_POSTED_ITEM
EXCEPTIONS
NO_DATA = 1.
IF SY-SUBRC = 1.
CLEAR LW_POSTED_ITEM.
ENDIF.
MMPUR_MESSAGE_FORCED 'E' 'ZTEST' '000' TEXT-002 '' '' ''.
ENDIF.
Endmethod.