SAP SWW_WI_LOG_WRITE_EXCEPTION Function Module for
SWW_WI_LOG_WRITE_EXCEPTION is a standard sww wi log write exception 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 sww wi log write exception FM, simply by entering the name SWW_WI_LOG_WRITE_EXCEPTION into the relevant SAP transaction such as SE37 or SE38.
Function Group: SWWL
Program Name: SAPLSWWL
Main Program: SAPLSWWL
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SWW_WI_LOG_WRITE_EXCEPTION 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 'SWW_WI_LOG_WRITE_EXCEPTION'".
EXPORTING
* DO_COMMIT = 'X' "Flag if FM itself should commit
WI_ID = "Work item ID
* WI_HEADER = "
* CONTEXT = "
* RETURN_CODE = SY-SUBRC "Return value of incorrect FM
* USER = SY-UNAME "Caller of incorrect FM
* LOG_TIME = "
* LOG_DATE = "
* LOG_TIMESTAMP = "UTC time stamp in long form (YYYYMMDDhhmmssmmmuuun)
* CHILD_GUID = "GUID in 'RAW' format
* PARENT_GUID = "GUID in 'RAW' format
FB_NAME = "Name of function module called
* PARA_NAME_1 = "
* PARA_VALUE_IBF_1 = "Local Persistent Object Reference - BOR Compatible
* FORCE_LOG = ' ' "
* MSGID = 'WL' "Message ID of exception (e.g. WD, WL etc.)
MSGNO = "Message number of exception
* MSGTY = 'E' "Message type of exception (e.g. E, A, I, etc.)
* MSGV1 = ' ' "Message variable 1
* MSGV2 = ' ' "Message variable 2
* MSGV3 = ' ' "Message variable 3
* MSGV4 = ' ' "Message variable 4
IMPORTING Parameters details for SWW_WI_LOG_WRITE_EXCEPTION
DO_COMMIT - Flag if FM itself should commit
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
WI_ID - Work item ID
Data type: SWWLOGHIST-WI_IDOptional: No
Call by Reference: No ( called with pass by value option)
WI_HEADER -
Data type: SWWWIHEADOptional: Yes
Call by Reference: Yes
CONTEXT -
Data type: SWWLOGCNTXOptional: Yes
Call by Reference: Yes
RETURN_CODE - Return value of incorrect FM
Data type: SY-SUBRCDefault: SY-SUBRC
Optional: Yes
Call by Reference: No ( called with pass by value option)
USER - Caller of incorrect FM
Data type: SY-UNAMEDefault: SY-UNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)
LOG_TIME -
Data type: SY-UZEITOptional: Yes
Call by Reference: No ( called with pass by value option)
LOG_DATE -
Data type: SY-DATUMOptional: Yes
Call by Reference: No ( called with pass by value option)
LOG_TIMESTAMP - UTC time stamp in long form (YYYYMMDDhhmmssmmmuuun)
Data type: TIMESTAMPLOptional: Yes
Call by Reference: No ( called with pass by value option)
CHILD_GUID - GUID in 'RAW' format
Data type: GUID_16Optional: Yes
Call by Reference: No ( called with pass by value option)
PARENT_GUID - GUID in 'RAW' format
Data type: GUID_16Optional: Yes
Call by Reference: No ( called with pass by value option)
FB_NAME - Name of function module called
Data type: SWWLOGHIST-METHODOptional: No
Call by Reference: No ( called with pass by value option)
PARA_NAME_1 -
Data type: SWWLOGPARA-PARA_NAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
PARA_VALUE_IBF_1 - Local Persistent Object Reference - BOR Compatible
Data type: SIBFLPORBOptional: Yes
Call by Reference: No ( called with pass by value option)
FORCE_LOG -
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MSGID - Message ID of exception (e.g. WD, WL etc.)
Data type:Default: 'WL'
Optional: Yes
Call by Reference: No ( called with pass by value option)
MSGNO - Message number of exception
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MSGTY - Message type of exception (e.g. E, A, I, etc.)
Data type:Default: 'E'
Optional: Yes
Call by Reference: No ( called with pass by value option)
MSGV1 - Message variable 1
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MSGV2 - Message variable 2
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MSGV3 - Message variable 3
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MSGV4 - Message variable 4
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SWW_WI_LOG_WRITE_EXCEPTION 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_do_commit | TYPE STRING, " 'X' | |||
| lv_wi_id | TYPE SWWLOGHIST-WI_ID, " | |||
| lv_wi_header | TYPE SWWWIHEAD, " | |||
| lv_context | TYPE SWWLOGCNTX, " | |||
| lv_return_code | TYPE SY-SUBRC, " SY-SUBRC | |||
| lv_user | TYPE SY-UNAME, " SY-UNAME | |||
| lv_log_time | TYPE SY-UZEIT, " | |||
| lv_log_date | TYPE SY-DATUM, " | |||
| lv_log_timestamp | TYPE TIMESTAMPL, " | |||
| lv_child_guid | TYPE GUID_16, " | |||
| lv_parent_guid | TYPE GUID_16, " | |||
| lv_fb_name | TYPE SWWLOGHIST-METHOD, " | |||
| lv_para_name_1 | TYPE SWWLOGPARA-PARA_NAME, " | |||
| lv_para_value_ibf_1 | TYPE SIBFLPORB, " | |||
| lv_force_log | TYPE XFELD, " SPACE | |||
| lv_msgid | TYPE XFELD, " 'WL' | |||
| lv_msgno | TYPE XFELD, " | |||
| lv_msgty | TYPE XFELD, " 'E' | |||
| lv_msgv1 | TYPE XFELD, " SPACE | |||
| lv_msgv2 | TYPE XFELD, " SPACE | |||
| lv_msgv3 | TYPE XFELD, " SPACE | |||
| lv_msgv4 | TYPE XFELD. " SPACE |
|   CALL FUNCTION 'SWW_WI_LOG_WRITE_EXCEPTION' " |
| EXPORTING | ||
| DO_COMMIT | = lv_do_commit | |
| WI_ID | = lv_wi_id | |
| WI_HEADER | = lv_wi_header | |
| CONTEXT | = lv_context | |
| RETURN_CODE | = lv_return_code | |
| USER | = lv_user | |
| LOG_TIME | = lv_log_time | |
| LOG_DATE | = lv_log_date | |
| LOG_TIMESTAMP | = lv_log_timestamp | |
| CHILD_GUID | = lv_child_guid | |
| PARENT_GUID | = lv_parent_guid | |
| FB_NAME | = lv_fb_name | |
| PARA_NAME_1 | = lv_para_name_1 | |
| PARA_VALUE_IBF_1 | = lv_para_value_ibf_1 | |
| FORCE_LOG | = lv_force_log | |
| MSGID | = lv_msgid | |
| MSGNO | = lv_msgno | |
| MSGTY | = lv_msgty | |
| MSGV1 | = lv_msgv1 | |
| MSGV2 | = lv_msgv2 | |
| MSGV3 | = lv_msgv3 | |
| MSGV4 | = lv_msgv4 | |
| . " SWW_WI_LOG_WRITE_EXCEPTION | ||
ABAP code using 7.40 inline data declarations to call FM SWW_WI_LOG_WRITE_EXCEPTION
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_do_commit) | = 'X'. | |||
| "SELECT single WI_ID FROM SWWLOGHIST INTO @DATA(ld_wi_id). | ||||
| "SELECT single SUBRC FROM SY INTO @DATA(ld_return_code). | ||||
| DATA(ld_return_code) | = SY-SUBRC. | |||
| "SELECT single UNAME FROM SY INTO @DATA(ld_user). | ||||
| DATA(ld_user) | = SY-UNAME. | |||
| "SELECT single UZEIT FROM SY INTO @DATA(ld_log_time). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_log_date). | ||||
| "SELECT single METHOD FROM SWWLOGHIST INTO @DATA(ld_fb_name). | ||||
| "SELECT single PARA_NAME FROM SWWLOGPARA INTO @DATA(ld_para_name_1). | ||||
| DATA(ld_force_log) | = ' '. | |||
| DATA(ld_msgid) | = 'WL'. | |||
| DATA(ld_msgty) | = 'E'. | |||
| DATA(ld_msgv1) | = ' '. | |||
| DATA(ld_msgv2) | = ' '. | |||
| DATA(ld_msgv3) | = ' '. | |||
| DATA(ld_msgv4) | = ' '. | |||
Search for further information about these or an SAP related objects