cancel
Showing results for 
Search instead for 
Did you mean: 

Planning book macros & Data view macros??

Former Member
0 Kudos

Hi everybody,

I'm new to APO. I had got a DRP IBT TCS Extraction program to optimize in APO. In this program the bapi CALL FUNCTION 'BAPI_PBSRVAPS_GETDETAIL' was takin a lot of time to execute. In this bapi it sends 1 material & all the locations to find the amount of material present at each location. this bapi is inside a loop of number of materials.

Now to optimize I used the a parameter READ_OPTIONS of the bapi. I flaged that the below mentioned two macros not to be executed.

1) NoPbookMacros: If this indicator is set, no planning book macros are executed.

2) NoDviewMacros: If this indicator is set, no data view macros are executed.

The execution time has reduced considerably.

For the varient given its working fine.

I don't know wht these macros are and will it effect the output?? Will this create problem in future???

Give suggestion & details regarding this.

Thank You,

Ajo

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Whether you coding solution you mentioned above (e.g. marking the NoPbookMacros and NoDviewMacros) is correct or not depends on the design of the planning book you are reading in the BAPI and the design of the macros that were placed in it. For example, if the planning book contains a macro to get the sum of two rows (e.g. Total Row = Stat forecast + Adjustements) and then in the BAPI you are extracting data for the Total Row Key figure, then your approach will not work. This is simply because marking the NoPbmacros will disable the execution of the Total Row macro during reading and thus it will not compute the sum of stat and adjustments during extraction. Please communicate with the Planning Book designer (the person who designed it) and ask him whether the macros are needed to be executed during extraction.

Note, that it may also be the case that in your APO system the macros are executed in mass processing (e.g. Demand Planning in the background) which means that the computations have already been done for the KFs (i.e. the

total row computation has already been done before extraction) and you may not need to execute them during extraction. In this case, then your coding solution may be correct. Again, you may need to communicate with your APO

expert on this case.

One optimization you can do here is to remove the BAPI call inside the ABAP loop. Instead read the materials and locations using the BAPI in bulk. For

example, before the ABAP loop you can pass the list of all materials and plants you have to the BAPI. Inside the loop you just check whether the tables returned by the BAPI contains the material/plants data. Please post

again if you need an example.