SAP Function Modules

SWD_WF_DEFINITION_READ SAP Function module







SWD_WF_DEFINITION_READ is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name SWD_WF_DEFINITION_READ into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SWDE
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM SWD_WF_DEFINITION_READ - SWD WF DEFINITION READ





CALL FUNCTION 'SWD_WF_DEFINITION_READ' "
  EXPORTING
    task =                      " swd_ahead-task
    wfdkey =                    " swd_wfdkey    Structure with key fields
  IMPORTING
    header =                    " swd_shead     Workflow definition: Basic data (runtime+definition)
    properties =                " swdtspropts   Runtime Table: Attributes
    local_events =              " swdtslevnts
* TABLES
*   steps =                     " swd_ssteps
*   nodes =                     " swd_snodes
*   lines =                     " swd_slines
*   bindings =                  " swd_sbind     Binding definitions
*   conditions =                " swd_condef
*   methods =                   " swd_smetho    Workflow definition: Secondary methods (runtime+definition)
*   events =                    " swd_sevnts    Workflow Definition: Include Structure for Nodes (Runtime)
*   functions =                 " swd_sfuncs
  EXCEPTIONS
    DEFINITION_NOT_FOUND = 1    "               No workflow def. available for reference date
    .  "  SWD_WF_DEFINITION_READ

ABAP code example for Function Module SWD_WF_DEFINITION_READ





The ABAP code below is a full code listing to execute function module SWD_WF_DEFINITION_READ including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_header  TYPE SWD_SHEAD ,
ld_properties  TYPE SWDTSPROPTS ,
ld_local_events  TYPE SWDTSLEVNTS ,
it_steps  TYPE STANDARD TABLE OF SWD_SSTEPS,"TABLES PARAM
wa_steps  LIKE LINE OF it_steps ,
it_nodes  TYPE STANDARD TABLE OF SWD_SNODES,"TABLES PARAM
wa_nodes  LIKE LINE OF it_nodes ,
it_lines  TYPE STANDARD TABLE OF SWD_SLINES,"TABLES PARAM
wa_lines  LIKE LINE OF it_lines ,
it_bindings  TYPE STANDARD TABLE OF SWD_SBIND,"TABLES PARAM
wa_bindings  LIKE LINE OF it_bindings ,
it_conditions  TYPE STANDARD TABLE OF SWD_CONDEF,"TABLES PARAM
wa_conditions  LIKE LINE OF it_conditions ,
it_methods  TYPE STANDARD TABLE OF SWD_SMETHO,"TABLES PARAM
wa_methods  LIKE LINE OF it_methods ,
it_events  TYPE STANDARD TABLE OF SWD_SEVNTS,"TABLES PARAM
wa_events  LIKE LINE OF it_events ,
it_functions  TYPE STANDARD TABLE OF SWD_SFUNCS,"TABLES PARAM
wa_functions  LIKE LINE OF it_functions .


DATA(ld_task) = some text here
DATA(ld_wfdkey) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_steps to it_steps.

"populate fields of struture and append to itab
append wa_nodes to it_nodes.

"populate fields of struture and append to itab
append wa_lines to it_lines.

"populate fields of struture and append to itab
append wa_bindings to it_bindings.

"populate fields of struture and append to itab
append wa_conditions to it_conditions.

"populate fields of struture and append to itab
append wa_methods to it_methods.

"populate fields of struture and append to itab
append wa_events to it_events.

"populate fields of struture and append to itab
append wa_functions to it_functions. . CALL FUNCTION 'SWD_WF_DEFINITION_READ' EXPORTING task = ld_task wfdkey = ld_wfdkey IMPORTING header = ld_header properties = ld_properties local_events = ld_local_events * TABLES * steps = it_steps * nodes = it_nodes * lines = it_lines * bindings = it_bindings * conditions = it_conditions * methods = it_methods * events = it_events * functions = it_functions EXCEPTIONS DEFINITION_NOT_FOUND = 1 . " SWD_WF_DEFINITION_READ
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_header  TYPE SWD_SHEAD ,
ld_task  TYPE SWD_AHEAD-TASK ,
it_steps  TYPE STANDARD TABLE OF SWD_SSTEPS ,
wa_steps  LIKE LINE OF it_steps,
ld_properties  TYPE SWDTSPROPTS ,
ld_wfdkey  TYPE SWD_WFDKEY ,
it_nodes  TYPE STANDARD TABLE OF SWD_SNODES ,
wa_nodes  LIKE LINE OF it_nodes,
ld_local_events  TYPE SWDTSLEVNTS ,
it_lines  TYPE STANDARD TABLE OF SWD_SLINES ,
wa_lines  LIKE LINE OF it_lines,
it_bindings  TYPE STANDARD TABLE OF SWD_SBIND ,
wa_bindings  LIKE LINE OF it_bindings,
it_conditions  TYPE STANDARD TABLE OF SWD_CONDEF ,
wa_conditions  LIKE LINE OF it_conditions,
it_methods  TYPE STANDARD TABLE OF SWD_SMETHO ,
wa_methods  LIKE LINE OF it_methods,
it_events  TYPE STANDARD TABLE OF SWD_SEVNTS ,
wa_events  LIKE LINE OF it_events,
it_functions  TYPE STANDARD TABLE OF SWD_SFUNCS ,
wa_functions  LIKE LINE OF it_functions.


ld_task = some text here

"populate fields of struture and append to itab
append wa_steps to it_steps.
ld_wfdkey = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_nodes to it_nodes.

"populate fields of struture and append to itab
append wa_lines to it_lines.

"populate fields of struture and append to itab
append wa_bindings to it_bindings.

"populate fields of struture and append to itab
append wa_conditions to it_conditions.

"populate fields of struture and append to itab
append wa_methods to it_methods.

"populate fields of struture and append to itab
append wa_events to it_events.

"populate fields of struture and append to itab
append wa_functions to it_functions.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name SWD_WF_DEFINITION_READ or its description.