Entering content frame

Background documentation General and Planning Table Functions Locate the document in its SAP Library structure

Refer to the following table to find the macro function of your choice. The functions are listed in alphabetical order.

Function

Explanation

CELL_BG()

Syntax

CELL_BG( Color [; ToolTip] )

Color: Whole number color code between 0 and 64

ToolTip: String displayed as a ToolTip of the cell (optional)

Description

CELL_BG sets the background color of a cell.

CELL_FG()

Syntax

CELL_FG( Color [; ToolTip] )

Color: Whole number color code between 0 and 64

ToolTip: String displayed as a ToolTip of the cell (optional)

Description

CELL_FG sets the foreground color of a cell.

CELL_INPUT()

Syntax

CELL_INPUT( Read_only_mode ) 

Read_only_mode: Whole number value 0, 1, or 2 

Description

The CELL_INPUT function sets the ready for input status of a cell. The Read_only_mode parameter determines the status. The value 0 sets the cell's status to Not ready for input. The value 1 sets the cell's status to Ready for input. The value 2 determines that the cell adapts the status of the corresponding row. If no status has been set for the row, the value 2 determines that the cell adapts the status of the corresponding column.

CELL_LICON()

Syntax

CELL_LICON( Icon [; ToolTip] ) 

Icon: Whole number icon code between 0 and 29

ToolTip: String displayed as a ToolTip of the icon (optional)

Description

CELL_LICON sets an icon left-aligned in a cell.

CELL_RICON()

Syntax

CELL_RICON( Icon [; ToolTip] ) 

Icon: Whole number icon code between 0 and 29

ToolTip: String displayed as a ToolTip of the icon (optional)

Description

CELL_RICON sets an icon right-aligned in a cell.

CELL_TOOLTIP()

Syntax

CELL_TOOLTIP( ToolTip ) 

ToolTip: String displayed as a ToolTip of the cell

Description

CELL_TOOLTIP sets a ToolTip for a cell. The ToolTip can be entered directly as a string or can be determined using the macro function GET_TEXT (language-dependent), for example.

CHAR_VALUES_INPUT()

CHAR_VALUES_INPUT ( 'dialog_box_description' ;  'field_label_1' ; ... ;  'field_label_n' ) prompts the user to enter n character strings in a dialog box that appears automatically when this function is executed. A maximum of 10 character strings can be entered. Thus, you can have a maximum of 11 arguments for this function. As the first argument you specify the text that will appear in the title bar of the dialog box. Write this text in single inverted commas with underscores between each word. As the other arguments, you specify the field labels for the fields in which the user will enter the character strings.

COL_BG()

Syntax

COL_BG( Color [; ToolTip] )

Color: Whole number color code between 0 and 64, 100 and 164, or 200 and 264.

ToolTip: String displayed as a ToolTip of the column (optional)

Description

COL_BG sets the background color of a column.

COL_FG()

Syntax

COL_FG( Color [; ToolTip] )

Color: Whole number color code between 0 and 64, 100 and 164, or 200 and 264.

ToolTip: String displayed as a ToolTip of the column (optional)

Description

COL_FG sets the foreground color of a column.

COL_INPUT()

COL_INPUT( X ) sets the input status of a column. If X = 1, the status of the column is ready for input. If X = 0, the status of the column is read-only. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table. You can apply this function to a column or cell of the planning table. In the attributes of the column or cell, set the Scope of change to Attributes. This applies to Grid 1. To refer to Grid 2 use X = 20 for read-only, and X = 21 for ready for input. Similarly X = 10 and X = 11 to refer just to GRID 1.

COL_LICON()

Syntax

COL_LICON( Icon [; ToolTip] ) 

Icon: Whole number icon code between 0 and 29

ToolTip: String displayed as a ToolTip of the icon (optional)

Description

COL_LICON sets an icon left-aligned in a column.

COL_RICON()

Syntax

COL_RICON( Icon [; ToolTip] ) 

Icon: Whole number icon code between 0 and 29

ToolTip: String displayed as a ToolTip of the icon (optional)

Description

COL_RICON sets an icon right-aligned in a column.

