SAP BARC_GET_TEXTINDEX Function Module for Determine the text index belonging to a field
BARC_GET_TEXTINDEX is a standard barc get textindex SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Determine the text index belonging to a field 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 barc get textindex FM, simply by entering the name BARC_GET_TEXTINDEX into the relevant SAP transaction such as SE37 or SE38.
Function Group: BARC
Program Name: SAPLBARC
Main Program: SAPLBARC
Appliation area: S
Release date: 16-Apr-1997
Mode(Normal, Remote etc): Normal Function Module
Update:

Function BARC_GET_TEXTINDEX 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 'BARC_GET_TEXTINDEX'"Determine the text index belonging to a field.
EXPORTING
FIELD = "Field name
* BOX_TYPE = ' ' "Box type
FORM_TYPE = "Form type
OBJECT_TYPE = "Object type
* WINID = ' ' "Window ID
IMPORTING
TEXTINDEX = "Text index
EXCEPTIONS
INV_BOX_TYPE = 1 INV_OBJECT_TYPE = 2 INV_WINID = 3
IMPORTING Parameters details for BARC_GET_TEXTINDEX
FIELD - Field name
Data type: BCVALS-FLOptional: No
Call by Reference: No ( called with pass by value option)
BOX_TYPE - Box type
Data type: BCBOXES-TYPEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FORM_TYPE - Form type
Data type: BCBOXES-FORM_TYPEOptional: No
Call by Reference: No ( called with pass by value option)
OBJECT_TYPE - Object type
Data type: BCDELETE-OBJ_TYPEOptional: No
Call by Reference: No ( called with pass by value option)
WINID - Window ID
Data type: NET_GRAPH-WINIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BARC_GET_TEXTINDEX
TEXTINDEX - Text index
Data type: BCVALS-FLOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
INV_BOX_TYPE - Incorrect box type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INV_OBJECT_TYPE - Incorrect object type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INV_WINID - Incorrect window ID
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BARC_GET_TEXTINDEX 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_field | TYPE BCVALS-FL, " | |||
| lv_textindex | TYPE BCVALS-FL, " | |||
| lv_inv_box_type | TYPE BCVALS, " | |||
| lv_box_type | TYPE BCBOXES-TYPE, " SPACE | |||
| lv_inv_object_type | TYPE BCBOXES, " | |||
| lv_form_type | TYPE BCBOXES-FORM_TYPE, " | |||
| lv_inv_winid | TYPE BCBOXES, " | |||
| lv_object_type | TYPE BCDELETE-OBJ_TYPE, " | |||
| lv_winid | TYPE NET_GRAPH-WINID. " SPACE |
|   CALL FUNCTION 'BARC_GET_TEXTINDEX' "Determine the text index belonging to a field |
| EXPORTING | ||
| FIELD | = lv_field | |
| BOX_TYPE | = lv_box_type | |
| FORM_TYPE | = lv_form_type | |
| OBJECT_TYPE | = lv_object_type | |
| WINID | = lv_winid | |
| IMPORTING | ||
| TEXTINDEX | = lv_textindex | |
| EXCEPTIONS | ||
| INV_BOX_TYPE = 1 | ||
| INV_OBJECT_TYPE = 2 | ||
| INV_WINID = 3 | ||
| . " BARC_GET_TEXTINDEX | ||
ABAP code using 7.40 inline data declarations to call FM BARC_GET_TEXTINDEX
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 FL FROM BCVALS INTO @DATA(ld_field). | ||||
| "SELECT single FL FROM BCVALS INTO @DATA(ld_textindex). | ||||
| "SELECT single TYPE FROM BCBOXES INTO @DATA(ld_box_type). | ||||
| DATA(ld_box_type) | = ' '. | |||
| "SELECT single FORM_TYPE FROM BCBOXES INTO @DATA(ld_form_type). | ||||
| "SELECT single OBJ_TYPE FROM BCDELETE INTO @DATA(ld_object_type). | ||||
| "SELECT single WINID FROM NET_GRAPH INTO @DATA(ld_winid). | ||||
| DATA(ld_winid) | = ' '. | |||
Search for further information about these or an SAP related objects