SAP SWA_ELEMENT_GET_ATTRIBUTES Function Module for









SWA_ELEMENT_GET_ATTRIBUTES is a standard swa element get attributes 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 element get attributes FM, simply by entering the name SWA_ELEMENT_GET_ATTRIBUTES into the relevant SAP transaction such as SE37 or SE38.

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



Function SWA_ELEMENT_GET_ATTRIBUTES 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_ELEMENT_GET_ATTRIBUTES'"
EXPORTING
* ELEMENTNAME = "
* ELEMENT_REFERENCE = "
* SUBLEVELS = 1 "

TABLES
* INPUT_REFERENCE_CONTAINER = "
OUTPUT_ATTRIBUTE_LIST = "

EXCEPTIONS
INVALID_BOR_OBJECTTYPE = 1 INVALID_CLASSNAME = 2 INVALID_DDIC_REFERENCE = 3 ELEMENT_NOT_IN_CONTAINER = 4 NO_VALID_REFERENCE = 5
.



IMPORTING Parameters details for SWA_ELEMENT_GET_ATTRIBUTES

ELEMENTNAME -

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

ELEMENT_REFERENCE -

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

SUBLEVELS -

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

TABLES Parameters details for SWA_ELEMENT_GET_ATTRIBUTES

INPUT_REFERENCE_CONTAINER -

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

OUTPUT_ATTRIBUTE_LIST -

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

EXCEPTIONS details

INVALID_BOR_OBJECTTYPE -

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

INVALID_CLASSNAME -

Data type:
Optional: No
Call by Reference: Yes

INVALID_DDIC_REFERENCE -

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

ELEMENT_NOT_IN_CONTAINER -

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

NO_VALID_REFERENCE -

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

Copy and paste ABAP code example for SWA_ELEMENT_GET_ATTRIBUTES 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_elementname  TYPE SWC_ELEM, "   
lv_invalid_bor_objecttype  TYPE SWC_ELEM, "   
lt_input_reference_container  TYPE STANDARD TABLE OF SWCONTDEF, "   
lv_element_reference  TYPE SWAEXPREF, "   
lv_invalid_classname  TYPE SWAEXPREF, "   
lt_output_attribute_list  TYPE STANDARD TABLE OF SWCONTDEF, "   
lv_sublevels  TYPE INT4, "   1
lv_invalid_ddic_reference  TYPE INT4, "   
lv_element_not_in_container  TYPE INT4, "   
lv_no_valid_reference  TYPE INT4. "   

  CALL FUNCTION 'SWA_ELEMENT_GET_ATTRIBUTES'  "
    EXPORTING
         ELEMENTNAME = lv_elementname
         ELEMENT_REFERENCE = lv_element_reference
         SUBLEVELS = lv_sublevels
    TABLES
         INPUT_REFERENCE_CONTAINER = lt_input_reference_container
         OUTPUT_ATTRIBUTE_LIST = lt_output_attribute_list
    EXCEPTIONS
        INVALID_BOR_OBJECTTYPE = 1
        INVALID_CLASSNAME = 2
        INVALID_DDIC_REFERENCE = 3
        ELEMENT_NOT_IN_CONTAINER = 4
        NO_VALID_REFERENCE = 5
. " SWA_ELEMENT_GET_ATTRIBUTES




ABAP code using 7.40 inline data declarations to call FM SWA_ELEMENT_GET_ATTRIBUTES

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.

 
 
 
 
 
 
DATA(ld_sublevels) = 1.
 
 
 
 


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!