on 05-31-2016 2:41 PM
Hello Experts,
We have make to order scenario with variant configuration.
Requirement: When we create sales order the product costing is running in the background and if it ends up in error, user must not be allowed to save the sales order.
At present, users are able to save the sales order even with error, although it blocks creating delivery, user is able to by-pass the error by doing Extras->post-processing in sales order.
Hence now we want to restrict the users from saving sales order with costing error.
P.S: We tried using user exit MV45AFZZ with the logic of using table KEKO by checking the Costing status but not fruitful as it requires sales order number as an input to retrieve this data.
Appreciate if anyone can show some light in this requirement.
Thanks in advance,
Jagan.
Hello Everyone,
Thanks for your help. I have managed to resolve it by disabling the option of Post-processing through ABAP. Hence it stops subsequent processing of delivery creation until the costing error is corrected in sales order for the respective items.
Reg,
Jagan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure if it makes sense to make it a "hard error" (if the order entry is complex the users won't be happy to lose all their work because of the costs they likely can't even control). But we had a similar requirement, only for a warning message. I searched high and low for how to identify the costing error and the only thing I found was that it sets certain status. Not sure if this would work in your scenario and if it's the same status (I believe it's standard one), but here is a code sample for USEREXIT_SAVE_DOCUMENT:
LOOP AT xvbap into ls_xvbap WHERE ABGRU = SPACE AND
UPDKZ <> 'D'.
CALL FUNCTION 'STATUS_CHECK'
EXPORTING
objnr = ls_xvbap-objnr
status = 'I0164'
EXCEPTIONS
OBJECT_NOT_FOUND = 1
STATUS_NOT_ACTIVE = 2
OTHERS = 3.
IF sy-subrc = 0.
<warning message here>
ENDIF.
ENDLOOP.
Note: normally the validations are in the ...PREPARE user exit but I was not able to make it work there. Don't remember the details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jagan,
A few scenarios that came to my mind (Sales order saving is not prevented in either scenario)
1- How about assigning status profiles to your items, and assigning business transaction Create delivery as Forbidden in initial status. An authorized user should change the status if product costing is OK.
2- Check in delivery save user exit if any of the sales order item's product costing is missing (I liked this one better).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kivanc,
Considering your 2nd point, already we have the std.SAP system control during delivery as I mentioned earlier. But users are able to overcome this error using Post-processing option.
Now I am trying to disable this option of Post processing in sales order costing screen.
Is there a way to disable it thru' std. SAP configuration OR should I use the basis authorization/ ABAP?
Appreciate your suggestions.
Thanks,
Jagan.
I got you now. Can you check if this authorization object works for you which is called after pressing this button?
Maybe ACTVT can be differentiated while creating the first estimate and then after for post-processing, but it doesn't look likely.
Or maybe an authorization functionality or even a parameter setting to disable Post-processing button (that one I don't know)
User | Count |
---|---|
98 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.