01-01-2015 2:35 PM
Dear All,
Can we release WBS element on Save of Sales order??
Requirement:- Need to release WBS at the time of Saving the sales order. I am not able to find out exit where we can right a code for the release of WBS.
I tried MV45AFZZ - USEREXIT_SAVE_DOCUMENT_PREPARE but during this time XVBAP-PS_PSP_PNR is initial.
Please guide.
Thanks,
Gaurav
01-01-2015 4:54 PM
Well, you were at the right place. In case you are unable to find the value in the field you mentioned, put a watch point and see if it is ever populated in that field in first place.
In case it isn't, you will have to look for other fields.
01-04-2015 2:27 PM
Yes, I found the WBS but now it is not updating the WBS status. I am calling Z FM in Update task as I need to call this FM after sales order save event.
Inside Z FM I am calling below functional modules for updating the WBS status.
BAPI_PS_INITIALIZATION
BAPI_BUS2054_GET_STATUS
BAPI_BUS2054_SET_STATUS
BAPI_PS_PRECOMMIT
Not sure What I am missing in it. is there any other way to update the WBS status.( any other FM )
01-04-2015 5:06 PM
You also need to call
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
return = wa_return.
But since you are writing this code in an exit it might not work (can give dump).
Hence, add
IN UPDATE TASK
while calling your ZFM.
01-05-2015 6:56 AM
Yes I am calling the FM in Update Task as already mentioned above in my comment.
01-05-2015 7:03 AM
Well you could try two solutions
Regards,
Raymond
01-05-2015 10:06 AM
Are you also calling BAPI_TRANSACTION_COMMIT? Because it works in my case.