SAP SWA_EXPR_EDIT Function Module for









SWA_EXPR_EDIT is a standard swa expr edit 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 edit FM, simply by entering the name SWA_EXPR_EDIT 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_EDIT 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_EDIT'"
EXPORTING
* CONDESCR = ' ' "ID of container
* EXPRESSION_NAME = "
* CONSTANTS_NAME = "
* SYSTFIELDS_NAME = "
* CONTAINER_NAME = "
* CONTAINER_IF = "Container - Implementation of a 'Collection'
* CONKEYWORD = ' ' "Key word of container
* DISPLAY = 'X' "Display/change
* EXPDESCR = ' ' "Expression description
EXPRESSIONTYPE = "Expression type
EXPRESSION_IN = "Reference of expression
* LOOPELEMENT = ' ' "Container element which allows a loop index
* REFERENCE_IN = ' ' "Reference of expression
* POPUP_HEADLINE = "Popup header line

IMPORTING
ERRORCOUNT = "
EXPRESSION_ATTRIB = "Reference of expression
EXPRESSION_OUT = "Reference of expression
CONST_DISPLAY = "

TABLES
* CONTDEF = "Container definition
* EXERROR = "Messages

EXCEPTIONS
PARAMETER_ERROR = 1 UNGUILTY_EXPRESSIONTYPE = 2
.



IMPORTING Parameters details for SWA_EXPR_EDIT

CONDESCR - ID of container

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

EXPRESSION_NAME -

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

CONSTANTS_NAME -

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

SYSTFIELDS_NAME -

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

CONTAINER_NAME -

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

CONTAINER_IF - Container - Implementation of a 'Collection'

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

CONKEYWORD - Key word of container

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

DISPLAY - Display/change

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

EXPDESCR - Expression description

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

EXPRESSIONTYPE - Expression type

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

EXPRESSION_IN - Reference of expression

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

LOOPELEMENT - Container element which allows a loop index

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

REFERENCE_IN - Reference of expression

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

POPUP_HEADLINE - Popup header line

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

EXPORTING Parameters details for SWA_EXPR_EDIT

ERRORCOUNT -

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

EXPRESSION_ATTRIB - Reference of expression

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

EXPRESSION_OUT - Reference of expression

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

CONST_DISPLAY -

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

TABLES Parameters details for SWA_EXPR_EDIT

CONTDEF - Container definition

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

EXERROR - Messages

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

EXCEPTIONS details

PARAMETER_ERROR -

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

UNGUILTY_EXPRESSIONTYPE -

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

Copy and paste ABAP code example for SWA_EXPR_EDIT 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_condescr  TYPE SWAEXPEDIT-CONDESCR, "   SPACE
lv_errorcount  TYPE SWAEXPEDIT-ERRORCOUNT, "   
lv_parameter_error  TYPE SWAEXPEDIT, "   
lv_expression_name  TYPE STRING, "   
lv_constants_name  TYPE STRING, "   
lv_systfields_name  TYPE STRING, "   
lv_container_name  TYPE STRING, "   
lv_container_if  TYPE IF_SWF_CNT_CONTAINER, "   
lt_exerror  TYPE STANDARD TABLE OF SWAEXERROR, "   
lv_conkeyword  TYPE SWAEXPEDIT-CONKEYWORD, "   SPACE
lv_expression_attrib  TYPE SWAEXPDEF, "   
lv_unguilty_expressiontype  TYPE SWAEXPDEF, "   
lv_display  TYPE SWAEXPDEF, "   'X'
lv_expression_out  TYPE SWAEXPDEF-EXPR, "   
lv_expdescr  TYPE SWAEXPEDIT-DESCR, "   SPACE
lv_const_display  TYPE SWCONT-VALUE, "   
lv_expressiontype  TYPE SWAEXPEDIT-EXPRTYPE, "   
lv_expression_in  TYPE SWAEXPDEF-EXPR, "   
lv_loopelement  TYPE SWCONTDEF-ELEMENT, "   SPACE
lv_reference_in  TYPE SWAEXPREF, "   SPACE
lv_popup_headline  TYPE STRING. "   

  CALL FUNCTION 'SWA_EXPR_EDIT'  "
    EXPORTING
         CONDESCR = lv_condescr
         EXPRESSION_NAME = lv_expression_name
         CONSTANTS_NAME = lv_constants_name
         SYSTFIELDS_NAME = lv_systfields_name
         CONTAINER_NAME = lv_container_name
         CONTAINER_IF = lv_container_if
         CONKEYWORD = lv_conkeyword
         DISPLAY = lv_display
         EXPDESCR = lv_expdescr
         EXPRESSIONTYPE = lv_expressiontype
         EXPRESSION_IN = lv_expression_in
         LOOPELEMENT = lv_loopelement
         REFERENCE_IN = lv_reference_in
         POPUP_HEADLINE = lv_popup_headline
    IMPORTING
         ERRORCOUNT = lv_errorcount
         EXPRESSION_ATTRIB = lv_expression_attrib
         EXPRESSION_OUT = lv_expression_out
         CONST_DISPLAY = lv_const_display
    TABLES
         CONTDEF = lt_contdef
         EXERROR = lt_exerror
    EXCEPTIONS
        PARAMETER_ERROR = 1
        UNGUILTY_EXPRESSIONTYPE = 2
. " SWA_EXPR_EDIT




ABAP code using 7.40 inline data declarations to call FM SWA_EXPR_EDIT

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 CONDESCR FROM SWAEXPEDIT INTO @DATA(ld_condescr).
DATA(ld_condescr) = ' '.
 
"SELECT single ERRORCOUNT FROM SWAEXPEDIT INTO @DATA(ld_errorcount).
 
 
 
 
 
 
 
 
"SELECT single CONKEYWORD FROM SWAEXPEDIT INTO @DATA(ld_conkeyword).
DATA(ld_conkeyword) = ' '.
 
 
 
DATA(ld_display) = 'X'.
 
"SELECT single EXPR FROM SWAEXPDEF INTO @DATA(ld_expression_out).
 
"SELECT single DESCR FROM SWAEXPEDIT INTO @DATA(ld_expdescr).
DATA(ld_expdescr) = ' '.
 
"SELECT single VALUE FROM SWCONT INTO @DATA(ld_const_display).
 
"SELECT single EXPRTYPE FROM SWAEXPEDIT INTO @DATA(ld_expressiontype).
 
"SELECT single EXPR FROM SWAEXPDEF INTO @DATA(ld_expression_in).
 
"SELECT single ELEMENT FROM SWCONTDEF INTO @DATA(ld_loopelement).
DATA(ld_loopelement) = ' '.
 
DATA(ld_reference_in) = ' '.
 
 


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!