Hi Gurus,
I have requirement to create Custom Batch creation while process order release or save in COR2.
I have tried with these FMs VB_CREATE_BATCH and BAPI_BATCH_CREATE in few user exits.
in Debugging screen batch is creating and after the session the Batch is not created when checked thru MSC3N Tcode.
In some cases it is going to dump saying there is Unexpected COMMIT WORK.
Please help on this.
Request clarification before answering.
No need commit for fm VB_CREATE_BATCH.
Please change your input parameters as follows:
X_BNCOM-KZBEW = 'B'
KZCLA = '1'
XKCFC = ' '
After call fm VB_CREATE_BATCH, please make sure that sy-subrc = 0.
If still not work then please share your input parameter for YMCHA and X_BNCOM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try fm VB_CREATE_BATCH in tcode SE37 first.
In tcode SE37, you need run fm BAPI_TRANSACTION_COMMIT after you run fm VB_CREATE_BATCH.
Please check whether you can found new batch number in tcode MSC3N.
If batch number is still not found in tcode MSC3N then please share your input parameter for YMCHA and X_BNCOM.
Hello,
You can use function module BAPI_BATCH_SAVE_REPLICA to create batches together with classification.
Please refer SAP FAQ note 619913 - FAQ: Basic batch management functions
Question: What do I need to consider when maintaining batch data or using BAPIs for classification?
Answer: You can use the BAPIs BAPI_BATCH_CREATE, BAPI_BATCH_CHANGE, and BAPI_BATCH_SAVE_REPLICA to maintain batch data.
These three BAPIs implicitly perform a separate COMMIT WORK.If a COMMIT WORK AND WAIT is required, or if batch maintenance is to be included in a transaction, the implicit COMMIT performed by the BAPIs must be suppressed.
This is done by calling the function module TRANSACTION_BEGIN before calling the individual BAPI. The calling program thus takes over the transaction control. This is ended by calling the function module TRANSACTION_END or BAPI_TRANSACTION_COMMIT.
BAPI_BATCH_CREATE - This BAPI is used exclusively for creating new batches or for expanding existing batches by plant segments or storage location segments.
BAPI_BATCH_CHANGE - This BAPI is to be used exclusively for changing existing batches.
BAPI_BATCH_SAVE_REPLICA - This BAPI creates batches or changes existing batches. It combines the functions of the above-mentioned BAPIs.
Best Regards,
R.Brahmankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 17 | |
| 12 | |
| 8 | |
| 8 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.