cancel
Showing results for 
Search instead for 
Did you mean: 

APO DP macro to handle column data

Former Member
0 Kudos

I am using APO DP V5, and have a specific macro related question...

In a planning book view I have a key figure in which the user can enter data.

If a user enters a number nnn in column x I need a macro to populate all columns to the right of column x (ie column x1, column x2, etc) with the number n.

Example, assuming 10 columns in the view:

- initial situation for key figure:

0,0,0,0,0,0,0,0,0,0

- user enters 2 in column 3:

0,0,2,0,0,0,0,0,0,0

- I need macro to produce result of:

0,0,2,2,2,2,2,2,2,2

- user now enters 4 in column 5 and 6 in column 8:

0,0,2,2,4,2,2,6,2,2

- I need macro to produce result of:

0,0,2,2,4,4,4,6,6,6

Any ideas appreciated!

Thanks, Bob Austin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Group APO,

I just want to say that this can roughly be accomplished by using the distribution function (calculator icon) in the Interactive Planning table. The users will need to choose the date themselves though. Let me post again for the macro.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Bob

if you want to use a macro looks like you have to use an auxilliary KF which will be populated using the macro function VALUE_OF_ROW_CHANGED()

VALUE_OF_ROW_CHANGED( X ; Y1 ; ... Yn ) returns 1 if the user has changed one or more key figure values in columns Y1 through Yn of row X in the current planning session since last pressing Enter. In the attributes of the row, enter Row Attributes as the data source

now if you write another macro that checks this auxilliary row and changes the KF you have mentioned

if there is no value it copies from the left cell

if there is a 1 it lets that value be as entered by the user

there is a recent discussion on the macro here

https://forums.sdn.sap.com/click.jspa?searchID=2090795&messageID=3272512

Former Member
0 Kudos

Harish,

This is helpful, but if the user has made <u>no</u> changes to the row, then the result is that all columns are set to whatever value is in first cell.

Any ideas on this?

Thanks,

Bob.

Former Member
0 Kudos

didnt think about that

you can set the macro to start executing from the cell where the first "1" starts

Former Member
0 Kudos

If there is no 1 then it lets the cells be as it is

Former Member
0 Kudos

Harish,

OK, but how do I do this?

Regards,

Bob.

Former Member
0 Kudos

just a regular IF condition

first calculate the auxilliary row

then use this condition in the next step

If value of first cell in auxilliary cell is 0 then do nothing

If value in the Auxilliary row is 1 then copy to cell in the right

Former Member
0 Kudos

Harish,

I'm having difficulties with this.

If you have created a macro for this, can you screenshot and send to me at bob.austin@atosorigin.com.

Thanks,

Bob.

Former Member
0 Kudos

Hi Bob

I havent had to create such a macro yet......That was an armchair solution which should theoretically work

But i will give it a shot early next week and if it works pass it on to you