on ‎2019 Nov 22 6:26 PM
Hi All ,
USEREXIT_SAVE_DOCUMENT_PREPARE is not showing sales orders ATP allocations when called from BAPI_SALESORDER_CREATEFROMDAT2
As per sap , SAVE_DOCUMENT_PREPARE "This userexit can be used for changes or checks, before a sales document is Saved"
Which means this Exit should have all the lines item details in XVBAP table before order is saved. This works fine when we are using VA01 TCODE.
But for some reason when we are calling BAPI "BAPI_SALESORDER_CREATEFROMDAT2" to create the order, user exit SAVE_DOCUMENT_PREPARE do not have APO confirmation sublines.
Did anybody ever faced such issues ?
Thanks,
Request clarification before answering.
I think that SAP note 2146153 - Sales order enhancements stopped working after upgrade or note 1849230 implementation is relevant for your case. According to it "In case of background processing (edi, bapi call, background job), the atp check is now called only once after the userexit_save_document_prepare."
I suggest that you read the note for possible workarounds (there is even a code snippet).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Save user exits are only called when saving the data on the database They are called at the end of program MV45AF0B_BELEG_SICHERN.
For product allocation (PAL) check is skipped when creating the sales order through BAPI_SALESORDER_CREATEFROMDAT2 please refer SAP note 2781796 - PAL not checked with BAPI when field REGION is used in CVC
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.
Not sure in which version you are working. Have a look at OSS notes 191184 and 324171
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Thanga !
ATP is getting called during the BAPI.
but the problem is ATP is getting called after user exit SAVE_DOCUMENT_PREPARE is triggered. so the logic in SAVE_DOCUMENT_PREPARE is not having ATP line items and confirmation. this is creating problems for all the logic in user exit.
while I am debugging in VA01 , ATP is getting called before exit SAVE_DOCUMENT_PREPARE and the same logic in SAVE_DOCUMENT_PREPARE is getting all the ATP line items and hence works fine.
Please help me if you have any idea on any configuration from ATP that is making this issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Snehal Khasale Did you try with 'USEREXIT_SAVE_DOCUMENT_PREPARE'
Are you passing schedule line data ( ORDER_SCHEDULES_IN & ORDER_SCHEDULES_INX ) to FM 'BAPI_SALESORDER_CREATEFROMDAT2'.
Refer to below notes.
If the above does not help, then set a breakpoint at FM AVAILABILITY_CHECK_CONTROLLER to ensure that ATP is actually being called during your Bapi process. This is the function responsible for the ATP check.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you post a query and give further updates, please add the content under "Comments" and not under "Answer" as you were not answering to a query but only providing additional informations as asked by the members. Also, when you add the text under Comments, it will be intimated to the person to whom you are responding whereas, if you add the text under Answer, the member will not be intimated. By the way, your above answer has been converted as comment by me.
| User | Count |
|---|---|
| 17 | |
| 16 | |
| 5 | |
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.