COL_TOOLTIP()

Syntax

COL_TOOLTIP( ToolTip ) 

ToolTip: String displayed as a ToolTip of the column.

Description

COL_TOOLTIP sets a ToolTip for a column. The ToolTip can be entered directly as a string or can be determined using the macro function GET_TEXT (language-dependent), for example.

COL_VISIBLE()

COL_VISIBLE( X ) sets the visibility of a column. If X = 1, the column is visible. If X = 0, the column is not visible. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table. You can apply this function to a column or cell of the planning table. In the attributes of the column or cell, set the Data source to Attributes. This applies to Grid 1. To refer to Grid 2 use X = 20 for read-only, and X = 21 for ready for input. Similarly X = 10 and X = 11 to refer just to GRID 1.

COLUMN_FROM

Syntax

COLUMN_FROM

Description

The COLUMN_FROM function provides the index of the first column of a macro step interval (compare ACT_COLUMN and COLUMN_TO).

COLUMN_MARKED()

COLUMN_MARKED returns the value 1 if the column specified in the argument has been selected. Otherwise the value is 0. In the attributes of the row or cell, set the Data source to Row Attributes.

COLUMN_TO

Syntax

COLUMN_TO

Description

The COLUMN_TO function provides the index of the last column of a macro step interval (compare ACT_COLUMN and COLUMN_FROM).

CURR_CONV_FAC()

CURR_CONV_FAC( 'source currency' ; 'target currency' ; 'exchange rate type' ; DATE ) returns the currency conversion factor for the specified source currency, target currency and exchange rate type on the specified date. This date can be TODAY (that is, the system date) or another (see the functions DATE() and TODAY). TODAY is a function, so you do not need to put it in inverted commas. Example: CURR_CONV_FAC(  'USD' ; 'EUR' ; 'M' ; TODAY ).

DATA_IS_LOCKED

DATA_IS_LOCKED returns the value 1, if the data is locked for the current user, meaning they can edit the data. It returns the value 0, if the data is locked by another user, meaning the current user cannot edit the data.

DISPLAY_CONV_FACTOR()

DISPLAY_CONV_FACTOR (Row) returns the conversion factor between the unit in which the data is stored internally and the unit in which it is displayed for the row. For example, time data may be stored in LiveCache in seconds but it is displayed in the planning table in hours. DISPLAY_CONV_FACTOR would then return 3600 In the attributes of the row or cell, set the Data source to Row Attributes.

EVAL()

EVAL() is an auxiliary function for constructing more complicated functions. EVAL() evaluates the arithmetic expression in the argument so that this result can be used in another function. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table.

Use this function to calculate the argument of other functions at runtime.

For example EVAL ( ( 1 + 2 ) * 3 ) = 9

GET_TEXT()

Syntax

GET_TEXT( TextID [; Language] ) 

TextID: Text ID for identifying the text element to be read.

Language: Parameter for specifying the language (optional)

Description

GET_TEXT returns the language-dependent text of the text element TextID. The text element TextID must exist as a macro text in at least one language.

If you do not specify the language parameter, the text element is read in the logon language. If the text element is not available in the logon language, it is returned in English or in whatever language is available.

If you specify the language parameter, the system first looks for the text element in that language. If the text element is not available in this language, it is returned in English or in whatever language is available.

HELPTAB_CLEAR

HELPTAB_CLEAR initializes the values in the auxiliary table. You can use this function anywhere in a macro. If you wish to initialize the values in the auxiliary table at the beginning of a macro, leave unchecked the macro attribute Do not initialize auxiliary table.

IS_FIXED()

Syntax

IS_FIXED( Key Figure )

Key Figure: Row, column, or cell element (data source = row attributes)

Description

The IS_FIXED function returns the value 1 if the cell is completely fixed. (The column results from the current step iteration; the row is determined by the Key Figure parameter.) If the cell is not fixed or partially fixed, the return value is 0. The function is not available if the compatibility mode is activated for the macro book.

IS_INITIAL()

Syntax

IS_INITIAL( Key Figure )

Key Figure: Row, column, or cell element (data source = row attributes)

Description

