cancel
Showing results for 
Search instead for 
Did you mean: 

Execution of Macro in Background job

Former Member
0 Kudos

We have created a macro in APO DP that uses 4 characteristics and a key figure. As part of the macro we are executing a Z-function that we have created. The problem occurs when executing the macro in a background job. When the background job is executed the macro processes correctly (performs the correct calculations) for the first CVC that is processes, but it is not able to process the rest of the CVCs.

<b>ERROR: "There are no plannable characteristic combinations",</b>

The function copies data from the CVC that is being processed (source CVC) to another CVC (target CVC). The values for the target CVC to which the data has to be copied for a particular key figure are determined from the paramaters that are given to the function in the macro.

The steps followed in the function are the following:

1- Determine the relation between source and target CVC, ie, from the source CVC that is being processes in the macro, the function determines the target CVC to which the data has to be copied.

2- Call BAPI "BAPI_PBSRVAPS_GETDETAIL2" to retrieve the valuesthat are in the Planning Book for the source CVC.

3- Perform the addition of data (value retrieved from the source CVC is added to the target CVC).

4- Write value to the target CVC using BAPI "BAPI_PBSRVAPS_CHANGEKEYFIGVAL2".

When using the BAPIs the aggregation level used is the same aggregation as the one specified in the Background job used for the execution of the macro.

This macro is executed in a background job, and the copy/calculation is performed correctly for the first CVC (first CVC contained in the data selection used in the background job) processed, but then it does not do anything else for the rest of CVC's. The error message given by the log of the background job is <b>"There are no plannable characteristic combinations",</b> when in fact, the characteristic combinations do exist in the Planning Object Structure.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Are there any other macros that are executed when you run the macro in a foreground planning book? For example, in the default or start level sections. If there are, do they provide any calculations or information that your macro uses?

If so, then you will need to ensure that these others macros are also executed as steps prior to your macro execution in the background job.

Former Member
0 Kudos

Hi Ian

There are not any other macros in the planning book.

In addition, if we execute the macro in interactive mode we have another error at the end of the execution (after doing all the combinations):

<b>Invalid data status</b>.

and we don't know why.

Regards

Former Member
0 Kudos

Hi

Th eerrors suggest some inconsistencies in livecache, have you ran the programs /SAPAPO/TS_LCM_CONS_CHECK and /SAPAPO/TS_LCM_REORG in "repair" mode prior to running your macro. This should ensure that livecache is consistent prior to the run.

Regards

Ian

Former Member
0 Kudos

Looks like the first CVC copy is creating a LC inconsistency

Maybe you can try to include /SAPAPO/TS_LCM_CONS_CHECK into your macro as the first step.

Looks like an interesting development... Any specific reason why you are using this method from the planing book than use the RTSCOPY or Realignment copy??

Former Member
0 Kudos

Hi.

The reason we don´t use RTSCOPY is because CVC source and final are not equals and the RTSCOPY does the copy inside the same CVC but in differents planning areas, and that isn't our scenario.

Thanks.

Ana

Answers (0)