cancel
Showing results for 
Search instead for 
Did you mean: 

Using BAPI 'BAPI_PBSRVAPS_GETDETAIL2'

Former Member
0 Kudos

Hello,

I am an ABAP developer in ECC and my knowledge in APO is zero, so please bear with my question.

I am using the BAPI  'BAPI_PBSRVAPS_GETDETAIL2' to fetch the information from a planning book.

Iam passing the following values to the BAPI.

Planning book -  9ADP_BASIC

Data view -  ABSATZPLANUNG

Planning version - 000

And the BAPI returns the values in the following tables

KEY_FIGURE ( contains all the available key figures in this planning book )

KEY_FIGURE_VALUE  (This has 4 columns 1. KEY_FIGURE 2. PERIOD_BEGIN 3. PERIOD_END 4. VALUE 5.FIXING_INFO )

Example -

KEY_FIGURE         PERIOD_BEGIN        PERIOD_END                      VALUE                                    FIXING_INFO

        1                 20.120.326.000.000       20.120.401.235.959      0,000000000000000E+00              0

My questions are ---

1. when i see the planning book, it has some values in for this Key figure in the above date range, but why dont see that values here ?

2. where do i see the product(Material) and Location (plant)information ?

Appriciate you help with these questions.

Accepted Solutions (1)

Accepted Solutions (1)

sourabh_jain66
Active Contributor
0 Kudos

Hi Ramso,

From the period value it seems BAPI is returning value from 6th march 2012 to 1st april 2012, that might be the reason why you are not able to see any value against it, try to find if you can pass desired period value in the BAPI.

Location and Product info will be in characteristics, see if you are able to find those values in the BAPI, or look for some other suitable BAPI, where you are able to see CVC (characteristics value combination) values.

Rgds

Sourabh

Former Member
0 Kudos

Thank you sourabh,

The BAPI returns no entries in CHARACTERISTICS_COMBINATION table.

Am i doing something wrong here ?

former_member187488
Active Contributor
0 Kudos

Hello,

You'll need to enter 'selection id' or 'selection', and then enter 'group by', in order that you can get table 'characteristics_combination' filled. Even if you want to display values for all CVCs, you'll have to enter an selection condition 9AVERSION = 000 and a characteristic in 'group by'.

Please go to transaction 'BAPI' to check the documentation of this BAPI.

Best Regards,

Ada

sourabh_jain66
Active Contributor
0 Kudos

Hi Ramso,

Precisely, try to do pass selection value, and then 'group by', as suggested by ada, should resolve your issue.

Rgds

Sourabh

0 Kudos

BAPI_PBSRVAPS_GETDETAIL2: Used to read key figure values from one data view for a planning book. The parameters key figure, key figure value and characteristic combination serve as return parameters.

The key figure details are contained in Key figure. These entries use the field CharComId to refer to the characteristics combinations in parameter Characteristics Combination for which they are valid. The key figure values for the individual periods of time are contained in parameter Key Figure Value.

By default, no macros are executed for DP planning books. If, however, to execute macros for the planning book or the data view, the field Macro Execution Flag must be set in parameter read options. In the case of SNP planning books on the other hand, macros are always executed.

CALL FUNCTION 'BAPI_PBSRVAPS_GETDETAIL2'
EXPORTING

planningbook     = planningbook Name
data_view        = data view name
planning_version = planning version
read_options     = gs_read_options
period_type      = ’A’
date_from        = date_from
date_to          = date_to
TABLES

selection        = gt_selection
group_by         = gt_group_by
key_figure       = gt_key_figure
key_figure_value = gt_key_figure_value
    return   = gt_return1.

There is a new book on Programming in SAP APO. You might want to check that out.

http://www.flipkart.com/programming-sap-apo-1st/p/itmdgt9hbdh6auzu?pid=9781259028441&ref=bc49ea80-1a...

Answers (2)

Answers (2)

Former Member
0 Kudos

Excellent, thank you all for the help. By passing values in 'selection' and 'group by' , i got the results in

CHARACTERISTICS_COMBINATION table.

And one more question.. Can this BAPI used to retrive SNP info aswell or this is only good for DP?

sourabh_jain66
Active Contributor
0 Kudos

Hi Ramso,

If you are referring to SNP planning book, then i believe this BAPI should be helpful there.

Rgds

Sourabh

Former Member
0 Kudos

Hi Ramso,

You want to fetch the values of say keyfigure1 @ location1 of product1 across n buckets.

Then for the BAPI to fetch these you should pass the planning book and data view names, char combs and key figures. From what you wrote i think you are missing the car comb's. Pass them and then you will get the required.

When you open the planning book, you need to key in the product and location through the filter called schuffler, to be able to view the details of the keyfigures in the relevant buckets.

Hope this helps.

Regards,

SG