Skip to content

Automatic Update #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions src/zoblomov_cl_util.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ CLASS zoblomov_cl_util DEFINITION
RETURNING
VALUE(result) TYPE ty_t_msg.

CLASS-METHODS rtti_get_data_element_text_l
IMPORTING
VALUE(val) TYPE any
RETURNING
VALUE(result) TYPE string.

CLASS-METHODS msg_get
IMPORTING
VALUE(val) TYPE any
Expand Down Expand Up @@ -147,6 +153,14 @@ CLASS zoblomov_cl_util DEFINITION
RETURNING
VALUE(result) TYPE string.

CLASS-METHODS tab_get_where_by_dfies
IMPORTING
mv_check_tab_field TYPE string
ms_data_row TYPE REF TO data
it_dfies TYPE zoblomov_cl_util=>ty_t_dfies
RETURNING
VALUE(result) TYPE string.

CLASS-METHODS itab_get_itab_by_csv
IMPORTING
val TYPE string
Expand Down Expand Up @@ -795,6 +809,48 @@ CLASS zoblomov_cl_util IMPLEMENTATION.

ENDMETHOD.

METHOD tab_get_where_by_dfies.

DATA val TYPE string.

LOOP AT it_dfies REFERENCE INTO DATA(dfies).

IF NOT ( dfies->keyflag = abap_true OR dfies->fieldname = mv_check_tab_field ).
CONTINUE.
ENDIF.

ASSIGN ms_data_row->* TO FIELD-SYMBOL(<row>).

ASSIGN COMPONENT dfies->fieldname OF STRUCTURE <row> TO FIELD-SYMBOL(<value>).
IF <value> IS NOT ASSIGNED.
CONTINUE.
ENDIF.
IF <value> IS INITIAL.
CONTINUE.
ENDIF.

IF result IS NOT INITIAL.
DATA(and) = ` AND `.
ENDIF.

IF <value> CA `_`.
DATA(escape) = `ESCAPE '#'`.
ELSE.
CLEAR escape.
ENDIF.

val = <value>.

IF val CA `_`.
REPLACE ALL OCCURRENCES OF `_` IN val WITH `#_`.
ENDIF.

result = |{ result }{ and } ( { dfies->fieldname } LIKE '%{ val }%' { escape } )|.

ENDLOOP.

ENDMETHOD.

METHOD itab_get_itab_by_csv.

DATA lt_comp TYPE cl_abap_structdescr=>component_table.
Expand Down Expand Up @@ -1467,4 +1523,10 @@ CLASS zoblomov_cl_util IMPLEMENTATION.

ENDMETHOD.

METHOD rtti_get_data_element_text_l.

result = zoblomov_cl_util=>rtti_get_data_element_texts( val )-long.

ENDMETHOD.

ENDCLASS.
Loading