SAP TR_TRESN_INTERFACE Function Module for External: Create/Change/Delete/Read Reservations (V_TRESN)
TR_TRESN_INTERFACE is a standard tr tresn interface SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for External: Create/Change/Delete/Read Reservations (V_TRESN) 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 tr tresn interface FM, simply by entering the name TR_TRESN_INTERFACE into the relevant SAP transaction such as SE37 or SE38.
Function Group: STRB
Program Name: SAPLSTRB
Main Program:
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function TR_TRESN_INTERFACE 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 'TR_TRESN_INTERFACE'"External: Create/Change/Delete/Read Reservations (V_TRESN).
EXPORTING
IV_TRESN_OBJECT = "
IV_TRESN_NAMERANGE = "
* IV_TRESN_DEVCLASS = "Package
* IV_TRESN_PROTART = "
* IV_TRESN_AUTHOR = "Author
* IV_TRESN_CTEXT = "Short Text
* IV_EDIT_MODE = 'R' "
IMPORTING
EV_VTRESN = "
EXCEPTIONS
CANCELED_BY_USER = 1 VIEW_MAINTENANCE_ERROR = 10 INVALID_EDIT_MODE = 2 TRESN_ENTRY_NOT_EXISTING = 3 WRONG_DEVCLASS = 4 INVALID_KEY = 5 INVALID_PARAMETER = 6 WRONG_NAMESPACE = 7 RESERVATION_OVERLAP = 8 RESERVATION_CONFLICT = 9
IMPORTING Parameters details for TR_TRESN_INTERFACE
IV_TRESN_OBJECT -
Data type: V_TRESN-OBJECTOptional: No
Call by Reference: No ( called with pass by value option)
IV_TRESN_NAMERANGE -
Data type: V_TRESN-OBJ_NAMELOOptional: No
Call by Reference: No ( called with pass by value option)
IV_TRESN_DEVCLASS - Package
Data type: V_TRESN-DEVCLASSOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_TRESN_PROTART -
Data type: V_TRESN-PROTARTOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_TRESN_AUTHOR - Author
Data type: V_TRESN-AUTHOROptional: Yes
Call by Reference: No ( called with pass by value option)
IV_TRESN_CTEXT - Short Text
Data type: V_TRESN-CTEXTOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_EDIT_MODE -
Data type: STRB_TRESN-EDIT_MODEDefault: 'R'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for TR_TRESN_INTERFACE
EV_VTRESN -
Data type: V_TRESNOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
CANCELED_BY_USER - Cancellation by user
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VIEW_MAINTENANCE_ERROR -
Data type:Optional: No
Call by Reference: Yes
INVALID_EDIT_MODE - Invalid Mode
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TRESN_ENTRY_NOT_EXISTING -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_DEVCLASS -
Data type:Optional: No
Call by Reference: Yes
INVALID_KEY -
Data type:Optional: No
Call by Reference: Yes
INVALID_PARAMETER -
Data type:Optional: No
Call by Reference: Yes
WRONG_NAMESPACE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
RESERVATION_OVERLAP -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
RESERVATION_CONFLICT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for TR_TRESN_INTERFACE 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_ev_vtresn | TYPE V_TRESN, " | |||
| lv_iv_tresn_object | TYPE V_TRESN-OBJECT, " | |||
| lv_canceled_by_user | TYPE V_TRESN, " | |||
| lv_view_maintenance_error | TYPE V_TRESN, " | |||
| lv_invalid_edit_mode | TYPE V_TRESN, " | |||
| lv_iv_tresn_namerange | TYPE V_TRESN-OBJ_NAMELO, " | |||
| lv_iv_tresn_devclass | TYPE V_TRESN-DEVCLASS, " | |||
| lv_tresn_entry_not_existing | TYPE V_TRESN, " | |||
| lv_wrong_devclass | TYPE V_TRESN, " | |||
| lv_iv_tresn_protart | TYPE V_TRESN-PROTART, " | |||
| lv_invalid_key | TYPE V_TRESN, " | |||
| lv_iv_tresn_author | TYPE V_TRESN-AUTHOR, " | |||
| lv_iv_tresn_ctext | TYPE V_TRESN-CTEXT, " | |||
| lv_invalid_parameter | TYPE V_TRESN, " | |||
| lv_iv_edit_mode | TYPE STRB_TRESN-EDIT_MODE, " 'R' | |||
| lv_wrong_namespace | TYPE STRB_TRESN, " | |||
| lv_reservation_overlap | TYPE STRB_TRESN, " | |||
| lv_reservation_conflict | TYPE STRB_TRESN. " |
|   CALL FUNCTION 'TR_TRESN_INTERFACE' "External: Create/Change/Delete/Read Reservations (V_TRESN) |
| EXPORTING | ||
| IV_TRESN_OBJECT | = lv_iv_tresn_object | |
| IV_TRESN_NAMERANGE | = lv_iv_tresn_namerange | |
| IV_TRESN_DEVCLASS | = lv_iv_tresn_devclass | |
| IV_TRESN_PROTART | = lv_iv_tresn_protart | |
| IV_TRESN_AUTHOR | = lv_iv_tresn_author | |
| IV_TRESN_CTEXT | = lv_iv_tresn_ctext | |
| IV_EDIT_MODE | = lv_iv_edit_mode | |
| IMPORTING | ||
| EV_VTRESN | = lv_ev_vtresn | |
| EXCEPTIONS | ||
| CANCELED_BY_USER = 1 | ||
| VIEW_MAINTENANCE_ERROR = 10 | ||
| INVALID_EDIT_MODE = 2 | ||
| TRESN_ENTRY_NOT_EXISTING = 3 | ||
| WRONG_DEVCLASS = 4 | ||
| INVALID_KEY = 5 | ||
| INVALID_PARAMETER = 6 | ||
| WRONG_NAMESPACE = 7 | ||
| RESERVATION_OVERLAP = 8 | ||
| RESERVATION_CONFLICT = 9 | ||
| . " TR_TRESN_INTERFACE | ||
ABAP code using 7.40 inline data declarations to call FM TR_TRESN_INTERFACE
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 OBJECT FROM V_TRESN INTO @DATA(ld_iv_tresn_object). | ||||
| "SELECT single OBJ_NAMELO FROM V_TRESN INTO @DATA(ld_iv_tresn_namerange). | ||||
| "SELECT single DEVCLASS FROM V_TRESN INTO @DATA(ld_iv_tresn_devclass). | ||||
| "SELECT single PROTART FROM V_TRESN INTO @DATA(ld_iv_tresn_protart). | ||||
| "SELECT single AUTHOR FROM V_TRESN INTO @DATA(ld_iv_tresn_author). | ||||
| "SELECT single CTEXT FROM V_TRESN INTO @DATA(ld_iv_tresn_ctext). | ||||
| "SELECT single EDIT_MODE FROM STRB_TRESN INTO @DATA(ld_iv_edit_mode). | ||||
| DATA(ld_iv_edit_mode) | = 'R'. | |||
Search for further information about these or an SAP related objects