Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_PO_CHANGE Missing Authorization Error

0 Kudos

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

1 ACCEPTED SOLUTION

0 Kudos

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

7 REPLIES 7

Abinathsiva
Active Contributor
0 Kudos

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!

0 Kudos

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

0 Kudos

did you try to make a ST01 trace to find if there is an authorization check with a failed ?

kiran_k8
Active Contributor
0 Kudos

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.

0 Kudos

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

0 Kudos

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

p244500
Active Contributor
0 Kudos

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.