Skip to Content
0
Feb 24, 2022 at 08:15 PM

Change Production order priority fields in AFKO Header using BAPI.

132 Views

Hi,

I am using the Bapi BAPI_PRODORD_CREATE_FROM_PLORD

to convert the planned order to production order. My requirement is to update the priority of the production order AFKO-APRIO to a different value based on certain condition.

Is there a standard Bapi to update AFKO table.

I see CO_00_CAUFVDB_AFIH_TRANSFER bap, but is there anything to update AFKO?

I tried below code , but i dont see afko being updated.

 CALL FUNCTION 'CO_00_CAUFVDB_AAXXX_TRANSFER'
EXPORTING
caufvdb_imp = ls_caufvdb
IMPORTING
aafko_exp = ls_xafko
aaufk_exp = ls_xaufk.
APPEND ls_xafko TO lt_xafko.
APPEND ls_xaufk TO lt_xaufk.
* transfer data of order header to structure for change document
CALL FUNCTION 'CO_00_CAUFVDB_AAXXX_TRANSFER'
EXPORTING
caufvdb_imp = ls_caufvdb_old
IMPORTING
aafko_exp = ls_yafko
aaufk_exp = ls_yaufk.
ls_yafko-aprio = header_imp-aprio .
APPEND ls_yafko TO lt_yafko.
APPEND ls_yaufk TO lt_yaufk.