2007 Feb 06 2:01 PM
Hi All,
We have a requirement, when PO quantity is reduced or when line item is deleted, it should set the Closed flag ( EBAN-EBAKZ ) to X.
We had set the flag in BADI ME_PROCESS_PO_CUST and also in User Exit EXIT_SAPMM06E_013. Once we execute the transaction ME22N, the flag (EBAN-EBAKZ) is set with the help of our code, but then the SAP Standard program again resets it. The flow of the transaction is in such a way that SAP Standard program is called at last and it will always reset the flag.
Then we tried to find out the user exit which will get triggered after this standard SAP code so that we can again set the flag to X, for this purpose we have tried many of the user exits available in me22n but none of it is getting triggered at required position.
So if anybody can tell, is there is any User Exit or BADI available, which we missed out or some other way of setting the flag , then that will be extremly helpful.
Hi All,
We have a requirement, when PO quantity is reduced or when line item is deleted, it should set the Closed flag ( EBAN-EBAKZ ) to X.
We had set the flag in BADI ME_PROCESS_PO_CUST and also in User Exit EXIT_SAPMM06E_013. Once we execute the transaction ME22N, the flag (EBAN-EBAKZ) is set with the help of our code, but then the SAP Standard program again resets it. The flow of the transaction is in such a way that SAP Standard program is called at last and it will always reset the flag.
Then we tried to find out the user exit which will get triggered after this standard SAP code so that we can again set the flag to X, for this purpose we have tried many of the user exits available in me22n but none of it is getting triggered at required position.
So if anybody can tell, is there is any User Exit or BADI available, which we missed out or some other way of setting the flag , then that will be extremly helpful.
2007 Feb 06 2:28 PM
Hi
Here is the documenattaion of the BADI.
-
Use
Application components: MM-PUR-PO, MM-PUR-PO-GUI
Main program: SAPLMEPO
The Business Add-In (BAdI) ME_PROCESS_PO_CUST enables you to extend the business logic of the Enjoy purchase order on an individual basis.
You can thus influence the dialog transactions ME21N, ME22N, ME23N, and ME29N, and the BAPIs BAPI_PO_CREATE1 and BAPI_PO_CHANGE.
Typical applications for this BAdI include:
Processing of own objects
Processing of additional data on standard objects
Implementation of additional checks and derivations
Change of data in standard fields
Note
Ensure that data integrity is guaranteed.
Change in field selection
With its methods, the BAdI covers the complete transaction cycle for purchase orders. You can thus intervene with your own implementation in each step of the processing:
1. Start of transaction
Documentation for BADI method INITIALIZE
2. Opening of a PO
Documentation for BAdI method OPEN
3. Checking of data
Header data of PO
Documentation for BAdI method PROCESS_HEADER
Item data of PO
Documentation for BAdI method PROCESS_ITEM
Delivery schedule lines of PO
Documentation for BAdI method PROCESS_SCHEDULE
Account assignments in PO
Documentation for BAdI method PROCESS_ACCOUNT
4. Field selection
At header level
Documentation for BAdI method FIELDSELECTION_HEADER_REFKEYS
At item level
Documentation for BAdI method FIELDSELECTION_ITEM_REFKEYS
Special rules at header level
Documentation for BAdI method FIELDSELECTION_HEADER
Special rules at item level
Documentation for BAdI method FIELDSELECTION_ITEM
5. Overall check
Documentation for BAdI method CHECK
6. Post
Documentation for BAdI method POST
7. Concluding work
Documentation for BAdI method CLOSE
Requirements
To implement these BAdIs, you need advanced knowledge of ABAP OO.
Standard settings
In the standard system the Business Add-In is not active.
The BAdI is filter-independent.
The BAdI cannot be used multiple times.
Example
You will fine an example implementation under Goto -> Code Example.
Further notes
Documentation for BAdI interface IF_EX_ME_PROCESS_PO_CUST
----
*
BAdI Interface IF_EX_ME_PROCESS_PO_CUST
In the Business Add-In ME_PROCESS_PO_CUST, the following methods are available enabling you to extend the business logic of the Enjoy purchase order. With its methods, the BAdI covers the entire transaction cycle:
1. Start of transaction (INITIALIZE method)
At the start of the transaction, the INITIALIZE method is processed once. In this method you can initialize your own function groups.
Documentation for BAdI method INITIALIZE
2. Opening of a purchase order (OPEN method)
The system opens a new document to create, change or display a purchase order. With the OPEN method, you can import your own data and prepare it for further processing.
Documentation for BAdI method OPEN
3. Checking of data (PROCESS_HEADER, PROCESS_ITEM, PROCESS_SCHEDULE, PROCESS_ACCOUNT methods)
When data of the purchase order has been changed, it is then checked.
With the following methods, you can carry out your own checks of the business objects of the purchase order and derive dependent data according to your own rules:
Header data of PO PROCESS_HEADER
Documentation for BAdI method PROCESS_HEADER
Item data of PO PROCESS_ITEM
Documentation for BAdI method PROCESS_ITEM
Delivery schedule lines of PO PROCESS_SCHEDULE
Documentation for BAdI method PROCESS_SCHEDULE
Account assignments in PO PROCESS_ACCOUNT
Documentation for BAdI method PROCESS_ACCOUNT
4. Field selection (FIELDSELECTION_HEADER_REFKEYS, FIELDSELECTION_ITEM_REFKEYS, FIELDSELECTION_HEADER, FIELDSELECTION_ITEM methods)
In the following methods, you can change the display properties of fields by supplementing or switching the field selection reference keys:
At header level FIELDSELECTION_HEADER_REFKEYS
Documentation for BAdI method FIELDSELECTION_HEADER_REFKEYS
At item level FIELDSELECTION_ITEM_REFKEYS
Documentation for BAdI method FIELDSELECTION_ITEM_REFKEYS
You can implement special rules using the methods FIELDSELECTION_HEADER (at header level) and FIELDSELECTION_ITEM (at item level).
Documentation for BAdI method FIELDSELECTION_HEADER
Documentation for BAdI method FIELDSELECTION_ITEM
5. Overall check (CHECK method)
When the purchase order is posted or when the Check function is chosen, the system performs an overall check for the PO. Here the system performs activities that are too extensive for a dialog step.
In the CHECK method, you can execute enhancements for an overall check or your own overall check for the purchase order.
Dokumentation for BAdI method CHECK
6. Post (POST method)
With the POST method, you can prepare the PO data for posting and updating the database.
Documentation for BAdI method POST
7. Concluding work
After the posting of a purchase order and before the opening of a new PO, you can reset your own customer programs.
Documentation for BAdI method CLOSE
----
*
Closing Check
Functionality
The CHECK method enables you to check an entire document.
This method is invoked when the document is posted or the user chooses the 'Check' function. Typically, at this point the system either carries out checks or identifies dependent data that is not necessary during the processing in PROCESS_HEADER etc. or would impair performance.
Parameters
The following parameters are available:
IM_HEADER - Document header
The interface reference is of the type IF_PURCHASE_ORDER_MM. You can use all methods defined there.
IM_HOLD - Hold
The user has chosen the 'Hold' function.
CH_FAILED - Operation failed
If, when checking, you have detected an error making it impossible to continue processing the document, you can populate this parameter with 'X'. Processing is not then continued. You must ensure that an appropriate error message is issued to the message handler.
See also: Metafield and Error Handling
An example is available in the example implementation under Goto -> Code Example.
Notes
Under no circumstances make any changes to the database within this method. On no account use Commits.
-
Hope this will help.
Regards
- Atul