2024 Oct 10 3:57 PM - edited 2024 Oct 10 4:01 PM
Hi all:
When using CL_SALV_TABLE, how do I get the catalog info for a specific column (e.g., the table name)?
I’m trying this (showing only the most relevant lines):In this case, get_ddic_reference returns blank data (ddic-table = ‘ ‘).
DATA cols TYPE REF TO cl_salv_columns_table.
DATA col1 TYPE REF TO cl_salv_column_table.
DATA ddic TYPE salv_s_ddic_reference.
cl_salv_table=>factory(
IMPORTING
r_salv_table = alv
CHANGING
t_table = itab ).
col1 ?= cols->get_column( ‘MY_COLUMN’ ).
ddic = col1->get_ddic_reference( ).
ddic-table returns blanks. Any ideas? Running 7.50
TIA,
Luis
Request clarification before answering.
No issue for me.
Minimum reproducible example:
REPORT ztest.
DATA table_sflight TYPE TABLE OF sflight.
SELECT * FROM sflight INTO TABLE @table_sflight.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = DATA(salv)
CHANGING
t_table = table_sflight.
DATA(ddic_reference) = salv->get_columns( )->get_column( 'CARRID' )->get_ddic_reference( ).
ASSERT ddic_reference = VALUE salv_s_ddic_reference( field = 'CARRID'
table = 'SFLIGHT' ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sandra. That's interesting. Your example works perfectly but, if my itab references an in-program type, it does not work.
REPORT ztest.
TYPES:
BEGIN OF ty_itab,
zuonr TYPE vbrk-zuonr,
vbrk_vbeln TYPE vbrk-vbeln,
END OF ty_itab.
DATA itab TYPE TABLE OF ty_itab.
cl_salv_table=>factory(
IMPORTING
r_salv_table = DATA(salv)
CHANGING
t_table = itab ).
DATA(ddic_reference) = salv->get_columns( )->get_column( 'ZUONR' )->get_ddic_reference( ).
User | Count |
---|---|
75 | |
30 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.