SAP SWO_TREE_CONSTRUCT_FILTER Function Module for OT Tree Filter Structure Construction
SWO_TREE_CONSTRUCT_FILTER is a standard swo tree construct filter SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for OT Tree Filter Structure Construction 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 tree construct filter FM, simply by entering the name SWO_TREE_CONSTRUCT_FILTER into the relevant SAP transaction such as SE37 or SE38.
Function Group: SWOT
Program Name: SAPLSWOT
Main Program: SAPLSWOT
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SWO_TREE_CONSTRUCT_FILTER 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_TREE_CONSTRUCT_FILTER'"OT Tree Filter Structure Construction.
EXPORTING
* RELEASED = '*' "Released object types
* ALLOBJECTS = 'X' "
* BUSOBJECTS = ' ' "Business objects
* ORGOBJECTS = ' ' "
* INTERFACES = ' ' "
* OBJECTS_WITH_API_ONLY = ' ' "Only object types with API methods
IMPORTING
FILTER = "Object Type Tree Filter
IMPORTING Parameters details for SWO_TREE_CONSTRUCT_FILTER
RELEASED - Released object types
Data type: SWOTBASDAT-RELEASEDDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
ALLOBJECTS -
Data type: SWOTFILTER-CLASS_ALLDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
BUSOBJECTS - Business objects
Data type: SWOTBASDAT-CLASS_BODefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
ORGOBJECTS -
Data type: SWOTBASDAT-CLASS_ORGDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
INTERFACES -
Data type: SWOTFILTER-CLASS_IFDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJECTS_WITH_API_ONLY - Only object types with API methods
Data type: SWOTFILTER-API_ONLYDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SWO_TREE_CONSTRUCT_FILTER
FILTER - Object Type Tree Filter
Data type: SWOTFILTEROptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SWO_TREE_CONSTRUCT_FILTER 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_filter | TYPE SWOTFILTER, " | |||
| lv_released | TYPE SWOTBASDAT-RELEASED, " '*' | |||
| lv_allobjects | TYPE SWOTFILTER-CLASS_ALL, " 'X' | |||
| lv_busobjects | TYPE SWOTBASDAT-CLASS_BO, " ' ' | |||
| lv_orgobjects | TYPE SWOTBASDAT-CLASS_ORG, " ' ' | |||
| lv_interfaces | TYPE SWOTFILTER-CLASS_IF, " ' ' | |||
| lv_objects_with_api_only | TYPE SWOTFILTER-API_ONLY. " ' ' |
|   CALL FUNCTION 'SWO_TREE_CONSTRUCT_FILTER' "OT Tree Filter Structure Construction |
| EXPORTING | ||
| RELEASED | = lv_released | |
| ALLOBJECTS | = lv_allobjects | |
| BUSOBJECTS | = lv_busobjects | |
| ORGOBJECTS | = lv_orgobjects | |
| INTERFACES | = lv_interfaces | |
| OBJECTS_WITH_API_ONLY | = lv_objects_with_api_only | |
| IMPORTING | ||
| FILTER | = lv_filter | |
| . " SWO_TREE_CONSTRUCT_FILTER | ||
ABAP code using 7.40 inline data declarations to call FM SWO_TREE_CONSTRUCT_FILTER
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 RELEASED FROM SWOTBASDAT INTO @DATA(ld_released). | ||||
| DATA(ld_released) | = '*'. | |||
| "SELECT single CLASS_ALL FROM SWOTFILTER INTO @DATA(ld_allobjects). | ||||
| DATA(ld_allobjects) | = 'X'. | |||
| "SELECT single CLASS_BO FROM SWOTBASDAT INTO @DATA(ld_busobjects). | ||||
| DATA(ld_busobjects) | = ' '. | |||
| "SELECT single CLASS_ORG FROM SWOTBASDAT INTO @DATA(ld_orgobjects). | ||||
| DATA(ld_orgobjects) | = ' '. | |||
| "SELECT single CLASS_IF FROM SWOTFILTER INTO @DATA(ld_interfaces). | ||||
| DATA(ld_interfaces) | = ' '. | |||
| "SELECT single API_ONLY FROM SWOTFILTER INTO @DATA(ld_objects_with_api_only). | ||||
| DATA(ld_objects_with_api_only) | = ' '. | |||
Search for further information about these or an SAP related objects