on 01-31-2024 1:38 PM
Hi
ABAP dump ASSIGN_TYPE_CONFLICT using dynamic table on an alv when clicking buttons how to fix this ?
here's my code
** Dynamic Table Declarations
DATA :
gt_dyn_table TYPE REF TO data,
gw_dyn_line TYPE REF TO data,
gw_dyn_line1 TYPE REF TO data,
FIELD-SYMBOLS: <gfs_line>,<gfs_line1>,
<gfs_dyn_table> TYPE STANDARD TABLE ,
<fs1>,<fs_color>.
* RTTS Declaratoins.
DATA : gr_struct_typ TYPE REF TO cl_abap_datadescr,
gr_dyntable_typ TYPE REF TO cl_abap_tabledescr,
ls_component TYPE cl_abap_structdescr=>component,
gt_component TYPE cl_abap_structdescr=>component_table,
CREATE DATA:
gt_dyn_table TYPE HANDLE gr_dyntable_typ,
gw_dyn_line TYPE HANDLE gr_struct_typ,
gw_dyn_line1 TYPE HANDLE gr_struct_typ.
ASSIGN gt_dyn_table->* TO <gfs_dyn_table>.
ASSIGN gw_dyn_line->* TO <gfs_line>.
** Populate the dynamic table*****************
** SALV Declarations.
DATA :
lo_columns type ref to cl_salv_columns_table.
lo_cols TYPE REF TO cl_salv_columns,
lo_salv_table TYPE REF TO cl_salv_table,
lo_column TYPE REF TO cl_salv_column,
col_name(30),
col_desc(20).
try.
cl_salv_table=>factory(
importing
r_salv_table = lo_salv_table
changing
t_table = <gfs_dyn_table> ). """""""""""
catch cx_salv_msg.
endtry.
* get columns object
lo_cols = lo_salv_table->get_columns( ).
lo_salv_table->get_functions( )->set_all( abap_true ).
lo_salv_table->get_columns( )->set_optimize( abap_true ).
lo_salv_table->get_columns( )->set_color_column( 't_color' ).
LOOP AT gt_component INTO ls_component.
TRY.
col_name = ls_component-name.
lo_column ?= lo_cols->get_column( col_name ).
col_desc = col_name.
lo_column->set_medium_text( col_desc ).
lo_column->set_output_length( 15 ).
CATCH cx_salv_not_found.
ENDTRY.
ENDLOOP.
lo_salv_table->display( ).
Hi ,
I assume you are getting the error due to
field symbol <gfs_line>
You can declare as type any and try
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
9 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.