SAP SWA_CONT_ELEM_CREATE Function Module for
SWA_CONT_ELEM_CREATE is a standard swa cont elem create 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 cont elem create FM, simply by entering the name SWA_CONT_ELEM_CREATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: SWA40
Program Name: SAPLSWA40
Main Program: SAPLSWA40
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SWA_CONT_ELEM_CREATE 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_CONT_ELEM_CREATE'".
EXPORTING
* DEFAULT_ELEMENT_ID = "
* START_IN_POPUP = 'X' "
* LANGUAGE = SY-LANGU "Language of Text
* DEFAULT_ELEMENT_DEF = "
* DEFAULT_TAB = 'TWFD' "
* DISALLOW_STRUCTURES = "
* DISALLOW_TABLES = "
* DISALLOW_BOR = "
* DISALLOW_WORKFLOW = "
* DISALLOW_ELEMENTARY = "
IMPORTING
CREATED = "
NEW_ELEMENT_ID = "
NEW_ELEMENT_DEF = "Attribute of the New Element
CHANGING
* CONTAINER = "Reference to Container Object
EXCEPTIONS
ELEMENT_ALREADY_EXISTS = 1
IMPORTING Parameters details for SWA_CONT_ELEM_CREATE
DEFAULT_ELEMENT_ID -
Data type: SWC_ELEMOptional: Yes
Call by Reference: Yes
START_IN_POPUP -
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: Yes
LANGUAGE - Language of Text
Data type: SYLANGUDefault: SY-LANGU
Optional: Yes
Call by Reference: Yes
DEFAULT_ELEMENT_DEF -
Data type: SWCONTDEFOptional: Yes
Call by Reference: Yes
DEFAULT_TAB -
Data type: SYUCOMMDefault: 'TWFD'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DISALLOW_STRUCTURES -
Data type: XFELDOptional: Yes
Call by Reference: Yes
DISALLOW_TABLES -
Data type: XFELDOptional: Yes
Call by Reference: Yes
DISALLOW_BOR -
Data type: XFELDOptional: Yes
Call by Reference: Yes
DISALLOW_WORKFLOW -
Data type: XFELDOptional: Yes
Call by Reference: Yes
DISALLOW_ELEMENTARY -
Data type: XFELDOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for SWA_CONT_ELEM_CREATE
CREATED -
Data type: XFELDOptional: No
Call by Reference: Yes
NEW_ELEMENT_ID -
Data type: SWC_ELEMOptional: No
Call by Reference: Yes
NEW_ELEMENT_DEF - Attribute of the New Element
Data type: SWCONTDEFOptional: No
Call by Reference: Yes
CHANGING Parameters details for SWA_CONT_ELEM_CREATE
CONTAINER - Reference to Container Object
Data type: CL_WF_CONTAINER_WRAPPEROptional: Yes
Call by Reference: Yes
EXCEPTIONS details
ELEMENT_ALREADY_EXISTS -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for SWA_CONT_ELEM_CREATE 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_created | TYPE XFELD, " | |||
| lv_container | TYPE CL_WF_CONTAINER_WRAPPER, " | |||
| lv_default_element_id | TYPE SWC_ELEM, " | |||
| lv_element_already_exists | TYPE SWC_ELEM, " | |||
| lv_start_in_popup | TYPE XFELD, " 'X' | |||
| lv_language | TYPE SYLANGU, " SY-LANGU | |||
| lv_new_element_id | TYPE SWC_ELEM, " | |||
| lv_new_element_def | TYPE SWCONTDEF, " | |||
| lv_default_element_def | TYPE SWCONTDEF, " | |||
| lv_default_tab | TYPE SYUCOMM, " 'TWFD' | |||
| lv_disallow_structures | TYPE XFELD, " | |||
| lv_disallow_tables | TYPE XFELD, " | |||
| lv_disallow_bor | TYPE XFELD, " | |||
| lv_disallow_workflow | TYPE XFELD, " | |||
| lv_disallow_elementary | TYPE XFELD. " |
|   CALL FUNCTION 'SWA_CONT_ELEM_CREATE' " |
| EXPORTING | ||
| DEFAULT_ELEMENT_ID | = lv_default_element_id | |
| START_IN_POPUP | = lv_start_in_popup | |
| LANGUAGE | = lv_language | |
| DEFAULT_ELEMENT_DEF | = lv_default_element_def | |
| DEFAULT_TAB | = lv_default_tab | |
| DISALLOW_STRUCTURES | = lv_disallow_structures | |
| DISALLOW_TABLES | = lv_disallow_tables | |
| DISALLOW_BOR | = lv_disallow_bor | |
| DISALLOW_WORKFLOW | = lv_disallow_workflow | |
| DISALLOW_ELEMENTARY | = lv_disallow_elementary | |
| IMPORTING | ||
| CREATED | = lv_created | |
| NEW_ELEMENT_ID | = lv_new_element_id | |
| NEW_ELEMENT_DEF | = lv_new_element_def | |
| CHANGING | ||
| CONTAINER | = lv_container | |
| EXCEPTIONS | ||
| ELEMENT_ALREADY_EXISTS = 1 | ||
| . " SWA_CONT_ELEM_CREATE | ||
ABAP code using 7.40 inline data declarations to call FM SWA_CONT_ELEM_CREATE
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_start_in_popup) | = 'X'. | |||
| DATA(ld_language) | = SY-LANGU. | |||
| DATA(ld_default_tab) | = 'TWFD'. | |||
Search for further information about these or an SAP related objects