SAP GET_LENGTH_OF_SUBSTRING Function Module for NOTRANSL: Ermittelt Länge alph., num. oder Sonderzeichensubstring ab Strin
GET_LENGTH_OF_SUBSTRING is a standard get length of substring SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Ermittelt Länge alph., num. oder Sonderzeichensubstring ab Strin 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 get length of substring FM, simply by entering the name GET_LENGTH_OF_SUBSTRING into the relevant SAP transaction such as SE37 or SE38.
Function Group: IPW0
Program Name: SAPLIPW0
Main Program: SAPLIPW0
Appliation area: V
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function GET_LENGTH_OF_SUBSTRING 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 'GET_LENGTH_OF_SUBSTRING'"NOTRANSL: Ermittelt Länge alph., num. oder Sonderzeichensubstring ab Strin.
EXPORTING
I_STRING = "Generic Type
I_ALPHABET = "Latin Alphabet
* I_DIGITS = '0123456789' "Generic Type
* I_SPECIAL_CHARS = '-' "Generic Type
IMPORTING
E_LENGTH_SUBSTRING = "ABAP System Field: Current Column in Current List
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLIPW0_001 Object Permissible for Contract (Copying of Order/Maintenance Order)
EXIT_SAPLIPW0_002 Object Permissible for Order (Copying of Maint. Order/Maint. Order)
EXIT_SAPLIPW0_003 Object Permissible for Contract (Maintenance of Maintenance Contract)
IMPORTING Parameters details for GET_LENGTH_OF_SUBSTRING
I_STRING - Generic Type
Data type: CLIKEOptional: No
Call by Reference: No ( called with pass by value option)
I_ALPHABET - Latin Alphabet
Data type: SYABCDEOptional: No
Call by Reference: No ( called with pass by value option)
I_DIGITS - Generic Type
Data type: CLIKEDefault: '0123456789'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SPECIAL_CHARS - Generic Type
Data type: CDefault: '-'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for GET_LENGTH_OF_SUBSTRING
E_LENGTH_SUBSTRING - ABAP System Field: Current Column in Current List
Data type: SY-COLNOOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for GET_LENGTH_OF_SUBSTRING 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_i_string | TYPE CLIKE, " | |||
| lv_e_length_substring | TYPE SY-COLNO, " | |||
| lv_i_alphabet | TYPE SYABCDE, " | |||
| lv_i_digits | TYPE CLIKE, " '0123456789' | |||
| lv_i_special_chars | TYPE C. " '-' |
|   CALL FUNCTION 'GET_LENGTH_OF_SUBSTRING' "NOTRANSL: Ermittelt Länge alph., num. oder Sonderzeichensubstring ab Strin |
| EXPORTING | ||
| I_STRING | = lv_i_string | |
| I_ALPHABET | = lv_i_alphabet | |
| I_DIGITS | = lv_i_digits | |
| I_SPECIAL_CHARS | = lv_i_special_chars | |
| IMPORTING | ||
| E_LENGTH_SUBSTRING | = lv_e_length_substring | |
| . " GET_LENGTH_OF_SUBSTRING | ||
ABAP code using 7.40 inline data declarations to call FM GET_LENGTH_OF_SUBSTRING
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 COLNO FROM SY INTO @DATA(ld_e_length_substring). | ||||
| DATA(ld_i_digits) | = '0123456789'. | |||
| DATA(ld_i_special_chars) | = '-'. | |||
Search for further information about these or an SAP related objects