GitHub
LibrariesOpen source libraries used to build this documentation site.
LibraryRoleVersionLicense
AstroastroSite framework6.3.1MIT
Astro React@astrojs/reactReact integration5.0.4MIT
Astro Sitemap@astrojs/sitemapSitemap generation3.7.2MIT
UI5 Web Components@ui5/webcomponentsUI primitives2.22.0Apache-2.0
UI5 Web Components Fiori@ui5/webcomponents-fioriFiori shell components2.22.0Apache-2.0
UI5 Web Components Icons@ui5/webcomponents-iconsIcon set2.22.0Apache-2.0
UI5 Web Components React@ui5/webcomponents-reactReact wrappers2.22.0Apache-2.0
ReactreactUI runtime19.2.6MIT
React DOMreact-domDOM renderer19.2.6MIT
ShikishikiSyntax highlighting4.0.2MIT
Docs/ORK/SINGLETON/ORK/IF_SI_ABAP_STRING
Interface/ORK/IF_SI_ABAP_STRING
ABAP String Functions (Singleton)
InterfaceABAP String Functions (Singleton)
Package
/ORK/SINGLETON
Members
44
Description

Comprehensive utility interface for string manipulation, searching, splitting, formatting and line/offset handling.

Designed to be used via a singleton implementation.

34 items
Methods
substring
Method

Returns substring using offset and length.

Parameters

NameDescriptionstrSource stringoffStart offset (0-based)lenLength, -1 = until endresultExtracted substring

Signature

METHODS substring IMPORTING str TYPE string
                              !off TYPE i DEFAULT 0
                              !len TYPE i DEFAULT -1
                    RETURNING VALUE(result) TYPE string.
split
Method

Splits string at delimiter.

Parameters

NameDescriptionstrSource stringatDelimiterresultSplit parts

Signature

METHODS split IMPORTING str TYPE string
                          !at TYPE string
                RETURNING VALUE(result) TYPE string_table.
split_extended
Method

Advanced splitting with optional behavior control.

Parameters

NameDescriptionstrSource stringatDelimiter (optional)remove_emptiesRemove empty tokenstrim_entriesTrim each tokencase_sensitiveCase sensitive delimiter matchresultSplit parts

Signature

METHODS split_extended IMPORTING str TYPE string
                                   !at TYPE string OPTIONAL
                                   remove_empties TYPE abap_bool DEFAULT abap_false
                                   trim_entries TYPE abap_bool DEFAULT abap_false
                                   case_sensitive TYPE abap_bool DEFAULT abap_false
                         RETURNING VALUE(result) TYPE string_table.
split_regex
Method

Splits string using regular expression pattern.

Parameters

NameDescriptionstrSource stringpatternRegex separatorcase_sensitiveCase sensitivityresultSplit parts

Signature

METHODS split_regex IMPORTING str TYPE string
                                !pattern TYPE string
                                case_sensitive TYPE abap_bool DEFAULT abap_true
                      RETURNING VALUE(result) TYPE string_table.
split_to_lines
Method

Splits string into lines.

Parameters

NameDescriptionstrSource stringuse_cr_lfExplicit CRLF handlingresultLines

Signature

METHODS split_to_lines IMPORTING str TYPE string
                                   use_cr_lf TYPE abap_bool DEFAULT abap_undefined
                         RETURNING VALUE(result) TYPE string_table.
trim
Method

Trims whitespace from both ends.

Parameters

NameDescriptionstrSource stringresultTrimmed string

Signature

METHODS trim IMPORTING str TYPE string
               RETURNING VALUE(result) TYPE string.
trim_start
Method

Trims characters from start.

Parameters

NameDescriptionstrSource stringcharsCharacters to remove (default whitespace)resultTrimmed string

Signature

METHODS trim_start IMPORTING str TYPE string
                               chars TYPE string OPTIONAL
                     RETURNING VALUE(result) TYPE string.
trim_end
Method

Trims characters from end.

Parameters

NameDescriptionstrSource stringcharsCharacters to remove (default whitespace)resultTrimmed string

Signature

METHODS trim_end IMPORTING str TYPE string
                             chars TYPE string OPTIONAL
                   RETURNING VALUE(result) TYPE string.
pad_left
Method

Pads string on left to total length.

Parameters

NameDescriptionstrSource stringtotal_lenTarget total lengthcharPadding characterresultPadded string