The IS_INITIAL function returns the value 1 if the cell is initial. (The column results from the current step iteration; the row is determined by the Key Figure parameter.) Apply this function for key figures that can distinguish between zero values and initial values. This function is not available if the compatibility mode is activated for the macro book.

IS_PARTLY_FIXED()

Syntax

IS_PARTLY_FIXED( Key Figure )

Key Figure: Row, column, or cell element (data source = row attributes)

Description

The IS_PARTLY_FIXED function returns the value 1 if the cell is partially fixed. (The column results from the current step iteration; the row is determined by the Key Figure parameter.) If the cell is not fixed or is completely fixed, the return value is 0. The function is not available if the compatibility mode is activated for the macro book.

MARKED_COLUMN() or

MARKED_COLUMN

MARKED_COLUMN(<'FIRST/LAST'>) returns the column numbers of all marked columns. If 'FIRST' or 'LAST' is included as an argument, the function returns the first or last marked column in the time series. 'FIRST' and 'LAST' are the only possible arguments.

MARKED_PLOB

MARKED_PLOB returns the internal planning object number of the marked rows. Using this number has the advantage in comparison to the row number that this number remains constant irrespective of where the object appears in the grid.

MARKED_ROW() or
MARKED_ROW

MARKED_ROW(<'FIRST/LAST'>) returns the row numbers of all marked rows. If 'FIRST' or 'LAST' is included as an argument, the function returns the first or last marked row. 'FIRST' and 'LAST' are the only possible arguments.

NUM_VALUES_INPUT()

NUM_VALUES_INPUT ( 'dialog_box_description' ;  'field_label_1' ; ... ;  'field_label_n' ) prompts the user to enter n numerical values in a dialog box that appears automatically when this function is executed. As the first argument you specify the text that will appear in the title bar of the dialog box. Write this text in single inverted commas with underscores between each word or use the function STRING_CONCATENATE () . As the other arguments, you specify the field labels for the fields in which the user will enter the numerical values. A maximum of 10 numerical values can be entered. Thus, you can have a maximum of 11 arguments for this function.

NUMBER()

NUMBER( E1 ; ... ; En ) returns the total number of cells in the macro elements E1 through En. E1 through En can be cell(s), row(s), column(s) and/or area(s) from either the planning table or the auxiliary table.
For instance, you can use this function to determine the number of time buckets in the current grid.

OUTPUT_POPUP

OUTPUT_POPUP('dialog_box_description' ;  'field_label_1' ; value in field 1 ; ... ;  'field_label_10' ; value in field 10 ) opens a dialog box that shows the alphanumeric or numerical values of extra fields in the product and/or location master record. A maximum of 10 field values can be displayed in this box.

PLOB_DATA_VISIBLE()

PLOB_DATA_VISIBLE( X; 'planning object'...'planning object n' ) sets the visibility of the specified planning object(s). You use this function if you are working with drill-down in the Details (all) view. If X =1 the planning objects are displayed. If X=0 the planning objects are hidden. Use functions ACT_PLOB, MARKED_PLOB, or KEYFS_PLOB to specify the planning objects.

PLOB_MARKED()

PLOB_MARKED returns the value 1 if the planning object specified in the argument has been selected. Otherwise the value is 0. Use functions ACT_PLOB, MARKED_PLOB, or KEYFS_PLOB to specify the planning objects.

REPORT_SUBMIT()

REPORT_SUBMIT( 'program_name' ;  <'job_name'> ; <'job_number'>; <'newmode'>) causes the specified program to be executed. Use the optional arguments, job name and job number, if you wish the program to run in the background. If you set the argument 'newmode', the results are displayed in a new window.

ROW_BG()

Syntax

ROW_BG( Color [; ToolTip] )

Color: Whole number color code between 0 and 64

ToolTip: String displayed as a ToolTip of the row (optional)

Description

The function ROW_BG set the background color of a row.

ROW_CLEAR()

Syntax

ROW_CLEAR( key figure)

Key figure: Rows of the key figure of the planning area. You can enter the key figure two ways:

     As the internal number of the key figure. This is the position of the key figure in the table on the Key Figure tab page of planning area maintenance

     By including the row as the argument. In this case you must the data source to Row Attributes in the Macro Workbench

