SAP LTRS_RESOURCE_REG Function Module for Register a resource
LTRS_RESOURCE_REG is a standard ltrs resource reg SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Register a resource 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 ltrs resource reg FM, simply by entering the name LTRS_RESOURCE_REG into the relevant SAP transaction such as SE37 or SE38.
Function Group: LTRS_SERVICES
Program Name: SAPLLTRS_SERVICES
Main Program: SAPLLTRS_SERVICES
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function LTRS_RESOURCE_REG 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 'LTRS_RESOURCE_REG'"Register a resource.
EXPORTING
* I_LOCAT = "Site
* I_DEVICE = "Resource element
* I_RSTYP = "Resource type
* I_WORKER = "Resource element
* I_ELMTY = "Resource element Type
* I_RSLOC = "Resource location
* I_PRSDV = "Presentation device
IMPORTING
O_RSRCE = "Resource
O_BAD_ELMNT = "Resource element
O_BAD_ELMTY = "Resource element type
O_MISSING_ELMTY = "Resource element type
O_BAD_QTY_ELMTY = "Resource element type
TABLES
* IT_ELMNT_ROLES = "
EXCEPTIONS
EMPTY = 1 ILLEGAL = 2 FAILED = 3 NO_OBJECTS_FOR_OBJECT = 4 OBJECTS_MISMATCH = 5 NOT_ALLOWED = 6 ASSIGNED = 7 NO_LOGON = 8
IMPORTING Parameters details for LTRS_RESOURCE_REG
I_LOCAT - Site
Data type: LRSRC-LOCATOptional: Yes
Call by Reference: Yes
I_DEVICE - Resource element
Data type: LELMT-ELMNTOptional: Yes
Call by Reference: Yes
I_RSTYP - Resource type
Data type: LRSRC-RSTYPOptional: Yes
Call by Reference: Yes
I_WORKER - Resource element
Data type: LELMT-ELMNTOptional: Yes
Call by Reference: Yes
I_ELMTY - Resource element Type
Data type: LELMT-ELMTYOptional: Yes
Call by Reference: Yes
I_RSLOC - Resource location
Data type: LTRM_SRCDSTOptional: Yes
Call by Reference: Yes
I_PRSDV - Presentation device
Data type: LELMT-PRSDVOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for LTRS_RESOURCE_REG
O_RSRCE - Resource
Data type: LRSRC-RSRCEOptional: No
Call by Reference: Yes
O_BAD_ELMNT - Resource element
Data type: LELMT-ELMNTOptional: No
Call by Reference: Yes
O_BAD_ELMTY - Resource element type
Data type: LELTY-ELMTYOptional: No
Call by Reference: Yes
O_MISSING_ELMTY - Resource element type
Data type: LELTY-ELMTYOptional: No
Call by Reference: Yes
O_BAD_QTY_ELMTY - Resource element type
Data type: LELTY-ELMTYOptional: No
Call by Reference: Yes
TABLES Parameters details for LTRS_RESOURCE_REG
IT_ELMNT_ROLES -
Data type: LTRM_IT_ELMNT_ROLESOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
EMPTY - Empty object
Data type:Optional: No
Call by Reference: Yes
ILLEGAL - Illegal object
Data type:Optional: No
Call by Reference: Yes
FAILED - Process failed
Data type:Optional: No
Call by Reference: Yes
NO_OBJECTS_FOR_OBJECT - No objects exist for required object
Data type:Optional: No
Call by Reference: Yes
OBJECTS_MISMATCH - Objects do not match
Data type:Optional: No
Call by Reference: Yes
NOT_ALLOWED - Object is not allowed
Data type:Optional: No
Call by Reference: Yes
ASSIGNED - Object is already assigned to another object
Data type:Optional: No
Call by Reference: Yes
NO_LOGON - Logon interrupted
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for LTRS_RESOURCE_REG 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_empty | TYPE STRING, " | |||
| lv_i_locat | TYPE LRSRC-LOCAT, " | |||
| lv_o_rsrce | TYPE LRSRC-RSRCE, " | |||
| lt_it_elmnt_roles | TYPE STANDARD TABLE OF LTRM_IT_ELMNT_ROLES, " | |||
| lv_illegal | TYPE LTRM_IT_ELMNT_ROLES, " | |||
| lv_i_device | TYPE LELMT-ELMNT, " | |||
| lv_o_bad_elmnt | TYPE LELMT-ELMNT, " | |||
| lv_failed | TYPE LELMT, " | |||
| lv_i_rstyp | TYPE LRSRC-RSTYP, " | |||
| lv_o_bad_elmty | TYPE LELTY-ELMTY, " | |||
| lv_i_worker | TYPE LELMT-ELMNT, " | |||
| lv_o_missing_elmty | TYPE LELTY-ELMTY, " | |||
| lv_no_objects_for_object | TYPE LELTY, " | |||
| lv_i_elmty | TYPE LELMT-ELMTY, " | |||
| lv_o_bad_qty_elmty | TYPE LELTY-ELMTY, " | |||
| lv_objects_mismatch | TYPE LELTY, " | |||
| lv_i_rsloc | TYPE LTRM_SRCDST, " | |||
| lv_not_allowed | TYPE LTRM_SRCDST, " | |||
| lv_i_prsdv | TYPE LELMT-PRSDV, " | |||
| lv_assigned | TYPE LELMT, " | |||
| lv_no_logon | TYPE LELMT. " |
|   CALL FUNCTION 'LTRS_RESOURCE_REG' "Register a resource |
| EXPORTING | ||
| I_LOCAT | = lv_i_locat | |
| I_DEVICE | = lv_i_device | |
| I_RSTYP | = lv_i_rstyp | |
| I_WORKER | = lv_i_worker | |
| I_ELMTY | = lv_i_elmty | |
| I_RSLOC | = lv_i_rsloc | |
| I_PRSDV | = lv_i_prsdv | |
| IMPORTING | ||
| O_RSRCE | = lv_o_rsrce | |
| O_BAD_ELMNT | = lv_o_bad_elmnt | |
| O_BAD_ELMTY | = lv_o_bad_elmty | |
| O_MISSING_ELMTY | = lv_o_missing_elmty | |
| O_BAD_QTY_ELMTY | = lv_o_bad_qty_elmty | |
| TABLES | ||
| IT_ELMNT_ROLES | = lt_it_elmnt_roles | |
| EXCEPTIONS | ||
| EMPTY = 1 | ||
| ILLEGAL = 2 | ||
| FAILED = 3 | ||
| NO_OBJECTS_FOR_OBJECT = 4 | ||
| OBJECTS_MISMATCH = 5 | ||
| NOT_ALLOWED = 6 | ||
| ASSIGNED = 7 | ||
| NO_LOGON = 8 | ||
| . " LTRS_RESOURCE_REG | ||
ABAP code using 7.40 inline data declarations to call FM LTRS_RESOURCE_REG
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 LOCAT FROM LRSRC INTO @DATA(ld_i_locat). | ||||
| "SELECT single RSRCE FROM LRSRC INTO @DATA(ld_o_rsrce). | ||||
| "SELECT single ELMNT FROM LELMT INTO @DATA(ld_i_device). | ||||
| "SELECT single ELMNT FROM LELMT INTO @DATA(ld_o_bad_elmnt). | ||||
| "SELECT single RSTYP FROM LRSRC INTO @DATA(ld_i_rstyp). | ||||
| "SELECT single ELMTY FROM LELTY INTO @DATA(ld_o_bad_elmty). | ||||
| "SELECT single ELMNT FROM LELMT INTO @DATA(ld_i_worker). | ||||
| "SELECT single ELMTY FROM LELTY INTO @DATA(ld_o_missing_elmty). | ||||
| "SELECT single ELMTY FROM LELMT INTO @DATA(ld_i_elmty). | ||||
| "SELECT single ELMTY FROM LELTY INTO @DATA(ld_o_bad_qty_elmty). | ||||
| "SELECT single PRSDV FROM LELMT INTO @DATA(ld_i_prsdv). | ||||
Search for further information about these or an SAP related objects