cancel
Showing results for 
Search instead for 
Did you mean: 

Alternative to BAPI_PBSRVAPS_CHANGEKEYFIGVAL2

Former Member
0 Kudos

Hi all,

I am trying to change the values in the planning book for some key figures programmatically.

It is a custom upload functionality which upload data from excel to planning book.

I am using the BAPI - BAPI_PBSRVAPS_CHANGEKEYFIGVAL2 to do the same.

This BAPI takes values from the excel and uploads it.

The issue that I am facing is that the key figure values are captured by the BAPI in a tables parameter which takes values of floating point type.

So it doesnt consider null.

If there is cell in the excel which is null(blank) it skips it and takes the next value.

But we want to capture null also.

Is anyone aware of another BAPI to do the same functionality.

Eagerly waiting for responses.

-Kshitija

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Kshitija,

Could you check SAP note 999314 whether applicable

to you

Regards

R. Senthil Mareeswaran.

Former Member
0 Kudos

Kshitij,

Try what Senthil has suggested, if it doesnt work I can give you a workaround.

1). Change all the INITIAL values in your excel to a big numer say, -98989898. You can use the ISBLANK() function in excel for this

2). Load the data using the BAPI.

3). Run a macro which will:

IF (Value = -98989898)

INITIALIZE KF

Again, this is assuming you dont find a BAPI to accomplish it.

Hope this helps.

Abhi

Former Member
0 Kudos

Hi,

I cannot use BAPI_PBSRVAPS_CHANGEKEYFIGVAL as it uses the same floating values table which doesnt allow null.

And I had also thought of giving a -ve number and then changing it.

But the problem is of initialising the value of the key figure to null.

For initializing also we will have to use the same BAPI. So no point.

-Kshitija

Former Member
0 Kudos

Kshitij,

You can INITIALIZE the values later using a very simple macro. Why do you want to sue the BAPI to initialize. You can run the macro as a background job.

In the macro when you give the KF choose "Change Scope: Table VAlues or Layout attributes" as INITIALIZATION.

Please confirm.

Abhi

Edited by: abhishek sharma on May 21, 2010 11:54 AM

Former Member
0 Kudos

I want to change the values of the planning book.

We need to use a BAPI for the same.

By initiallizing I meant change the values of the planning book to null.

-Kshitija

Former Member
0 Kudos

Kshitija,

What exactly do you eman by "By initiallizing I meant change the values of the planning book to null."

I believe you want to change the values of a particaular time bucket for a given KF to NULL. Please clarify.

If yes, I am suggesting to change the value in your excel sheet to -989898 and run the program. After the run when you check teh planning area data you would see a -98989898 value wherever you wished to see a NULL. Now run the macro converting them to NULL.

ABhi

Former Member
0 Kudos

Abhi,

Where should the macro be created to change the value from -ve value to null?

-Kshitija

Former Member
0 Kudos

Kshitija,

I believe you are wokring on the technical end and not functional end?

Macros are craeted using Transaction /sapapo/advm. You can refer my comments to your functional consultant and he would know how and where to create the macro. Its a very simple 10 mints job

Let me know if you need help.

Abhi

Former Member
0 Kudos

Hi Kshitija,

Could you try the BAPI with function module

BAPI_PBSRVAPS_CHANGEKEYFIGVAL

Regards

R. Senthil Mareeswaran.