Description

ROW_CLEAR() deletes all values of the key figure at aggregate (total) level. The value 0 is then disaggregated to all detail levels. Thus it is sufficient to execute the macro only at aggregate level. Similarly it is sufficient to include the function in a step with only one iteration. 

 

ROW_FG()

Syntax

ROW_FG( Color [; ToolTip] )

Color: Whole number color code between 0 and 64

ToolTip: String displayed as a ToolTip of the row (optional)

Description

The function ROW_FG set the foreground color of a row.

ROW_INPUT()

ROW_INPUT( X ) sets the input status of a row. If X = 1, the status of the cell is set to ready-for-input. If X = 0, the status of the cell is set to read-only. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table. You can apply this function to a row or cell. In the attributes of the row or cell, set the Scope of change to Attributes.

Note: It is not possible to use this function in conjunction with key figure-specific locking and the Do not lock read-only key figures option. For more information, see Structure linkKey Figure Specific Locking.

ROW_LICON()

Syntax

ROW_LICON( Icon [; ToolTip] ) 

Icon: Whole number icon code between 0 and 29

ToolTip: String displayed as a ToolTip of the icon (optional)

Description

The function ROW_LICON sets an icon left-aligned in a row.

ROW_MARKED()

ROW_MARKED returns the value 1 if the row specified in the argument has been selected. Otherwise the value is 0.

ROW_RICON()

Syntax

ROW_RICON( Icon [; ToolTip] ) 

Icon: Whole number icon code between 0 and 29

ToolTip: String displayed as a ToolTip of the icon (optional)

Description

The function ROW_RICON sets an icon right-aligned in a row.

ROW_TOOLTIP()

Syntax

ROW_TOOLTIP( ToolTip ) 

ToolTip: String displayed as a ToolTip of the row

Description

The function ROW_TOOLTIP sets a ToolTip for a row.

ROW_VALUES_CHANGED()

ROW_VALUES_CHANGED( X ) returns 1 if the user has changed one or more values in row X in the current planning session since last pressing Enter. In the attributes of the row, enter Row Attributes as the data source.
Note: Since you generally choose Enter when entering values, SAP recommends that you use macros with this functions as default macros.

ROW_VISIBLE()

ROW_VISIBLE( X ) sets the visibility of a row. If X = 1, the row is visible. If X = 0, the row is not visible. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table. You can apply this function to a row or cell. In the attributes of the row or cell, set the Scope of change to Attributes.

STEP_AREA_SET()

Syntax

STEP_AREA_SET( From-Column ; To-Column ) 

From-column: Column index

To-column: Column index

Description

The STEP_AREA_SET function sets the step interval of all the following macro steps to from-column to to-column. This way, the macro step interval that you defined in the MacroBuilder is overridden. However, the step interval of the macro step in which the STEP_AREA_SET function is called is not changed.

The step interval set by the STEP_AREA_SET function is valid until the end of the macro execution or can be cancelled by calling STEP_AREA_SET( 0 ; 0 ).

STEP_CALC_STOP

Syntax

STEP_CALC_STOP

Description

The STEP_CALC_STOP function leaves a macro step after carrying out the current step iteration. Any assignments and macro functions that exist after calling STEP_CALC_STOP will still be executed.

STRINGS_CONCATENATE()

STRINGS_CONCATENATE('string1'...'stringn') inserts blanks between several character strings to produce one string.

UNIT_CONV_FAC()

UNIT_CONV_FAC( NAME1 ; NAME2 ) returns the conversion factor for conversion from unit NAME1 to unit NAME2. You enter the names of the units in Operator/function dialog boxes; for example, UNIT_CONV_FAC ( KG ; TO ) = 1000.

USER()

USER( NAME ) = 1 if the user name of the person who logged on is NAME; for example, USER( SUCHANEK ) = 1 if the logon name of the planner is Suchanek. Otherwise, USER( SUCHANEK ) = 0. You enter the argument in an Operator/function dialog box.

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.

 

 

 

 

 

Leaving content frame