SAP REF_LOCATION_ARRAY Function Module for Array access to reference functional locations
REF_LOCATION_ARRAY is a standard ref location array SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Array access to reference functional locations 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 ref location array FM, simply by entering the name REF_LOCATION_ARRAY into the relevant SAP transaction such as SE37 or SE38.
Function Group: ILO4
Program Name: SAPLILO4
Main Program:
Appliation area: I
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function REF_LOCATION_ARRAY 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 'REF_LOCATION_ARRAY'"Array access to reference functional locations.
EXPORTING
* SELFIELD = 'TRPNR' "Name of selection field in IRLO_SE
* SPRAS = SY-LANGU "Reading language for texts (desired)
* TABSTRUCTURE = 'RIHIRLO' "Structure for results table IRLO_T
TABLES
IRLO_SEL = "Reference locations, selection table or WA
IRLO_TAB = "Reference locations, results table
EXCEPTIONS
NO_ENTRY_FOUND = 1 READ_ERROR = 2 SELECTION_NOT_POSSIBLE = 3 STRUCTURE_NOT_POSSIBLE = 4
IMPORTING Parameters details for REF_LOCATION_ARRAY
SELFIELD - Name of selection field in IRLO_SE
Data type:Default: 'TRPNR'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SPRAS - Reading language for texts (desired)
Data type: IRLO-SPRASDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABSTRUCTURE - Structure for results table IRLO_T
Data type:Default: 'RIHIRLO'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for REF_LOCATION_ARRAY
IRLO_SEL - Reference locations, selection table or WA
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
IRLO_TAB - Reference locations, results table
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_ENTRY_FOUND - No entry found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
READ_ERROR - Error reading dependent segments
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SELECTION_NOT_POSSIBLE - Selection field not supported
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
STRUCTURE_NOT_POSSIBLE - Structure not supported for results table
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for REF_LOCATION_ARRAY 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: | ||||
| lt_irlo_sel | TYPE STANDARD TABLE OF STRING, " | |||
| lv_selfield | TYPE STRING, " 'TRPNR' | |||
| lv_no_entry_found | TYPE STRING, " | |||
| lv_spras | TYPE IRLO-SPRAS, " SY-LANGU | |||
| lt_irlo_tab | TYPE STANDARD TABLE OF IRLO, " | |||
| lv_read_error | TYPE IRLO, " | |||
| lv_tabstructure | TYPE IRLO, " 'RIHIRLO' | |||
| lv_selection_not_possible | TYPE IRLO, " | |||
| lv_structure_not_possible | TYPE IRLO. " |
|   CALL FUNCTION 'REF_LOCATION_ARRAY' "Array access to reference functional locations |
| EXPORTING | ||
| SELFIELD | = lv_selfield | |
| SPRAS | = lv_spras | |
| TABSTRUCTURE | = lv_tabstructure | |
| TABLES | ||
| IRLO_SEL | = lt_irlo_sel | |
| IRLO_TAB | = lt_irlo_tab | |
| EXCEPTIONS | ||
| NO_ENTRY_FOUND = 1 | ||
| READ_ERROR = 2 | ||
| SELECTION_NOT_POSSIBLE = 3 | ||
| STRUCTURE_NOT_POSSIBLE = 4 | ||
| . " REF_LOCATION_ARRAY | ||
ABAP code using 7.40 inline data declarations to call FM REF_LOCATION_ARRAY
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.| DATA(ld_selfield) | = 'TRPNR'. | |||
| "SELECT single SPRAS FROM IRLO INTO @DATA(ld_spras). | ||||
| DATA(ld_spras) | = SY-LANGU. | |||
| DATA(ld_tabstructure) | = 'RIHIRLO'. | |||
Search for further information about these or an SAP related objects