Abstract–
- In a custom development there was a requirement to restrict on PO creation to compare with certain parameters.
- This document should be restricted to Po at header level and item level by using BADI.
- Using BADI we can achieve certain requirement from client.
BACKGROUND/ BUSINESS PROCESS
- For example requirement is as document type and plant parameters need control on field PR mandatory.
- During a custom development it was required to PR number mandatory for document type by using BADI.
- If any users manually try to create PO without PR number for these document type system shows error message
CHALLENGES
- Within configuration settings it is possible to restrict by using field selection control. But if you want add any parameter to control the requirement is it possible by using BADI.
- Through BADI we can also do this requirement.
SOLUTION
- Developed BADI ME_PROCESS_PO_CUST, and created new BADI Z by copying this BADI.
- We using interface IF_EX_ME_PROCESS_PO_CUST
- In interface tab, in standard there is lot of classes
INITIALIZE Initializations (Invoked Once Only)
OPEN Open a Purchase Order
PROCESS_HEADER Processing of Header Data
PROCESS_ITEM Processing of Item Data
PROCESS_SCHEDULE Processing of Delivery Schedule Line Data
PROCESS_ACCOUNT Processing of Account Assignment Data
CHECK Closing Check
POST Post
Here we have option, where you want control on PO. If suppose you want control on item level you can with Process_ Item.
By using this BADI you can control on ME21N and ME22N
Conclusion: This BADI not only for this requirement you can do any new requirement related to Po field control by using different Parameters.
See below examples:
- Suppose client requirement is For document type NB, Purchasing accepted only 1001
- If suppose for document type ZNB, tax code should be VN.
- Validation with PR line item with PO schedule line items
- And also you can users with different parameters. Etc....
Key points:
Mepoitem for item details updating in me21n
Mepoheader for header details updating in me21n
Meposchedule for schedule delivery details updating me21n
In standard there are lot of BADI’s helpful to achieve the client requirement.For Example:
ME_PROCESS_`PO
ME_PROCESS_PO _CUST
ME_PROCESS_REQ
ME_PROCESS_REQ_CUST
ME_PURCHDOC_POSTED
How to find BADI for transaction code For example ME21N
- Go to Menu bar system-à status-à Program,
Double click on; it will go inside the program
- Again go to Menu bar GOTOà attributes -à Development class/Package .
- Go to SE80 -à give your package
It will display available components in it along with enhancement
Check in enhancement , here you can find related BADI’s.