SAP SAPSCRIPT_SYMBOL_DEFINITION Function Module for SAPscript: Display definition of a symbol in the print program
SAPSCRIPT_SYMBOL_DEFINITION is a standard sapscript symbol definition SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for SAPscript: Display definition of a symbol in the print program processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for sapscript symbol definition FM, simply by entering the name SAPSCRIPT_SYMBOL_DEFINITION into the relevant SAP transaction such as SE37 or SE38.
Function Group: STX4
Program Name: SAPLSTX4
Main Program:
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SAPSCRIPT_SYMBOL_DEFINITION pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'SAPSCRIPT_SYMBOL_DEFINITION'"SAPscript: Display definition of a symbol in the print program.
EXPORTING
LINE_CONTENTS = "
* CURSOR_POSITION = 2 "Position of Cursor
LAYOUT_SET = "Form name
* DIALOG = 'X' "
* LINE_EDITOR = ' ' "
EXCEPTIONS
NO_SYMBOL_IN_LINE = 1 CURSOR_BEFORE_FIRST_SYMBOL = 2 CURSOR_NOT_ON_SYMBOL = 3 NOT_EXECUTED = 4
IMPORTING Parameters details for SAPSCRIPT_SYMBOL_DEFINITION
LINE_CONTENTS -
Data type: TLINEOptional: No
Call by Reference: No ( called with pass by value option)
CURSOR_POSITION - Position of Cursor
Data type: SY-FDPOSDefault: 2
Optional: Yes
Call by Reference: No ( called with pass by value option)
LAYOUT_SET - Form name
Data type: RSTXC-TDFORMOptional: No
Call by Reference: No ( called with pass by value option)
DIALOG -
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
LINE_EDITOR -
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_SYMBOL_IN_LINE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CURSOR_BEFORE_FIRST_SYMBOL -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CURSOR_NOT_ON_SYMBOL -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_EXECUTED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SAPSCRIPT_SYMBOL_DEFINITION Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_line_contents | TYPE TLINE, " | |||
| lv_no_symbol_in_line | TYPE TLINE, " | |||
| lv_cursor_position | TYPE SY-FDPOS, " 2 | |||
| lv_cursor_before_first_symbol | TYPE SY, " | |||
| lv_layout_set | TYPE RSTXC-TDFORM, " | |||
| lv_cursor_not_on_symbol | TYPE RSTXC, " | |||
| lv_dialog | TYPE C, " 'X' | |||
| lv_not_executed | TYPE C, " | |||
| lv_line_editor | TYPE C. " SPACE |
|   CALL FUNCTION 'SAPSCRIPT_SYMBOL_DEFINITION' "SAPscript: Display definition of a symbol in the print program |
| EXPORTING | ||
| LINE_CONTENTS | = lv_line_contents | |
| CURSOR_POSITION | = lv_cursor_position | |
| LAYOUT_SET | = lv_layout_set | |
| DIALOG | = lv_dialog | |
| LINE_EDITOR | = lv_line_editor | |
| EXCEPTIONS | ||
| NO_SYMBOL_IN_LINE = 1 | ||
| CURSOR_BEFORE_FIRST_SYMBOL = 2 | ||
| CURSOR_NOT_ON_SYMBOL = 3 | ||
| NOT_EXECUTED = 4 | ||
| . " SAPSCRIPT_SYMBOL_DEFINITION | ||
ABAP code using 7.40 inline data declarations to call FM SAPSCRIPT_SYMBOL_DEFINITION
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single FDPOS FROM SY INTO @DATA(ld_cursor_position). | ||||
| DATA(ld_cursor_position) | = 2. | |||
| "SELECT single TDFORM FROM RSTXC INTO @DATA(ld_layout_set). | ||||
| DATA(ld_dialog) | = 'X'. | |||
| DATA(ld_line_editor) | = ' '. | |||
Search for further information about these or an SAP related objects