Signature

METHODS pad_left IMPORTING str TYPE string
                             total_len TYPE i
                             !char TYPE ty-char1
                   RETURNING VALUE(result) TYPE string.
pad_right
Method

Pads string on right to total length.

Parameters

NameDescriptionstrSource stringtotal_lenTarget total lengthcharPadding characterresultPadded string

Signature

METHODS pad_right IMPORTING str TYPE string
                              total_len TYPE i
                              !char TYPE ty-char1
                    RETURNING VALUE(result) TYPE string.
pad_both
Method

Pads string on both sides to total length.

Parameters

NameDescriptionstrSource stringtotal_lenTarget total lengthcharPadding characterresultPadded string

Signature

METHODS pad_both IMPORTING str TYPE string
                             total_len TYPE i
                             !char TYPE ty-char1
                   RETURNING VALUE(result) TYPE string.
join
Method

Joins string table using separator.

Parameters

NameDescriptionstrsStrings to joinsepSeparator stringresultJoined string

Signature

METHODS join IMPORTING strs TYPE string_table
                         sep TYPE string
               RETURNING VALUE(result) TYPE string.
any_to_string
Method

Converts any value to string representation.

Parameters

NameDescriptionanyValue to convertformatFormatting maskformat_providerExternal formattertypeExplicit type descriptorresultString representation

Signature

METHODS any_to_string IMPORTING !any TYPE any
                                  !format TYPE csequence OPTIONAL
                                  format_provider TYPE REF TO /ork/if_format_provider OPTIONAL
                                  !type TYPE REF TO cl_abap_datadescr OPTIONAL
                        RETURNING VALUE(result) TYPE string.
find
Method

Finds all occurrences of pattern.

Parameters

NameDescriptionstrSource stringpatternSearch patterncase_sensitiveCase sensitive searchresultMatch positions

Signature

METHODS find IMPORTING str TYPE string
                         !pattern TYPE string
                         case_sensitive TYPE abap_bool DEFAULT abap_true
               RETURNING VALUE(result) TYPE match_result_tab.
find_contains_any_gapless
Method

Finds occurrences of any specified characters with gapless position handling.

Searches the source string for characters contained in the provided set. Match positions are normalized to a gapless coordinate system. Positions that fall into logical gaps are marked using the specified gap indicator.

Parameters

NameDescriptionstrSource string to searchcharsSet of characters to matchgap_indicatorValue used to mark gap positionsresultMatch positions in gapless representation

Signature

METHODS find_contains_any_gapless IMPORTING str TYPE string
                                              chars TYPE string
                                              gap_indicator TYPE i DEFAULT /ork/if_si_abap_string=>cm_default_gap_indicator
                                    RETURNING VALUE(result) TYPE match_result_tab.
find_contains_any
Method

Finds occurrences of any specified characters.

Searches the source string for characters contained in the provided set. Each occurrence of any matching character is returned as a match position.

Parameters

NameDescriptionstrSource string to searchcharsSet of characters to matchresultMatch positions

Signature

METHODS find_contains_any IMPORTING str TYPE string
                                      chars TYPE string
                            RETURNING VALUE(result) TYPE match_result_tab.
find_first
Method

Finds first occurrence of pattern.

Parameters

NameDescriptionstrSource stringpatternSearch patterncase_sensitiveCase sensitive searchresultFirst match position

Signature

METHODS find_first IMPORTING str TYPE string
                               !pattern TYPE string
                               case_sensitive TYPE abap_bool DEFAULT abap_true
                     RETURNING VALUE(result) TYPE match_result.
find_gapless
Method

Finds all occurrences of pattern with gapless position handling.

Searches the source string for the specified pattern. Match positions are normalized to a gapless coordinate system. Positions that fall into logical gaps are marked using the specified gap indicator.

Parameters

NameDescriptionstrSource string to searchpatternSearch patterngap_indicatorValue used to mark gap positionscase_sensitiveCase sensitive searchresultMatch positions in gapless representation

Signature

METHODS find_gapless IMPORTING str TYPE string
                                 !pattern TYPE string
                                 gap_indicator TYPE i DEFAULT /ork/if_si_abap_string=>cm_default_gap_indicator
                                 case_sensitive TYPE abap_bool DEFAULT abap_true
                       RETURNING VALUE(result) TYPE match_result_tab.
