SAP SWO_QUERY_API_METHODS Function Module for Find API methods









SWO_QUERY_API_METHODS is a standard swo query api methods SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Find API methods 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 query api methods FM, simply by entering the name SWO_QUERY_API_METHODS into the relevant SAP transaction such as SE37 or SE38.

Function Group: SWOR
Program Name: SAPLSWOR
Main Program: SAPLSWOR
Appliation area: S
Release date: 05-Nov-1997
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function SWO_QUERY_API_METHODS 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_QUERY_API_METHODS'"Find API methods
EXPORTING
* OBJTYPE = ' ' "Object type (if blank: all)
* METHOD = ' ' "Method (if blank: all)
* WITH_INTERNAL_API_METHODS = ' ' "
* WITH_IMPL_METHODS = ' ' "Read methods in 'implemented' status as well?
* WITH_TEXTS = 'X' "Read texts as well
* WITH_OBJECT_NAMES = ' ' "
* LANGUAGE = SY-LANGU "Language in which texts are read
* OBJECT_NAME = ' ' "Object name

TABLES
API_METHODS = "List of API methods

EXCEPTIONS
OBJTYPE_NOT_FOUND = 1 METHOD_NOT_FOUND = 2 METHOD_NOT_API = 3 METHOD_NOT_RELEASED = 4 PARAMETER_ERROR = 5
.



IMPORTING Parameters details for SWO_QUERY_API_METHODS

OBJTYPE - Object type (if blank: all)

Data type: SWOTBASDAT-OBJTYPE
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

METHOD - Method (if blank: all)

Data type: SWOTLV-VERB
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

WITH_INTERNAL_API_METHODS -

Data type: RPYBOGF-FLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

WITH_IMPL_METHODS - Read methods in 'implemented' status as well?

Data type: RPYBOGF-FLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

WITH_TEXTS - Read texts as well

Data type: RPYBOGF-FLAG
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

WITH_OBJECT_NAMES -

Data type: RPYBOGF-FLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

LANGUAGE - Language in which texts are read

Data type: SY-LANGU
Default: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)

OBJECT_NAME - Object name

Data type: SWOTBASDAT-EDITELEM
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for SWO_QUERY_API_METHODS

API_METHODS - List of API methods

Data type: SWOTMETHOD
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

OBJTYPE_NOT_FOUND - Cannot find object type

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

METHOD_NOT_FOUND - Cannot find method

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

METHOD_NOT_API - Method is not interface method

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

METHOD_NOT_RELEASED - Method is not released

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PARAMETER_ERROR - Incorrect parameter value

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for SWO_QUERY_API_METHODS 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_objtype  TYPE SWOTBASDAT-OBJTYPE, "   SPACE
lt_api_methods  TYPE STANDARD TABLE OF SWOTMETHOD, "   
lv_objtype_not_found  TYPE SWOTMETHOD, "   
lv_method  TYPE SWOTLV-VERB, "   SPACE
lv_method_not_found  TYPE SWOTLV, "   
lv_method_not_api  TYPE SWOTLV, "   
lv_with_internal_api_methods  TYPE RPYBOGF-FLAG, "   SPACE
lv_with_impl_methods  TYPE RPYBOGF-FLAG, "   SPACE
lv_method_not_released  TYPE RPYBOGF, "   
lv_with_texts  TYPE RPYBOGF-FLAG, "   'X'
lv_parameter_error  TYPE RPYBOGF, "   
lv_with_object_names  TYPE RPYBOGF-FLAG, "   SPACE
lv_language  TYPE SY-LANGU, "   SY-LANGU
lv_object_name  TYPE SWOTBASDAT-EDITELEM. "   SPACE

  CALL FUNCTION 'SWO_QUERY_API_METHODS'  "Find API methods
    EXPORTING
         OBJTYPE = lv_objtype
         METHOD = lv_method
         WITH_INTERNAL_API_METHODS = lv_with_internal_api_methods
         WITH_IMPL_METHODS = lv_with_impl_methods
         WITH_TEXTS = lv_with_texts
         WITH_OBJECT_NAMES = lv_with_object_names
         LANGUAGE = lv_language
         OBJECT_NAME = lv_object_name
    TABLES
         API_METHODS = lt_api_methods
    EXCEPTIONS
        OBJTYPE_NOT_FOUND = 1
        METHOD_NOT_FOUND = 2
        METHOD_NOT_API = 3
        METHOD_NOT_RELEASED = 4
        PARAMETER_ERROR = 5
. " SWO_QUERY_API_METHODS




ABAP code using 7.40 inline data declarations to call FM SWO_QUERY_API_METHODS

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 OBJTYPE FROM SWOTBASDAT INTO @DATA(ld_objtype).
DATA(ld_objtype) = ' '.
 
 
 
"SELECT single VERB FROM SWOTLV INTO @DATA(ld_method).
DATA(ld_method) = ' '.
 
 
 
"SELECT single FLAG FROM RPYBOGF INTO @DATA(ld_with_internal_api_methods).
DATA(ld_with_internal_api_methods) = ' '.
 
"SELECT single FLAG FROM RPYBOGF INTO @DATA(ld_with_impl_methods).
DATA(ld_with_impl_methods) = ' '.
 
 
"SELECT single FLAG FROM RPYBOGF INTO @DATA(ld_with_texts).
DATA(ld_with_texts) = 'X'.
 
 
"SELECT single FLAG FROM RPYBOGF INTO @DATA(ld_with_object_names).
DATA(ld_with_object_names) = ' '.
 
"SELECT single LANGU FROM SY INTO @DATA(ld_language).
DATA(ld_language) = SY-LANGU.
 
"SELECT single EDITELEM FROM SWOTBASDAT INTO @DATA(ld_object_name).
DATA(ld_object_name) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!