cancel
Showing results for 
Search instead for 
Did you mean: 

How to freeze any cell of any key-figure i.e lock or make uneditable by the planner Using MACRO &/or function

Former Member
0 Kudos

Hello Experts,

This is my first post in SAP world.

I want to write a macro that can make any cell of the given key-figure uneditable.

The Context/Purpose:

copy data of one key-figure to another and lock the first period (or any intended period 1 or 2 or 3 or n) cell to be locked i.e. uneditable by the planner.

I could write the simple macro that copies the data from the desired KF to another desired KF but I am not able to make the "Future p1" period cell for "KF3" (newly populated key-figure) uneditable ir. frozen.


In another such case I want to freeze "Future p1 p2 p3 p4" also.

Macro: copy forecast
step: copy kf2 to kf3 (iterations: hist p1 to hist p5)
row: kf3 (iterations: future p1 to future p6)
row: kf2
hist p1hist p2hist p3hist p4hist p5future p1future p2future p3future p4future p5future p6
kf112345
kf2 1.12.23.14.15.16
kf3 1.12.23.14.15.16

Problem in nutshell:

1. Copy data from kf2 to kf3 and freeze future p1.

2. Copy data from kf2 to kf3 and freeze future p1 p2 p3 p4 .

Thanks.

Harshad M.

Accepted Solutions (1)

Accepted Solutions (1)

former_member187488
Active Contributor
0 Kudos

Hello,

You can use macro function cell_input(). Please refer to the below online help.
Planning Table Functions and General Functions - Operators and Functions in Macros - SAP Library

Notice that you must set the "Change Scope" to "Attribute Change".
You can refer to my document http://scn.sap.com/docs/DOC-47359

Best Regards,
Ada

Former Member
0 Kudos

Thanks Ada Lv,

This should work, but when it comes to multiple buckets cell_input() have the limitation that it is valid only for a single cell as far I think.

So in second scenario how to give the pass reference of multiple (4 in our case) periods to the cell_input() i.e. how to make cell_input() work for multiple periods.

Regards,

Harshad M. 🙂

former_member187488
Active Contributor
0 Kudos

Hi,

It should be easy, you just control the loop period of the step ... I don't see there's any difficulty ...

BR, Ada

Former Member
0 Kudos

Yes,

Thanks Ada Lv.

I also followed this

Answers (1)

Answers (1)

Former Member
0 Kudos

I also have one more question.

How do we conditionally execute any step in the macro.

Ex. I want to freeze few columns IF nothing is highlighted while the macro is being executed in Foreground. But IF anything is highlighted before start of execution then kf1 should copy to kf2 for the highlighted periods.


Thanks.

Harshad M 🙂