Skip to content

Commit

Permalink
assigning
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp committed Jan 7, 2024
1 parent 55d85d5 commit 0ea5ab7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/kernel/kernel_create_data_handle.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ CLASS kernel_create_data_handle IMPLEMENTATION.
METHOD table.
DATA lo_table TYPE REF TO cl_abap_tabledescr.
DATA lt_keys TYPE abap_table_keydescr_tab.
DATA ls_key LIKE LINE OF lt_keys.
DATA lv_component TYPE string.
DATA field TYPE REF TO data.

FIELD-SYMBOLS <ls_key> LIKE LINE OF lt_keys.

lo_table ?= handle.

call(
Expand All @@ -116,16 +117,16 @@ CLASS kernel_create_data_handle IMPLEMENTATION.

* todo, handle secondary keys,
lt_keys = lo_table->get_keys( ).
LOOP AT lt_keys INTO ls_key WHERE is_primary = abap_true.
IF ls_key-access_kind = cl_abap_tabledescr=>tablekind_sorted.
LOOP AT lt_keys ASSIGNING <ls_key> WHERE is_primary = abap_true.
IF <ls_key>-access_kind = cl_abap_tabledescr=>tablekind_sorted.
WRITE '@KERNEL options.primaryKey.type = "SORTED";'.
ELSEIF ls_key-access_kind = cl_abap_tabledescr=>tablekind_hashed.
ELSEIF <ls_key>-access_kind = cl_abap_tabledescr=>tablekind_hashed.
WRITE '@KERNEL options.primaryKey.type = "HASHED";'.
ENDIF.
IF ls_key-is_unique = abap_true.
IF <ls_key>-is_unique = abap_true.
WRITE '@KERNEL options.primaryKey.isUnique = true;'.
ENDIF.
LOOP AT ls_key-components INTO lv_component.
LOOP AT <ls_key>-components INTO lv_component.
WRITE '@KERNEL options.primaryKey.keyFields.push(lv_component.get().toLowerCase());'.
ENDLOOP.
ENDLOOP.
Expand Down

0 comments on commit 0ea5ab7

Please sign in to comment.