cancel
Showing results for 
Search instead for 
Did you mean: 

INTERN_MATLO instead of 9ALOCNO

Former Member
0 Kudos

Hello,

I am using the BAPI - BAPI_PBSRVAPS_GETDETAIL2 to fetch keyfigure details for a SNP planning book .

And i am passing the following paramters.

PLANNINGBOOK = 9ACTM02

DATA_VIEW         = CTM02(1)

PERIOD_TYPE    = 'A'

DATE_FROM       = 20131128

DATE_TO             = 20131129

SELECTION          =    9AMATNR    I    EQ     123456

                                    9ALOCNO    I    EQ     1000

GROUP_BY          =    9AMATNR

When i ran the BAPI, i get two entries in CHARACTERISTICS_COMBINATION table like below..

CHAR_COMB_ID CHARACTERISTIC_NAME            CHARACTERISTIC_VALUE


        1 |9AMATNR                       |123456

        1 |INTERN_MATLO            |                          

I have two questions on the above result i received.

1. for location, i was expecting the CHARACTERIC_NAME as 9ALOCNO instead of INTERN_MATLO. Why am i getting 'INTERN_MATLO' ?

2 . And for the location i was expecting value as 1000. But it has a blank value.

Would appriciate if you could help passing the correct parameters to get the desired result here.

Please note, when i run this BAPI for a DP planning book i get expected result in CHARACTERISTICS_COMBINATION table

as below..

1       9AMATNR             123456

1       9ALOCNO             1000.

Accepted Solutions (1)

Accepted Solutions (1)

former_member187488
Active Contributor
0 Kudos

Key figures in SNP planning book are assigned to certain aggregates. Only when you execute the BAPI on a certain assigned aggregate, could a key figure's value be read by the BAPI. Most key figures are assigned to aggregate 9AMALO, but there's no aggregate 9AMA. So you need to specify the grouping condition as 9AMATNR and 9ALOCNO, instead of just 9AMATNR.

As you can see, when you select only 9AMATNR as grouping condition, not internal planning object is returned.

As I always suggested, understanding SNP aggregates is necessary to understand SNP. Please also refer to note 1331576, which is a very useful note to understand SNP master data,

Former Member
0 Kudos

Thanks Ada Lv,

Passing the 9ALOCNO resolved my second question. It did bring me the value for location as below

CHAR_COMB_ID CHARACTERISTIC_NAME            CHARACTERISTIC_VALUE


        1 |9AMATNR                       |123456

        1 |INTERN_MATLO           |  1000

But i still see the location name being returned as INTERN_MATLO instead of 9ALOCNO. Is there any way we can get '9ALOCNO' for location in the above table (CHARACTERISTIC_COMBINATION) ?                      

former_member187488
Active Contributor
0 Kudos

This is strange. Can you please upload the input parameters you're using?

If you put:

   SELECTION          =    9AMATNR    i    EQ     123456

                                        9ALOCNO    i    EQ     1000

   GROUP_BY          =    9AMATNR

                                       9ALOCNO

You should get the result in CHARACTERISTICS_COMBINATION as:

CHAR_COMB_ CHARACTERISTIC_NAME            CHARACTERISTIC_VALUE                                         CHARACTERISTIC_TEXT

        1  9AMATNR                        123456                                                APO Location
        1  9ALOCNO                        1000                                                    APO Product
        1  INTERN_MATLO              123456/1000

Answers (1)

Answers (1)

satish_waghmare3
Active Contributor
0 Kudos

Hello Ramso


Please see below code.  This may give you some hint.  This is working code to read data from SNP Planning Area. May be you need to add Planning Version.

Call Function module  ‘BAPI_PBSRVAPS_GETDETAIL2’ exporting

GV_PLANNING_BOOK to PLANNINGBOOK,

GV_DATA_VIEW to DATA_VIEW,

GV_PLANNING_VERS to PLANNING_VERSION,

GV_SELECTION_ID to SELECTION_ID,

GW_READ_OPT to READ_OPTIONS,

GV_DATE_FROM to DATE_FROM,

GV_DATE_TO to DATE_TO,

importing GV_NO_CVC from NUMBER_OF_CHAR_COMBS,

tables GT_GROUP_BY to GROUP_BY,

GT_KEY_FIG_SEL to KEY_FIGURE_SELECTION,

GT_KEY_FIG to KEY_FIGURE,

GT_KEY_FIG_VAL to KEY_FIGURE_VALUE,

GT_CVC to CHARACTERISTICS_COMBINATION,

GT_RETURN to RETURN.

Also sharing with you a useful link to wiki page. This wiki page has a list of Useful BAPIs, User-exits, BADIs, Function Modules etc from APO and also contains link to various child pages on APO technical. You may want to refer this if not done already.  Below link has details of this functional module as well.

APO-Technical - Supply Chain Management (SCM) - SCN Wiki

Hope this will help.

Thank you

Satish Waghmare