Skip to content

Instantly share code, notes, and snippets.

@ilyakaznacheev
Last active October 5, 2020 13:03
Show Gist options
  • Save ilyakaznacheev/32bb3e2a1b8ee2a46e826ceccc27c656 to your computer and use it in GitHub Desktop.
Save ilyakaznacheev/32bb3e2a1b8ee2a46e826ceccc27c656 to your computer and use it in GitHub Desktop.
TRY.
cl_salv_ida_services=>create_entity_and_abqi(
EXPORTING
iv_entity_type = 'CDS'
iv_entity_id = 'ZCDS_NAME'
IMPORTING
eo_entity = DATA(lo_entity)
).
DATA(lo_fcat) = go_salv->field_catalog( ).
lo_fcat->get_available_fields(
IMPORTING
ets_field_names = DATA(lt_fcat_fields)
).
lo_entity->get_ui_texts(
IMPORTING
et_ui_texts_by_element_names = DATA(lt_field_info)
).
LOOP AT lt_fcat_fields ASSIGNING FIELD-SYMBOL(<ls_fcat_field>).
TRY.
DATA(ls_ui_texts) = lt_field_info[ element_name = <ls_fcat_field> ]-ui_texts.
CATCH cx_sy_itab_line_not_found.
CONTINUE.
ENDTRY.
lo_fcat->set_field_header_texts(
iv_field_name = <ls_fcat_field>
iv_header_text = CONV #( ls_ui_texts-label )
iv_tooltip_text = CONV #( ls_ui_texts-tooltip )
).
ENDLOOP.
CATCH cx_root.
* ???
ENDTRY.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment