on ‎2023 Sep 15 9:09 AM
Hello Expertise,
In our project we need error/warning message at the time of Sales order/outbound delivery on Material deficit or no stock available.
Sales order for Quantity 10 but confirmed only 4 quantity since stock is only available for 4 quantity.
Please provide possible solution and step to be configure.
This is completely S4hana Public cloud edition.
Thanks and Regards
Prabhat Kumar
Request clarification before answering.
Hi Prabhat,
I think you can fulfill your requirement with Key User Extensibility.
If you like to do that check before the sales document is saved, you can do it in the following Cloud BAdI:
Check of Sales Documents Before Saving (SD_SLS_CHECK_BEFORE_SAVE)
You can simply check the confirmed quantities of the schedule lines to validate if all items are completely confirmed. The implementation could look like this:
if salesdocument-salesdocumenttype = 'TA'.
loop at salesdocumentitems into data(ls_item).
data(lv_requestedquantity) = ls_item-requestedquantity.
data(lv_confirmedquantity) = 0.
loop at salesdocumentschedulelines into data(ls_scheduleline).
if ls_scheduleline-salesdocumentitem = ls_item-salesdocumentitem and ls_scheduleline-confirmeddeliverydate is not initial.
lv_confirmedquantity = lv_confirmedquantity + ls_scheduleline-ConfdOrderQtyByMatlAvailCheck.
endif.
endloop.
if lv_requestedquantity <> lv_confirmedquantity.
append value #( messagetype = 'E' messagetext = |Item { ls_item-salesdocumentitem } could not be completely confirmed. Requested Quantity: { lv_requestedquantity } Confirmed Quantity: { lv_confirmedquantity } | ) to messages.
endif.
endloop.
endif.If you want to get a warning already during the sales order processing, you can do some similar implementation in Cloud BAdI 'Check of Header Data in Sales Documents' (SD_SLS_CHECK_HEAD) or 'Check of Item Data in Sales Documents' (SD_SLS_CHECK_ITEM).
You can find further documentation about Cloud BAdIs in Sales here.
For Delivery you could probably use Cloud BAdI 'Last Checks Before Saving the Delivery' (LE_SHP_DELIVERY_FINAL_CHECK) for such kind of checks.
best regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please raise a WCR for the same using the customer influence portal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 37 | |
| 21 | |
| 16 | |
| 6 | |
| 3 | |
| 3 | |
| 2 | |
| 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.