10-20-2017 9:20 PM
Hello everyone
Some FM are available to update batch in the component level of a production order.
CO_XT_COMPONENT_CHANGE
CO_XT_ORDER_PREPARE_COMMIT
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?
Regards
stjacqd
10-26-2017 7: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.
Regards
10-21-2017 12:24 AM
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.
10-23-2017 3: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.
Regards
10-23-2017 6:47 PM
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.
10-26-2017 7: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.
Regards
07-09-2020 12:06 AM
"Otherwhise you could just Query AFPO-Table an Store the Result in AFPOD-Structure ..." - I've the same requirement, it's not working !
As per my understanding, this FM CO_BI_AFPO_UPD will work in only BADI implementation "WORKORDER_UPDATE" - IF_EX_WORKORDER_UPDATE~AT_SAVE Method.