SAP SWO_INVOKE Function Module for Call business object method / set attributes
SWO_INVOKE is a standard swo invoke SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Call business object method / set attributes processing and below is the pattern details for this FM, 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 swo invoke FM, simply by entering the name SWO_INVOKE into the relevant SAP transaction such as SE37 or SE38.
Function Group: SWOR
Program Name: SAPLSWOR
Main Program: SAPLSWOR
Appliation area: S
Release date: 10-Nov-1997
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function SWO_INVOKE 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 'SWO_INVOKE'"Call business object method / set attributes.
EXPORTING
* ACCESS = 'C' "
OBJECT = "Runtime Object
* VERB = ' ' "
* PERSISTENT = ' ' "
* REQUESTER = ' ' "
* SYNCHRON = '*' "
* UNSORTED_CONTAINER = ' ' "Container has not been sorted, FM must do it
* NO_ARFC = ' ' "Do not execute ARFC
IMPORTING
RETURN = "Return Value
VERB = "
MODE_ID = "ID of new mode with asynchronous call
TABLES
CONTAINER = "
IMPORTING Parameters details for SWO_INVOKE
ACCESS -
Data type: SWOTP-ACCESSDefault: 'C'
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJECT - Runtime Object
Data type: SWOTRTIME-OBJECTOptional: No
Call by Reference: No ( called with pass by value option)
VERB -
Data type: SWOTINVOKE-VERBDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PERSISTENT -
Data type: SWOTP-PERSISTENTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
REQUESTER -
Data type: SWOTOBJIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SYNCHRON -
Data type: SWOTINVOKE-SYNCHRONDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
UNSORTED_CONTAINER - Container has not been sorted, FM must do it
Data type: SWOTINVOKE-SYNCHRONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_ARFC - Do not execute ARFC
Data type: SEU_BOOLDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SWO_INVOKE
RETURN - Return Value
Data type: SWOTRETURNOptional: No
Call by Reference: No ( called with pass by value option)
VERB -
Data type: SWOTINVOKE-VERBOptional: No
Call by Reference: No ( called with pass by value option)
MODE_ID - ID of new mode with asynchronous call
Data type: SY-INDEXOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for SWO_INVOKE
CONTAINER -
Data type: SWCONTOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SWO_INVOKE 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_access | TYPE SWOTP-ACCESS, " 'C' | |||
| lv_return | TYPE SWOTRETURN, " | |||
| lt_container | TYPE STANDARD TABLE OF SWCONT, " | |||
| lv_verb | TYPE SWOTINVOKE-VERB, " | |||
| lv_object | TYPE SWOTRTIME-OBJECT, " | |||
| lv_verb | TYPE SWOTINVOKE-VERB, " SPACE | |||
| lv_mode_id | TYPE SY-INDEX, " | |||
| lv_persistent | TYPE SWOTP-PERSISTENT, " SPACE | |||
| lv_requester | TYPE SWOTOBJID, " SPACE | |||
| lv_synchron | TYPE SWOTINVOKE-SYNCHRON, " '*' | |||
| lv_unsorted_container | TYPE SWOTINVOKE-SYNCHRON, " SPACE | |||
| lv_no_arfc | TYPE SEU_BOOL. " SPACE |
|   CALL FUNCTION 'SWO_INVOKE' "Call business object method / set attributes |
| EXPORTING | ||
| ACCESS | = lv_access | |
| OBJECT | = lv_object | |
| VERB | = lv_verb | |
| PERSISTENT | = lv_persistent | |
| REQUESTER | = lv_requester | |
| SYNCHRON | = lv_synchron | |
| UNSORTED_CONTAINER | = lv_unsorted_container | |
| NO_ARFC | = lv_no_arfc | |
| IMPORTING | ||
| RETURN | = lv_return | |
| VERB | = lv_verb | |
| MODE_ID | = lv_mode_id | |
| TABLES | ||
| CONTAINER | = lt_container | |
| . " SWO_INVOKE | ||
ABAP code using 7.40 inline data declarations to call FM SWO_INVOKE
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 ACCESS FROM SWOTP INTO @DATA(ld_access). | ||||
| DATA(ld_access) | = 'C'. | |||
| "SELECT single VERB FROM SWOTINVOKE INTO @DATA(ld_verb). | ||||
| "SELECT single OBJECT FROM SWOTRTIME INTO @DATA(ld_object). | ||||
| "SELECT single VERB FROM SWOTINVOKE INTO @DATA(ld_verb). | ||||
| DATA(ld_verb) | = ' '. | |||
| "SELECT single INDEX FROM SY INTO @DATA(ld_mode_id). | ||||
| "SELECT single PERSISTENT FROM SWOTP INTO @DATA(ld_persistent). | ||||
| DATA(ld_persistent) | = ' '. | |||
| DATA(ld_requester) | = ' '. | |||
| "SELECT single SYNCHRON FROM SWOTINVOKE INTO @DATA(ld_synchron). | ||||
| DATA(ld_synchron) | = '*'. | |||
| "SELECT single SYNCHRON FROM SWOTINVOKE INTO @DATA(ld_unsorted_container). | ||||
| DATA(ld_unsorted_container) | = ' '. | |||
| DATA(ld_no_arfc) | = ' '. | |||
Search for further information about these or an SAP related objects