SAP TWP_GET_UI_CLASS_FOR_TCODE Function Module for
TWP_GET_UI_CLASS_FOR_TCODE is a standard twp get ui class for tcode 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 twp get ui class for tcode FM, simply by entering the name TWP_GET_UI_CLASS_FOR_TCODE into the relevant SAP transaction such as SE37 or SE38.
Function Group: PWP2
Program Name: SAPLPWP2
Main Program: SAPLPWP2
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function TWP_GET_UI_CLASS_FOR_TCODE 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 'TWP_GET_UI_CLASS_FOR_TCODE'".
EXPORTING
TCODE = "
IMPORTING
UI_CLASS = "
SERVICE_FILE = "
UI_CLASS_TXT = "
EXCEPTIONS
NOT_SUPPORTED = 1 NOT_FOUND = 2
IMPORTING Parameters details for TWP_GET_UI_CLASS_FOR_TCODE
TCODE -
Data type: TSTC-TCODEOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for TWP_GET_UI_CLASS_FOR_TCODE
UI_CLASS -
Data type: TWPTEMP-UI_CLASSOptional: No
Call by Reference: No ( called with pass by value option)
SERVICE_FILE -
Data type: TWPTEMP-SRV_FILEOptional: No
Call by Reference: No ( called with pass by value option)
UI_CLASS_TXT -
Data type: TWPTEMP-UI_CLASSTXOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_SUPPORTED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for TWP_GET_UI_CLASS_FOR_TCODE 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_tcode | TYPE TSTC-TCODE, " | |||
| lv_ui_class | TYPE TWPTEMP-UI_CLASS, " | |||
| lv_not_supported | TYPE TWPTEMP, " | |||
| lv_not_found | TYPE TWPTEMP, " | |||
| lv_service_file | TYPE TWPTEMP-SRV_FILE, " | |||
| lv_ui_class_txt | TYPE TWPTEMP-UI_CLASSTX. " |
|   CALL FUNCTION 'TWP_GET_UI_CLASS_FOR_TCODE' " |
| EXPORTING | ||
| TCODE | = lv_tcode | |
| IMPORTING | ||
| UI_CLASS | = lv_ui_class | |
| SERVICE_FILE | = lv_service_file | |
| UI_CLASS_TXT | = lv_ui_class_txt | |
| EXCEPTIONS | ||
| NOT_SUPPORTED = 1 | ||
| NOT_FOUND = 2 | ||
| . " TWP_GET_UI_CLASS_FOR_TCODE | ||
ABAP code using 7.40 inline data declarations to call FM TWP_GET_UI_CLASS_FOR_TCODE
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 TCODE FROM TSTC INTO @DATA(ld_tcode). | ||||
| "SELECT single UI_CLASS FROM TWPTEMP INTO @DATA(ld_ui_class). | ||||
| "SELECT single SRV_FILE FROM TWPTEMP INTO @DATA(ld_service_file). | ||||
| "SELECT single UI_CLASSTX FROM TWPTEMP INTO @DATA(ld_ui_class_txt). | ||||
Search for further information about these or an SAP related objects