SAP SWA_EXPR_ATTRIB_GET Function Module for









SWA_EXPR_ATTRIB_GET is a standard swa expr attrib get SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 swa expr attrib get FM, simply by entering the name SWA_EXPR_ATTRIB_GET into the relevant SAP transaction such as SE37 or SE38.

Function Group: SWA2
Program Name: SAPLSWA2
Main Program: SAPLSWA2
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function SWA_EXPR_ATTRIB_GET 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 'SWA_EXPR_ATTRIB_GET'"
EXPORTING
* EXPRTYPE = "
EXPRESSION = "Expression
* CONSTANTREFERENCE = "Reference to constant
* CONSTANTVALUE_IS_' ' = ' ' "
* GET_COMPONENT_DESCRIPTIONS = ' ' "
* CONTAINER_IF = "Container - Implementation of a 'Collection'

IMPORTING
EXPRESSION_ATTRIB = "Attributes of expression
EXPRESSION_TYPE = "
EXPRESSION_REFTYPE = "
EXPRESSION_DESCRIPT = "Description of variable
EXPRESSION_SHORTTEXT = "Comprehensive description
EXPRESSION_EDITELEM = "

TABLES
* CONTDEF = "Container definition
* ELEMENT_LST = "
* DESCRIPTION_LST = "

EXCEPTIONS
SYNTAX_ERROR = 1
.



IMPORTING Parameters details for SWA_EXPR_ATTRIB_GET

EXPRTYPE -

Data type: SWAEXPTYPE-EXPRTYPE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPRESSION - Expression

Data type: SWAEXPDEF-EXPR
Optional: No
Call by Reference: No ( called with pass by value option)

CONSTANTREFERENCE - Reference to constant

Data type: SWAEXPREF
Optional: Yes
Call by Reference: No ( called with pass by value option)

CONSTANTVALUE_IS_SPACE -

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

GET_COMPONENT_DESCRIPTIONS -

Data type: XFELD
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

CONTAINER_IF - Container - Implementation of a 'Collection'

Data type: IF_SWF_CNT_CONTAINER
Optional: Yes
Call by Reference: Yes

EXPORTING Parameters details for SWA_EXPR_ATTRIB_GET

EXPRESSION_ATTRIB - Attributes of expression

Data type: SWAEXPDEF
Optional: No
Call by Reference: No ( called with pass by value option)

EXPRESSION_TYPE -

Data type: SWAEXPTYPE-EXPRTYPE
Optional: No
Call by Reference: No ( called with pass by value option)

EXPRESSION_REFTYPE -

Data type: SWAEXPDEF-REFTYPE
Optional: No
Call by Reference: No ( called with pass by value option)

EXPRESSION_DESCRIPT - Description of variable

Data type: SWCONTDEF-DESCRIPT
Optional: No
Call by Reference: No ( called with pass by value option)

EXPRESSION_SHORTTEXT - Comprehensive description

Data type: SWCONTDEF-SHORTTEXT
Optional: No
Call by Reference: No ( called with pass by value option)

EXPRESSION_EDITELEM -

Data type: SWCONTDEF-EDITELEM
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for SWA_EXPR_ATTRIB_GET

CONTDEF - Container definition

Data type: SWCONTDEF
Optional: Yes
Call by Reference: Yes

ELEMENT_LST -

Data type: SWA_ELEM
Optional: Yes
Call by Reference: No ( called with pass by value option)

DESCRIPTION_LST -

Data type: SWA_NAMES
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

SYNTAX_ERROR - Syntax error in expression

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for SWA_EXPR_ATTRIB_GET 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:
lt_contdef  TYPE STANDARD TABLE OF SWCONTDEF, "   
lv_exprtype  TYPE SWAEXPTYPE-EXPRTYPE, "   
lv_syntax_error  TYPE SWAEXPTYPE, "   
lv_expression_attrib  TYPE SWAEXPDEF, "   
lv_expression  TYPE SWAEXPDEF-EXPR, "   
lt_element_lst  TYPE STANDARD TABLE OF SWA_ELEM, "   
lv_expression_type  TYPE SWAEXPTYPE-EXPRTYPE, "   
lt_description_lst  TYPE STANDARD TABLE OF SWA_NAMES, "   
lv_constantreference  TYPE SWAEXPREF, "   
lv_expression_reftype  TYPE SWAEXPDEF-REFTYPE, "   
lv_expression_descript  TYPE SWCONTDEF-DESCRIPT, "   
lv_constantvalue_is_space  TYPE SWCONTDEF, "   SPACE
lv_expression_shorttext  TYPE SWCONTDEF-SHORTTEXT, "   
lv_get_component_descriptions  TYPE XFELD, "   SPACE
lv_container_if  TYPE IF_SWF_CNT_CONTAINER, "   
lv_expression_editelem  TYPE SWCONTDEF-EDITELEM. "   

  CALL FUNCTION 'SWA_EXPR_ATTRIB_GET'  "
    EXPORTING
         EXPRTYPE = lv_exprtype
         EXPRESSION = lv_expression
         CONSTANTREFERENCE = lv_constantreference
         CONSTANTVALUE_IS_SPACE = lv_constantvalue_is_space
         GET_COMPONENT_DESCRIPTIONS = lv_get_component_descriptions
         CONTAINER_IF = lv_container_if
    IMPORTING
         EXPRESSION_ATTRIB = lv_expression_attrib
         EXPRESSION_TYPE = lv_expression_type
         EXPRESSION_REFTYPE = lv_expression_reftype
         EXPRESSION_DESCRIPT = lv_expression_descript
         EXPRESSION_SHORTTEXT = lv_expression_shorttext
         EXPRESSION_EDITELEM = lv_expression_editelem
    TABLES
         CONTDEF = lt_contdef
         ELEMENT_LST = lt_element_lst
         DESCRIPTION_LST = lt_description_lst
    EXCEPTIONS
        SYNTAX_ERROR = 1
. " SWA_EXPR_ATTRIB_GET




ABAP code using 7.40 inline data declarations to call FM SWA_EXPR_ATTRIB_GET

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 EXPRTYPE FROM SWAEXPTYPE INTO @DATA(ld_exprtype).
 
 
 
"SELECT single EXPR FROM SWAEXPDEF INTO @DATA(ld_expression).
 
 
"SELECT single EXPRTYPE FROM SWAEXPTYPE INTO @DATA(ld_expression_type).
 
 
 
"SELECT single REFTYPE FROM SWAEXPDEF INTO @DATA(ld_expression_reftype).
 
"SELECT single DESCRIPT FROM SWCONTDEF INTO @DATA(ld_expression_descript).
 
DATA(ld_constantvalue_is_space) = ' '.
 
"SELECT single SHORTTEXT FROM SWCONTDEF INTO @DATA(ld_expression_shorttext).
 
DATA(ld_get_component_descriptions) = ' '.
 
 
"SELECT single EDITELEM FROM SWCONTDEF INTO @DATA(ld_expression_editelem).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!