cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_PBSRVAPS_CHANGEKEYFIGVAL2 Not Working

Former Member
0 Kudos

Hi

I am facing problem using BAPI_PBSRVAPS_CHANGEKEYFIGVAL2. I am getting the error message as below

Time period 20120701000000 to 20120728235959 does not exist or cannot be changed

However I checked the SBP and timebucket profile, this date falls in the horizon range.

On detailed debugging, we noticed that standard BAPI is referring to table RSDIOBJCMP.

For the infoobjects that we are using there is no entry maintained in the table RSDIOBJCMP ( IOBJNM  - Infoobject Name and OBJVERS as "A")


Can this be the reason for the error message that we are getting


Any help is highly appreciated.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member187488
Active Contributor
0 Kudos

Hi, please first check whether you have enable the 'Input' for the historical periods in /sapapo/sdp8b. If this setting is OK, try to initialize the planning area with the same periods without de-initializing it.

Former Member
0 Kudos

Hi Ada

The planning book is enabled for input in the history horizon also

Can you please tell me how can I initialize the planning area without De-initializing it. Thanks

babu_kilari4
Active Contributor
0 Kudos

Hello Vijay,


You can initialize the planning area by running the t-code /SAPAPO/TSINIT.

Babu Kilari

babu_kilari4
Active Contributor
0 Kudos

Hello Vijay,

Without looking at the planning book design, it is difficult to explain the root cause for the error. However, I can suggest you an alternative method to change the Keyfigure data in the planning area.

/SAPAPO/TS_DM_GET

/SAPAPO/TS_DM_SET

These are two Function modules which can be used to change the keyfigure data. Function module 1 retrieves the data from planning area for the keyfigfures which you would like to change the data and the second function module modifies the keyfigure data by using some of the parameters retrieved by function module 1

Hope this helps

Babu Kilari

Former Member
0 Kudos

Hi Babu

I am not able to run the FM  - /SAPAPO/TS_DM_GET

I am getting the error message - "Error Generating the test frame" when I am executing this function module

babu_kilari4
Active Contributor
0 Kudos

Hello Vijay,


A typical syntax to run this FM would be as shown below


CALL FUNCTION '/SAPAPO/TS_DM_GET'

    EXPORTING

      iv_pareaid          =   iv_pareaid

      is_read_options =   is_read_options

      is_period           =   is_period

      it_selection       =    it_selection

      it_group_by       =    it_group_by

      it_keyfigures     =    it_keyfigures

    IMPORTING

      et_tab              =     et_tab

      et_plob_values  =     et_plob_values

    CHANGING

      ct_lines            =    ct_lines

      ct_cols            =    ct_cols

    EXCEPTIONS

      area_invalid        = 1

      invalid_interface  = 2

      no_master_data      = 3

      customizing_error  = 4

      invalid_data_status = 5

      lc_connect_failed  = 6

      lc_com_error        = 7

      lc_orders_error    = 8

      no_authorization    = 9

OTHERS              = 10.

In the Is_read_options, you need to pass "X"

In the IS_Period, you need to pass the future time bucket id.

In the IT_Selection, you need to pass the selection details.

In the IT_GROUP_BY, you need to pass the grouping characteristic

In the IT_KEYFIGURES, you need to pass the keyfigure data

Hope this helps

Babu Kilari

Former Member
0 Kudos

Hi Babu


I am not able to reach the input screen only when I execute the FM in se37

I get the information message "Error Generating the Test Frame" when I execute SAPAPO/TS_DM_GET and then the control returns to the initial se37 screen

satish_waghmare3
Active Contributor
0 Kudos

Hello Vijay,


Please check this SAP note 999314 whether it is relevant to your SCM system.

If not already done, Read the Functional Module documentation.

-> Goto SE37

-> Enter BAPI Name :  BAPI_PBSRVAPS_CHANGEKEYFIGVAL2.

-> Display the Source code

-> Click on the button called "Function Module Documentation" (or Press CTRL + F4)

Also you can use BAPI Explorer(Tcode: BAPI) and check the documentation.  Follow  this path:  Supply Chain Management ->Advanced Planning and Optimization ->PlanningBookAPS ->ChangeKeyfigureValue2

Also see if this thread can help you:
http://scn.sap.com/thread/1628794

ADDED --->

I would like to stress that 'BAPI_PBSRVAPS_CHANGEKEYFIGVAL2' should work fine, we have recently used this in one of the Z program.  But your error is specific to your system did not specify this details. Here is a sample of code -

    CALL FUNCTION 'BAPI_PBSRVAPS_CHANGEKEYFIGVAL2'

      EXPORTING

        planningbook                = p_plan

        data_view                   = p_data

        planning_version            = p_pver

      TABLES

        key_figure                  = i_keyfig

        key_figure_value            = i_keyfigval

        characteristics_combination = i_charcomb

        return                      = i_return.

<---ADDED

Hope this will help.

Thank you

Satish Waghmare

Message was edited by: SATISH WAGHMARE