SAP Function Modules

SWD_HEADER_SET SAP Function module







SWD_HEADER_SET 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_HEADER_SET into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM SWD_HEADER_SET - SWD HEADER SET





CALL FUNCTION 'SWD_HEADER_SET' "
* EXPORTING
*   head =                      " swd_ahead
*   global =                    " swdiglobal    Include Structure for Cross-Version Data
*   starting_events =           " swdtstevts
*   wi_text =                   " sww_witext    Work Item Text
*   release_state =             " tskrelstat    Release status of task
*   sapphone =                  " sp_sphable    SAPphone: Flag 'Suitable for SAPphone' (4 values'ยด)
*   properties =                " swdtipropts   Properties
*   local_events =              " swdtilocevt   Local Event
*   events =                    " swdtievnts    Workflow Definition: Table of Events in WF Builder
* TABLES
*   binding =                   " swd_stbind    Workflow Definition: Binding for Steps (Temporary)
*   text_description =          " tline         SAPscript: Text Lines
*   text_notification =         " tline         SAPscript: Text Lines
*   text_deadline_latest_end =   " tline        SAPscript: Text Lines
*   text_deadline_latest_start =   " tline      SAPscript: Text Lines
*   text_deadline_desired_end =   " tline       SAPscript: Text Lines
*   functions =                 " swd_ifuncs    Functions
*   tasks =                     " swd_itasks    Tasks Referenced Directly in Workflow Buffer
    .  "  SWD_HEADER_SET

ABAP code example for Function Module SWD_HEADER_SET





The ABAP code below is a full code listing to execute function module SWD_HEADER_SET 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:
it_binding  TYPE STANDARD TABLE OF SWD_STBIND,"TABLES PARAM
wa_binding  LIKE LINE OF it_binding ,
it_text_description  TYPE STANDARD TABLE OF TLINE,"TABLES PARAM
wa_text_description  LIKE LINE OF it_text_description ,
it_text_notification  TYPE STANDARD TABLE OF TLINE,"TABLES PARAM
wa_text_notification  LIKE LINE OF it_text_notification ,
it_text_deadline_latest_end  TYPE STANDARD TABLE OF TLINE,"TABLES PARAM
wa_text_deadline_latest_end  LIKE LINE OF it_text_deadline_latest_end ,
it_text_deadline_latest_start  TYPE STANDARD TABLE OF TLINE,"TABLES PARAM
wa_text_deadline_latest_start  LIKE LINE OF it_text_deadline_latest_start ,
it_text_deadline_desired_end  TYPE STANDARD TABLE OF TLINE,"TABLES PARAM
wa_text_deadline_desired_end  LIKE LINE OF it_text_deadline_desired_end ,
it_functions  TYPE STANDARD TABLE OF SWD_IFUNCS,"TABLES PARAM
wa_functions  LIKE LINE OF it_functions ,
it_tasks  TYPE STANDARD TABLE OF SWD_ITASKS,"TABLES PARAM
wa_tasks  LIKE LINE OF it_tasks .

DATA(ld_head) = 'Check type of data required'.
DATA(ld_global) = 'Check type of data required'.
DATA(ld_starting_events) = 'Check type of data required'.
DATA(ld_wi_text) = 'Check type of data required'.
DATA(ld_release_state) = 'Check type of data required'.
DATA(ld_sapphone) = 'Check type of data required'.
DATA(ld_properties) = 'Check type of data required'.
DATA(ld_local_events) = 'Check type of data required'.
DATA(ld_events) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_binding to it_binding.

"populate fields of struture and append to itab
append wa_text_description to it_text_description.

"populate fields of struture and append to itab
append wa_text_notification to it_text_notification.

"populate fields of struture and append to itab
append wa_text_deadline_latest_end to it_text_deadline_latest_end.

"populate fields of struture and append to itab
append wa_text_deadline_latest_start to it_text_deadline_latest_start.

"populate fields of struture and append to itab
append wa_text_deadline_desired_end to it_text_deadline_desired_end.

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

"populate fields of struture and append to itab
append wa_tasks to it_tasks. . CALL FUNCTION 'SWD_HEADER_SET' * EXPORTING * head = ld_head * global = ld_global * starting_events = ld_starting_events * wi_text = ld_wi_text * release_state = ld_release_state * sapphone = ld_sapphone * properties = ld_properties * local_events = ld_local_events * events = ld_events * TABLES * binding = it_binding * text_description = it_text_description * text_notification = it_text_notification * text_deadline_latest_end = it_text_deadline_latest_end * text_deadline_latest_start = it_text_deadline_latest_start * text_deadline_desired_end = it_text_deadline_desired_end * functions = it_functions * tasks = it_tasks . " SWD_HEADER_SET
IF SY-SUBRC EQ 0. "All OK 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_head  TYPE SWD_AHEAD ,
it_binding  TYPE STANDARD TABLE OF SWD_STBIND ,
wa_binding  LIKE LINE OF it_binding,
ld_global  TYPE SWDIGLOBAL ,
it_text_description  TYPE STANDARD TABLE OF TLINE ,
wa_text_description  LIKE LINE OF it_text_description,
ld_starting_events  TYPE SWDTSTEVTS ,
it_text_notification  TYPE STANDARD TABLE OF TLINE ,
wa_text_notification  LIKE LINE OF it_text_notification,
ld_wi_text  TYPE SWW_WITEXT ,
it_text_deadline_latest_end  TYPE STANDARD TABLE OF TLINE ,
wa_text_deadline_latest_end  LIKE LINE OF it_text_deadline_latest_end,
ld_release_state  TYPE TSKRELSTAT ,
it_text_deadline_latest_start  TYPE STANDARD TABLE OF TLINE ,
wa_text_deadline_latest_start  LIKE LINE OF it_text_deadline_latest_start,
ld_sapphone  TYPE SP_SPHABLE ,
it_text_deadline_desired_end  TYPE STANDARD TABLE OF TLINE ,
wa_text_deadline_desired_end  LIKE LINE OF it_text_deadline_desired_end,
ld_properties  TYPE SWDTIPROPTS ,
it_functions  TYPE STANDARD TABLE OF SWD_IFUNCS ,
wa_functions  LIKE LINE OF it_functions,
ld_local_events  TYPE SWDTILOCEVT ,
it_tasks  TYPE STANDARD TABLE OF SWD_ITASKS ,
wa_tasks  LIKE LINE OF it_tasks,
ld_events  TYPE SWDTIEVNTS .

ld_head = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_binding to it_binding.
ld_global = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_text_description to it_text_description.
ld_starting_events = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_text_notification to it_text_notification.
ld_wi_text = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_text_deadline_latest_end to it_text_deadline_latest_end.
ld_release_state = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_text_deadline_latest_start to it_text_deadline_latest_start.
ld_sapphone = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_text_deadline_desired_end to it_text_deadline_desired_end.
ld_properties = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_functions to it_functions.
ld_local_events = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_tasks to it_tasks.
ld_events = 'Check type of data required'.

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_HEADER_SET or its description.