Hello SAP Folks,
This document is an attempt to explain the use of the FM BAPI_ACT_PRICE_CHECK_AND_POST, which can be used as an alternative of TCode KP26 for batch processing & automating the Cost Center/Activity Price Planning.
For instance, Lets take a requirement to automatically update the Price Planning with the currency exchange rate change at the start of every month.
A background program can be very much helpful to achieve this requirement as the manual update for multiple cost centers/activity using KP26 requires big efforts & human error is also possible.
Now, to achieve this requirement, I have taken the reference of Standard Table COST to get the Cost Centers/Activity Type, for which the Price Planning in KP26 is updated at least once.
Since the Program contains large no. of lines, I have Attached the Program here in the notepad file. For the above requirement using the subjected BAPI.
Below is the Program Selection screen which looks similar to what we see in KP26.
Now, Once we execute the program, the BAPI will be called to update the Price Planning for the Given Selection. Please note that ideally the Cost Center & Activity Type fields should remain empty during the Batch Job, else there is no point creating the program. Here I have entered Cost Center & Activity in selection for Demo Purpose.
Once the execution is completed, the program will display the processing Log in a classical ALV display, which would help us to analyze the processing & identify the failed ones.
If the update is successful, the program will display the log like below :
Else, If something goes wrong during the processing or any error is found, the Error will be displayed like below :
Please note, that using this BAPI you can perform the price planning for multiple entries with a single Function call, but the BAPI itself does not return any success message in return table if the update is successful & sometime may not return the Cost Center or Activity Type Value in case of some failure, so you may not get to know that out of n entries, which were updated & which were failed.
So to override this restriction, I have called this BAPI in a Loop to get the status of each cost center/activity combination.If you are concerned with the performance impact, it would still give faster execution time so no major impact would be observed.
As a result of Batch Execution, the processing log will look somewhat like below :
Please refer the attached file to refer the source code.
I hope this will be helpful for you.
Regards,
Bharat Bajaj