cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to prompt for a date range on a macro?

Former Member
0 Kudos

Do any of you know if there is a way to prompt for a date range on a macro rather than having the macro run for the same fixed date range?  A consultant we had said this couldn't be done but I thought I would ask the community. 

The situation is that one time we would want to run a macro for example the current period only.  The next time we want that same macro to run for current period out 3 periods.  The next time maybe next period only. And so on.  With out a prompt situation this would require three different macros to accomplish this.

If you have done this please kindly provide an example of the macro details that I can review.

thanks

Steve

Accepted Solutions (1)

Accepted Solutions (1)

rajkj
Active Contributor
0 Kudos

Steve,

You can use the macro function CHAR_VALUES_INPUT to prompt the user to provide a character value. If you need a range, it is required to prompt twice to record the user input. For dates, the required format will be YYYYMMDD and use DATE macro function to convert this input into a date (numeric value).

If your macro needs to execute always from the current period (say first column of data view), you may also think about providing number of columns to be considered rather than providing a date range. It simplifies the macro implementation.

Another easy approach will be selecting the required columns (i.e. entire column similar to excel) that require macro execution. In macro implementation, you can use COLUMN_MARKED function to check whether a column is selected. If so, execute the macro. In this way, the user can pick any column. This is much simpler and requires just one IF condition.

Please check the following link for available macro functions and syntax.

http://help.sap.com/saphelp_SCM700_ehp02/helpdata/en/f3/852d3af6ecd02ae10000000a114084/frameset.htm

Thanks,
Rajesh

Former Member
0 Kudos

Rajesh, thank you for your prompt response and informative reply!  I tried that COLUMN_MARKED function and it seems to work like a charm.  I will present this to the busines to see if this will solve there issue.

Steve

Answers (0)