cancel
Showing results for 
Search instead for 
Did you mean: 

Macro to change input/output row

Former Member
0 Kudos

Hello Gurus,

We have a planning book that has a Key Figure which we want to be "OUTPUT" mode for few days in a month and rest of the month the row to be in "Input/Output" mode.

I was wondering if there is any Macro that can turn rows from "Output" to "Input/Output" mode and viceversa.

Any suggestion is appreciated.

Thanks,

Sanju

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

try row _input(x)

x= 1==> input/output

x= 0==> output only

also check cell_input and column_input

one you get the macros you can schedule it in an activity/ background job to run on specific days (if you know the schedule for running it)

Answers (2)

Answers (2)

Former Member
0 Kudos

I think that you have to use cell_input( ), because you don't wan to change neither all the row nor all the column.

I'm using a frozen period of two week in my planning area and i'm using this macro.

Período Congelado Operativo

-

-


Congela el período : ( 2 Iterations: W 30.2007; W 31.2007 )

-

-


Row: Factor Proporcional ( Attributes) =

-

-


COL_INPUT( 0 ) .

If you want to freeze only the row and not all the column you can change COL_INPUT(0) for CELL_INPUT(0).

This macro has a rolling period, so it freezes week n and n+1 always.

I hope this can help you.

Regards.

Marí

0 Kudos

Hi Sanju,

This can be done using a default macro only. You need to build a logic to determine from when you want a keyfigure to be editable (easier to make it editable than turning an editable keyfigure to display only). This can be done using BUCKET_BDATE or BUCKET_DATE_IN macro function to determine current date of month and then dervie the logic.

Based on the logic the keyfigure needs to made editable using function CELL_INPUT or ROW_INPUT depending on whether you want to change only one/few cells or the whole keyfigure. Make sure you use the Attribute and not Data option for the keyfigure "Scope of Change".

You need to also use CELL_BG or ROW_BG to change the color of the cell/row from Gray to White.

Please note this macro has to be a default macro and CAN NOT be executed in background since it is changing an attribute and NOT data.

Hope this helps.

Somnath

Former Member
0 Kudos

hi sanju,

still if you need help on this, post the complete business case, i will send you the detailed macro code...

Former Member
0 Kudos

Thank you everyone for very helpful replies. I am not much familiar with creating logical macros but I am trying to learn this. At this moment, Harish's suggestion is most feasible for me create since I know the schedule when I want to make the rows output only and input/output only.

However, I am also working on creating a macro that will

- Check today's date (i.e. the date User logs in Interactive Planning) and

- If today's date falls between the window (1st of month AND 5th of the month) then make it editable. For remaining days of month make it non-editable.

The problem is making this "date window" roll as we move ahead in time. Also I am not familiar with "how to use any date function" in the macro. But if you would like to share any tips with examples then it would be really appreciated.

Thanks,

Sanju

Former Member
0 Kudos

Pl have a look at the different date funciton available in macros here

http://help.sap.com/saphelp_scm50/helpdata/en/1d/310eb0d0ee11d4b2e40050da385632/content.htm

You can try this:

for checking todays date

DAY(TODAY)) should return you the day number in the month

(pl confirm this by writing this macro into an auxilliary row else play around with the other functions to get this)

So if the value it returns is < 5 ROW_INPUT(1)

else ROW_INPUT(0)

Former Member
0 Kudos

why don't you go through SAP example macros...

9AEXAMPLES View( MacroExamples) SAP_MACROS

you have around 215 macros here, all related to each macro function...also several other macro books on SNP functions..etc..go through this..definately your initial doubts will be cleared...

Former Member
0 Kudos

Thanks everyone for your input. I can take it from here.

Also I was not aware of macro examples provided by SAP. Thanks Uma.

israel_cano
Explorer
0 Kudos

Hi Somnath Manna

I trying to do the same but in a weekly bucket, I take the samples of DP for function BUCKET_BDATE, I wondering if the function could do this. I want to determine the bucket month and compare to the today month to turn on or off the edition capacity. But seems the function doesn´t return the correct value to compare versus the month (today) value

I'm looking to freeze n, n+1 months that is a regular practice on planning process

Any more suggestion I kindly appreciate