Description
This command will show the result of a formula, just like a calculator. Formulas can contain a number of different variables that are derived from system settings and properties.
Syntax
calc <formula> = <formula>
Supported Variables
The calc command supports the following variables:
Variable | Description |
---|---|
YEAR, MONTH, DAY | Current year, month, day (based on system date) |
HOUR, MINUTE, SECOND | Current hour, minute, second (based on system time) |
DB, DB_RELEASE, DB_PATCH | Database version (full string), release, patch |
DBSL_RELEASE, DBSL_PATCH | DBSL release, patch |
HANA, HANA_RELEASE, HANA_SP, HANA_REVISION, HANA_PATCH | SAP HANA version (full string), release, support package, revision, patch |
SPAM_RELEASE, SPAM_VERSION | SPAM release, version |
KERNEL, KERNEL_RELEASE, KERNEL_PATCH, KERNEL_BITS | SAP Kernel version (full string), release, patch, bits (32/64) |
UNICODE | Unicode (1), non-Unicode (0) |
SYST-<field>, SY-<field> | Value of System Field |
<component> | Release of Software Component |
<component>_SP | Support Package of Software Component |
<profile_parameter> | Value of System Profile Parameter* |
* If you want to use a profile parameter in a formula beyond just querying its value, then you must replace any slash ‘/’ in the parameter name with an underscore ‘_’.
Examples
- Calculate 7 * 11 * 13:
calc 7*11*13 - Display current date:
= sy-datum - Show version of SAP HANA:
= HANA - Display number of dialog processes:
= rdisp/wp_no_dia - Show setting for transport directory:
= DIR_TRANS - Get the support package for SAP_BW:
= SAP_BW_SP
Technical Details
The command determines the result using the following logic:
- If the formula consists of a single system variable and property, its value is displayed immediately.
Note: With the exception ofSYST
fields, the variables and properties listed above are determined by Marc Bernard Tools. - If the formula consists of a boolean expression, standard function module
EVAL_FORMULA
is called returning either TRUE or FALSE. - Otherwise, standard function module
EVAL_FORMULA
is called to calculate the result of the formula.
For more details, see the documentation of function module EVAL_FORMULA
in transaction SE37.