Skip to Content

Which BAPI/FM allow to update AFPO-CHARG field (BATCH)

Hello everyone

Some FM are available to update batch in the component level of a production order.

The following BAPI and FM doesn't allow to change the field "AFPO-CHARG".
CO_BI_AFPO_UPD doesn't work. It always returning sy-subrc = 1.
BAPI_PRODORD_CHANGE doesn't have the field "CHARG" in the structure.

Is anyone has an idea which FM or BAPI can be used to update the field AFPO-CHARG?


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 26, 2017 at 06:27 PM

    For the benefits of all.

    The solution we have used is:

    Using user exit EXIT_SAPLV01Z_002 and add the appropriate code to overwrite the field "CHARG"

    This user exit is called at the Production order release action through BAPI_PRODORD_RELEASE.

    If anyone has another solution to assign the AFPO-CHARG field without to have to release the Production order, Fill free to add it to this post.


    Add comment
    10|10000 characters needed characters exceeded

  • Oct 20, 2017 at 11:24 PM

    Hello Daniel

    What is the MessageID / Number of the Error upon Using "CO_BI_AFPO_UPD" and does it help using "CO_BI_AFPO_*" Functions to Fetch the AFPO-data beforehand?

    The FM "CO_VB_ORDER_POST" has a Form 'AFPO_POST' (see Include "LCOVBF10"), but this is a complex / critical FM to be using for this (I would not recommend it) ...

    Kind regards

    Nic T.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 23, 2017 at 02:30 PM

    Hello Nic

    Thank you for your answer.

    The function CO_BI_AFPO_UPD is only raising the "ERROR_READ_AFPO" exception.

    Doing some debugging, the function is reading an internal table "AFPO_BT" and if the record is not there, the exception flag is raise. No matters if the record is physically in the table or not.

    I tried to use the function CO_BI_AFPO_GET and CO_BI_AFPO_CREATE to fill up the internal table AFPO_BT without success.

    I am afraid the FM "CO_VB_ORDER_POST" is also using the internal table AFPO_BT.

    Maybe, if I can find the right way to populate the internal table 'AFPO_BT" it will solve my problem. But for now, I didn't succeed to do it.


    Add comment
    10|10000 characters needed characters exceeded

    • Hello Daniel

      In our System the FM "VB_CP_HEADER_DATA" provides the AFPO-Result. Otherwhise you could just Query AFPO-Table an Store the Result in AFPOD-Structure ...

      PS : By 'Commenting' (rather than Answering) your Correspondents will get Notified on your Update ... Now, I luckily went through some Posts and saw your Update ...

      Hope this helps

      Nic T.