find_regex
Method

Regex search returning match positions.

Parameters

NameDescriptionstrSource stringpatternRegular expressioncase_sensitiveCase sensitive matchingresultMatch positions

Signature

METHODS find_regex IMPORTING str TYPE string
                               !pattern TYPE string
                               case_sensitive TYPE abap_bool DEFAULT abap_true
                     RETURNING VALUE(result) TYPE match_result_tab.
find_regex_first
Method

Regex search returning first match.

Parameters

NameDescriptionstrSource stringpatternRegular expressioncase_sensitiveCase sensitive matchingresultFirst match position

Signature

METHODS find_regex_first IMPORTING str TYPE string
                                     !pattern TYPE string
                                     case_sensitive TYPE abap_bool DEFAULT abap_true
                           RETURNING VALUE(result) TYPE match_result.
find_regex_gapless
Method

Performs regular expression search with gapless position handling.

Matches are determined using the specified regular expression. The resulting match positions are normalized to a gapless coordinate system. Positions that correspond to logical gaps are marked using the specified gap indicator.

Parameters

NameDescriptionstrSource string to searchpatternRegular expression patterngap_indicatorValue used to mark gap positionscase_sensitiveCase sensitive matchingresultMatch positions in gapless representation

Signature

METHODS find_regex_gapless IMPORTING str TYPE string
                                       !pattern TYPE string
                                       gap_indicator TYPE i DEFAULT /ork/if_si_abap_string=>cm_default_gap_indicator
                                       case_sensitive TYPE abap_bool DEFAULT abap_true
                             RETURNING VALUE(result) TYPE match_result_tab.
find_begin_of_line
Method

Returns offset of line start for given offset.

Parameters

NameDescriptionstrMultiline textoffsetAbsolute offsetresultOffset of line start

Signature

METHODS find_begin_of_line IMPORTING str TYPE string
                                       !offset TYPE i
                             RETURNING VALUE(result) TYPE i.
match_result_to_gapless
Method

Converts match positions into gapless representation.

Transforms match results so that their offsets refer to a logical gapless coordinate system. Positions that fall into gaps or cannot be mapped are marked using the specified gap indicator.

This method is typically used after performing searches on text that contains removed or ignored segments which must not contribute to positional indexing.

Parameters

NameDescriptionmatch_tabOriginal match result tabletext_lenLength of the original text used as positional referencegap_indicatorValue used to mark gap positionsresultMatch results normalized to gapless representation

Signature

METHODS match_result_to_gapless IMPORTING match_tab TYPE match_result_tab
                                            text_len TYPE i
                                            gap_indicator TYPE i DEFAULT /ork/if_si_abap_string=>cm_default_gap_indicator
                                  RETURNING VALUE(result) TYPE match_result_tab.
match_regex
Method

Returns substrings matching regex.

Parameters

NameDescriptionstrSource stringpatternRegular expressioncase_sensitiveCase sensitive matchingresultMatched substrings

Signature

METHODS match_regex IMPORTING str TYPE string
                                !pattern TYPE string
                                case_sensitive TYPE abap_bool DEFAULT abap_true
                      RETURNING VALUE(result) TYPE string_table.
index_of
Method

Finds index of substring.

Parameters

NameDescriptionstrSource stringsearch_strSubstring to searchignore_caseCase insensitive searchstart_indexStart search indexlengthSearch length (-1 = full string)find_lastSearch from endresultFound index or negative if not found

Signature

METHODS index_of IMPORTING str TYPE string
                             search_str TYPE string
                             ignore_case TYPE abap_bool DEFAULT abap_false
                             start_index TYPE i DEFAULT 0
                             !length TYPE i DEFAULT -1
                             find_last TYPE abap_bool DEFAULT abap_false
                   RETURNING VALUE(result) TYPE i.
replace
Method

Replaces first occurrence of substring.

Parameters

NameDescriptionstrSource stringsearch_strSubstring to replacereplace_strReplacement textignore_caseCase insensitive replacementresultModified string

Signature

METHODS replace IMPORTING str TYPE string
                            search_str TYPE string
                            replace_str TYPE string
                            ignore_case TYPE abap_bool DEFAULT abap_false
                  RETURNING VALUE(result) TYPE string.
replace_all
Method

Replaces all occurrences of substring.

Parameters

