Ansicht
Dokumentation

/SAPPSSRM/STRING_VAR_PARSER - Parses text and substitutes variables with values

/SAPPSSRM/STRING_VAR_PARSER - Parses text and substitutes variables with values

General Data in Customer Master   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

You can use this function module to substitute pseudo variables in strings with actual parameters. This can be useful if you use text symbols in a report.

Up to now, when you wanted to use values within text symbols, you had to divide the text into several text symbols and concatenate the text symbols and the values afterwards in the source code.

With this function module you can include the whole string, including variables (for example "&1") in one text symbol. This makes it easier to maintain text symbols and allows translators to rearrange the sentence construction for other languages.

Note: Neither the sequence of the variables nor the frequency how often the same variable is used plays any role.

Example

Text symbol 100:

The example no. &1 saves the company &2 &3 per year.

Calling the function:

DATA: lv_string TYPE string.

CALL FUNCTION 'Z_TEXT_SYMBOL_VAR_PARSER'

EXPORTING

orig_text_symbol = text-100

var1 = '42'

var2 = 'USD'

var3 = '100000'

IMPORTING

text_with_values = lv_string.

WRITE /: lv_string.

Result:

The example no. 42 saves the company USD 100000 per year.

Notes

Further information





Parameters

ORIG_TEXT_SYMBOL
TEXT_WITH_VALUES
VAR1
VAR2
VAR3
VAR4
VAR5
VAR6
VAR7
VAR8
VAR9

Exceptions

Function Group

PSSRM/SAPLOBSOLETE

PERFORM Short Reference   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 1813 Date: 20240418 Time: 152907     sap01-206 ( 33 ms )