02-21-2020 10:31 PM
Hi All,
When I am trying to change a PO using the FM 'BAPI_PO_CHANGE' in the backend through program it says "Missing authorization: Pur. Order Change Doc.Type UB" but when I do it from foreground it allows me to change without error.
i am trying to setup the deletion indicator and the PO completion Indicator. Please let me know if anyone has faced similar issue and the possible solution.
My code is as follows:
ls_poitemx-po_item = ls_poitem-po_item = ls_ekpo-ebelp.
ls_poitemx-po_itemx = 'X'.
ls_poitem-delete_ind = 'L'. "PO deletion Indicator
ls_poitemx-delete_ind = 'X'.
ls_poitemx-no_more_gr = ls_poitem-no_more_gr = 'X'. "PO completion indicatr
APPEND ls_poitemx TO lt_poitemx_tab.
APPEND ls_poitem TO lt_poitem_tab.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = ls_ekpo-ebeln
TABLES
return = lt_return_tab
poitem = lt_poitem_tab
poitemx = lt_poitemx_tab.
Thanks,
Ashok
02-24-2020 3:34 PM
Hi All,
The issue was resolved. Since the BAPI_PO_CHANGE is a RFC call from EWM so the ID is different. The background EWM ID has authorization issues it seems when trying to change documents in ECC. The BAPI_PO_CHANGE has a flag 'NO_AUTHORITY'. If selected it stops the authority checks and updated the PO correctly.
Thanks,
Ashok
02-22-2020 12:23 AM
Hi Ashok,
debug the code and find the values in Return_BAPI table value and fix the error messages rise in return table. And do use code button to paste your code..
can use the link BAPI PO CHANGE sample code
Regards!
02-23-2020 4:53 AM
Hi Abinath,
Thank you for the reply. the Return table gives me the error "Missing authorization: Pur. Order Change Doc.Type UB". If it was a Authorization issue I would have received the same error in foreground also in ME21N/ME22n but in foreground I am not getting any error.
Thanks,
Ashok
02-24-2020 1:31 PM
did you try to make a ST01 trace to find if there is an authorization check with a failed ?
02-24-2020 1:27 PM
Ashok,
The User ID that is being considered during background processing might be different from the User ID that is considered during the foreground.Check the authorisation issue from that aspect as well.
Thanks,
K.Kiran.
02-24-2020 2:31 PM
Hi,
I had checked SU53 but it doesn't show any missing authorization in the log as also in ST01. The BAPI_PO_CHANGE is inside a RFC and the call is being made from EWM. The requirement was once the WT on EWM is cancelled the program should automatically zero out the ECC delivery and mark the PO as completed as also check the delivery completion indicator. The delivery updates without any issue while the PO gives authorization error.
Thanks,
Ashok
02-24-2020 3:34 PM
Hi All,
The issue was resolved. Since the BAPI_PO_CHANGE is a RFC call from EWM so the ID is different. The background EWM ID has authorization issues it seems when trying to change documents in ECC. The BAPI_PO_CHANGE has a flag 'NO_AUTHORITY'. If selected it stops the authority checks and updated the PO correctly.
Thanks,
Ashok
02-24-2020 3:37 PM
HI,
Authorization-BAPI_PO_CHANGE
When you create (activity 02) an Enjoy purchase order, the following authorization objects are checked
M_BEST_BSA (document type in PO)
M_BEST_EKG (purchasing group in PO)
M_BEST_EKO (purchasing organization in PO)
M_BEST_WRK (plant in PO)
Further detail, kindly look at the BAPI documentation.