NameDescriptionstrSource stringsearch_strSubstring to replacereplace_strReplacement textignore_caseCase insensitive replacementresultModified string

Signature

METHODS replace_all IMPORTING str TYPE string
                                search_str TYPE string
                                replace_str TYPE string
                                ignore_case TYPE abap_bool DEFAULT abap_false
                      RETURNING VALUE(result) TYPE string.
starts_with
Method

Checks whether string starts with substring.

Parameters

NameDescriptionstrSource stringsubPrefix to testignore_caseCase insensitive comparisonresultabap_true if prefix matches

Signature

METHODS starts_with IMPORTING str TYPE string
                                sub TYPE string
                                ignore_case TYPE abap_bool DEFAULT abap_false
                      RETURNING VALUE(result) TYPE abap_bool.
ends_with
Method

Checks whether string ends with substring.

Parameters

NameDescriptionstrSource stringsubSuffix to testignore_caseCase insensitive comparisonresultabap_true if suffix matches

Signature

METHODS ends_with
    IMPORTING str TYPE string
              sub TYPE string
              ignore_case TYPE abap_bool DEFAULT abap_false
    RETURNING VALUE(result) TYPE abap_bool.
get_line_offset
Method

Returns offset within current line.

Parameters

NameDescriptiontextMultiline textoffsetAbsolute offsetresultOffset within line

Signature

METHODS get_line_offset IMPORTING !text TYPE string
                                    !offset TYPE i
                          RETURNING VALUE(result) TYPE i.
get_line_number
Method

Returns line number for offset.

Parameters

NameDescriptiontextMultiline textoffsetAbsolute offsetresultLine number (1-based)

Signature

METHODS get_line_number IMPORTING !text TYPE string
                                    !offset TYPE i
                          RETURNING VALUE(result) TYPE i.
get_line_pos
Method

Provides information about the line number and position in the respective line for a position in the text

Parameters

NameDescriptiontextMultiline textoffsetAbsolute offsetresultLine and position information

Signature

METHODS get_line_pos IMPORTING !text TYPE string
                                 !offset TYPE i
                       RETURNING VALUE(result) TYPE /ork/if_si_abap_string=>ty_s_line_pos.
char_from_unicode
Method

Returns character for Unicode code point.

Parameters

NameDescriptionuccpUnicode code pointresultCharacter string

Signature

METHODS char_from_unicode IMPORTING uccp TYPE i
                            RETURNING VALUE(result) TYPE string.
char_to_unicode
Method

Returns Unicode code point for character.

Parameters

NameDescriptioncharCharacter stringlengthCharacter lengthresultUnicode code point

Signature

METHODS char_to_unicode
    IMPORTING !char TYPE csequence
    EXPORTING !length TYPE i
    RETURNING VALUE(result) TYPE i.
8 items
Types
ty_ta
Type

Generic table types for string collections.

Signature

TYPES ty_ta TYPE ANY TABLE OF string.
ty_tt
Type

Signature

TYPES ty_tt TYPE STANDARD TABLE OF string WITH EMPTY KEY.
ty_th
Type

Signature

TYPES ty_th TYPE HASHED TABLE OF string WITH UNIQUE KEY table_line.
ty_ts
Type

Signature

TYPES ty_ts TYPE SORTED TABLE OF string WITH NON-UNIQUE KEY table_line.
ty_t_range
Type

Range types for string values.

Signature

TYPES ty_t_range TYPE RANGE OF string.
ty_s_range
Type

Signature

TYPES ty_s_range TYPE LINE OF ty_t_range.
ty
Type

Signature

TYPES: BEGIN OF ty,
           char1 TYPE c LENGTH 1,
           char2 TYPE c LENGTH 2,
           char3 TYPE c LENGTH 3,
         END OF ty.
ty_s_line_pos
Type
Information about the line number and position

... in the respective line

Signature

BEGIN OF ty_s_line_pos,
1 item
Constants
cm_default_gap_indicator
Constant

Default indicator for gap positions used by gapless matching.

Signature

CONSTANTS cm_default_gap_indicator TYPE i VALUE -999999 ##NO_TEXT.
1 item
Data
is
Data

Predicate helper interface providing classification checks.

Signature

DATA is TYPE REF TO /ork/if_si_abap_string_is READ-ONLY.
Repository11 packages · 112 objects
123 items