SAP SWD_GET_WORKFLOW_DEFINITION Function Module for
SWD_GET_WORKFLOW_DEFINITION is a standard swd get workflow definition 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 swd get workflow definition FM, simply by entering the name SWD_GET_WORKFLOW_DEFINITION into the relevant SAP transaction such as SE37 or SE38.
Function Group: SWDA
Program Name: SAPLSWDA
Main Program: SAPLSWDA
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SWD_GET_WORKFLOW_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 'SWD_GET_WORKFLOW_DEFINITION'".
EXPORTING
ACT_WFDKEY = "
* ACT_SOURCE_CLIENT = SY-MANDT "
ACT_OBJECT_EXT = "
* ACT_FILL_BUFFER = 'X' "
* BUFFERED_ACCESS_FORCED = ' ' "
IMPORTING
WFD_HEADER = "
WFD_GLOBAL = "Include Structure for Cross-Version Data
WFD_CONTAINERS = "Container - Implementation of a 'Collection'
WFD_CONTAINER = "Container - Implementation of a 'Collection'
WFD_PROPERTIES = "Properties
WFD_LOCAL_EVENTS = "Local Event
WFD_EVENTS = "Workflow Definition: Table of Events in WF Builder
TABLES
* WFD_TEXT = "
* WFD_CONTTEXT = "
* WFD_FUNCTIONS = "
* WFD_BINDING = "
* WFD_STEPS = "
* WFD_LINES = "
* WFD_METHOD = "
* WFD_CONDITION = "
* WFD_TEMPLATES = "
* WFD_FORMS = "Workflow Definition: Include Structure for Forms
* WFD_TASKS = "Tasks Referenced Directly in Workflow Buffer
EXCEPTIONS
INTERNAL_NOT_FOUND = 1
IMPORTING Parameters details for SWD_GET_WORKFLOW_DEFINITION
ACT_WFDKEY -
Data type: SWD_WFDKEYOptional: No
Call by Reference: Yes
ACT_SOURCE_CLIENT -
Data type: SY-MANDTDefault: SY-MANDT
Optional: Yes
Call by Reference: Yes
ACT_OBJECT_EXT -
Data type: RHOBJECTS-OBJECTOptional: No
Call by Reference: Yes
ACT_FILL_BUFFER -
Data type: SY-INPUTDefault: 'X'
Optional: Yes
Call by Reference: Yes
BUFFERED_ACCESS_FORCED -
Data type: SY-INPUTDefault: SPACE
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for SWD_GET_WORKFLOW_DEFINITION
WFD_HEADER -
Data type: SWD_AHEADOptional: No
Call by Reference: Yes
WFD_GLOBAL - Include Structure for Cross-Version Data
Data type: SWDIGLOBALOptional: No
Call by Reference: Yes
WFD_CONTAINERS - Container - Implementation of a 'Collection'
Data type: SWDTACONTOptional: No
Call by Reference: Yes
WFD_CONTAINER - Container - Implementation of a 'Collection'
Data type: IF_SWF_CNT_CONTAINEROptional: No
Call by Reference: Yes
WFD_PROPERTIES - Properties
Data type: SWDTPROPTSOptional: No
Call by Reference: Yes
WFD_LOCAL_EVENTS - Local Event
Data type: SWDTILOCEVTOptional: No
Call by Reference: Yes
WFD_EVENTS - Workflow Definition: Table of Events in WF Builder
Data type: SWDTIEVNTSOptional: No
Call by Reference: Yes
TABLES Parameters details for SWD_GET_WORKFLOW_DEFINITION
WFD_TEXT -
Data type: SWD_TEXTOptional: Yes
Call by Reference: No ( called with pass by value option)
WFD_CONTTEXT -
Data type: SWD_WFCTXTOptional: Yes
Call by Reference: Yes
WFD_FUNCTIONS -
Data type: SWD_IFUNCSOptional: Yes
Call by Reference: Yes
WFD_BINDING -
Data type: SWD_BINDEFOptional: Yes
Call by Reference: No ( called with pass by value option)
WFD_STEPS -
Data type: SWD_ASTEPOptional: Yes
Call by Reference: No ( called with pass by value option)
WFD_LINES -
Data type: SWD_ALINESOptional: Yes
Call by Reference: No ( called with pass by value option)
WFD_METHOD -
Data type: SWD_IMETHDOptional: Yes
Call by Reference: No ( called with pass by value option)
WFD_CONDITION -
Data type: SWD_CONDEFOptional: Yes
Call by Reference: Yes
WFD_TEMPLATES -
Data type: SWUOPROPOptional: Yes
Call by Reference: Yes
WFD_FORMS - Workflow Definition: Include Structure for Forms
Data type: SWDIFORMSOptional: Yes
Call by Reference: Yes
WFD_TASKS - Tasks Referenced Directly in Workflow Buffer
Data type: SWD_ITASKSOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
INTERNAL_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SWD_GET_WORKFLOW_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: | ||||
| lt_wfd_text | TYPE STANDARD TABLE OF SWD_TEXT, " | |||
| lv_act_wfdkey | TYPE SWD_WFDKEY, " | |||
| lv_wfd_header | TYPE SWD_AHEAD, " | |||
| lv_internal_not_found | TYPE SWD_AHEAD, " | |||
| lt_wfd_conttext | TYPE STANDARD TABLE OF SWD_WFCTXT, " | |||
| lt_wfd_functions | TYPE STANDARD TABLE OF SWD_IFUNCS, " | |||
| lv_wfd_global | TYPE SWDIGLOBAL, " | |||
| lt_wfd_binding | TYPE STANDARD TABLE OF SWD_BINDEF, " | |||
| lv_act_source_client | TYPE SY-MANDT, " SY-MANDT | |||
| lt_wfd_steps | TYPE STANDARD TABLE OF SWD_ASTEP, " | |||
| lv_act_object_ext | TYPE RHOBJECTS-OBJECT, " | |||
| lv_wfd_containers | TYPE SWDTACONT, " | |||
| lt_wfd_lines | TYPE STANDARD TABLE OF SWD_ALINES, " | |||
| lv_wfd_container | TYPE IF_SWF_CNT_CONTAINER, " | |||
| lv_act_fill_buffer | TYPE SY-INPUT, " 'X' | |||
| lt_wfd_method | TYPE STANDARD TABLE OF SWD_IMETHD, " | |||
| lv_wfd_properties | TYPE SWDTPROPTS, " | |||
| lv_buffered_access_forced | TYPE SY-INPUT, " SPACE | |||
| lt_wfd_condition | TYPE STANDARD TABLE OF SWD_CONDEF, " | |||
| lv_wfd_local_events | TYPE SWDTILOCEVT, " | |||
| lv_wfd_events | TYPE SWDTIEVNTS, " | |||
| lt_wfd_templates | TYPE STANDARD TABLE OF SWUOPROP, " | |||
| lt_wfd_forms | TYPE STANDARD TABLE OF SWDIFORMS, " | |||
| lt_wfd_tasks | TYPE STANDARD TABLE OF SWD_ITASKS. " |
|   CALL FUNCTION 'SWD_GET_WORKFLOW_DEFINITION' " |
| EXPORTING | ||
| ACT_WFDKEY | = lv_act_wfdkey | |
| ACT_SOURCE_CLIENT | = lv_act_source_client | |
| ACT_OBJECT_EXT | = lv_act_object_ext | |
| ACT_FILL_BUFFER | = lv_act_fill_buffer | |
| BUFFERED_ACCESS_FORCED | = lv_buffered_access_forced | |
| IMPORTING | ||
| WFD_HEADER | = lv_wfd_header | |
| WFD_GLOBAL | = lv_wfd_global | |
| WFD_CONTAINERS | = lv_wfd_containers | |
| WFD_CONTAINER | = lv_wfd_container | |
| WFD_PROPERTIES | = lv_wfd_properties | |
| WFD_LOCAL_EVENTS | = lv_wfd_local_events | |
| WFD_EVENTS | = lv_wfd_events | |
| TABLES | ||
| WFD_TEXT | = lt_wfd_text | |
| WFD_CONTTEXT | = lt_wfd_conttext | |
| WFD_FUNCTIONS | = lt_wfd_functions | |
| WFD_BINDING | = lt_wfd_binding | |
| WFD_STEPS | = lt_wfd_steps | |
| WFD_LINES | = lt_wfd_lines | |
| WFD_METHOD | = lt_wfd_method | |
| WFD_CONDITION | = lt_wfd_condition | |
| WFD_TEMPLATES | = lt_wfd_templates | |
| WFD_FORMS | = lt_wfd_forms | |
| WFD_TASKS | = lt_wfd_tasks | |
| EXCEPTIONS | ||
| INTERNAL_NOT_FOUND = 1 | ||
| . " SWD_GET_WORKFLOW_DEFINITION | ||
ABAP code using 7.40 inline data declarations to call FM SWD_GET_WORKFLOW_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 MANDT FROM SY INTO @DATA(ld_act_source_client). | ||||
| DATA(ld_act_source_client) | = SY-MANDT. | |||
| "SELECT single OBJECT FROM RHOBJECTS INTO @DATA(ld_act_object_ext). | ||||
| "SELECT single INPUT FROM SY INTO @DATA(ld_act_fill_buffer). | ||||
| DATA(ld_act_fill_buffer) | = 'X'. | |||
| "SELECT single INPUT FROM SY INTO @DATA(ld_buffered_access_forced). | ||||
| DATA(ld_buffered_access_forced) | = ' '. | |||
Search for further information about these or an SAP related objects