Skip to content

Commit

Permalink
Fixed issues #17 and #24
Browse files Browse the repository at this point in the history
  • Loading branch information
NeumannJoerg committed Dec 20, 2024
1 parent 0f1c1fc commit c9f3a9e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 31 deletions.
52 changes: 24 additions & 28 deletions src/#usi#bal_data_containers/#usi#cl_bal_dc_itab.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ CLASS /usi/cl_bal_dc_itab DEFINITION PUBLIC CREATE PUBLIC.

PRIVATE SECTION.
DATA: internal_table_ref TYPE REF TO data,
table_descriptor TYPE REF TO lcl_table_descriptor,
title TYPE REF TO /usi/if_bal_text_container_c40,
external_fieldcatalog TYPE lvc_t_fcat.

Expand Down Expand Up @@ -67,48 +66,45 @@ CLASS /usi/cl_bal_dc_itab IMPLEMENTATION.
source_table_ref TYPE REF TO data,
table_content_copier TYPE REF TO lcl_table_content_copier.

TRY.
table_descriptor = lcl_table_descriptor=>get_by_data( i_internal_table ).
internal_table_ref = table_descriptor->get_table_type_dref( ).

GET REFERENCE OF i_internal_table INTO source_table_ref.
table_content_copier = NEW #( i_source_table_ref = source_table_ref
i_target_table_ref = internal_table_ref ).
table_content_copier->copy_table_contents( ).

CATCH /usi/cx_bal_root INTO exception.
exception_text = exception->get_text( ).

ASSERT ID /usi/bal_log_writer
FIELDS exception_text
CONDITION exception IS NOT BOUND.
RETURN.
ENDTRY.
CREATE DATA internal_table_ref LIKE i_internal_table.
ASSIGN internal_table_ref->* TO FIELD-SYMBOL(<table>).
<table> = i_internal_table.

title = i_title.
external_fieldcatalog = i_fieldcatalog.
ENDMETHOD.

METHOD /usi/if_bal_data_container~serialize.
DATA serializer TYPE REF TO lif_serializer.

IF internal_table_ref IS NOT BOUND.
RAISE EXCEPTION TYPE /usi/cx_bal_invalid_input
EXPORTING textid = /usi/cx_bal_invalid_input=>unsupported_line_type.
ENDIF.
" Normalize table format
TRY.
ASSIGN internal_table_ref->* TO FIELD-SYMBOL(<source_table>).
DATA(table_descriptor) = lcl_table_descriptor=>get_by_data( <source_table> ).

serializer = NEW lcl_serializer( i_table_reference = internal_table_ref
i_table_descriptor = table_descriptor
i_external_fieldcatalog = external_fieldcatalog
i_title = title ).
DATA(target_table_ref) = table_descriptor->get_table_type_dref( ).
DATA(table_content_copier) = NEW lcl_table_content_copier( i_source_table_ref = internal_table_ref
i_target_table_ref = target_table_ref ).
table_content_copier->copy_table_contents( ).
CATCH /usi/cx_bal_root INTO DATA(exception).
RAISE EXCEPTION TYPE /usi/cx_bal_invalid_input
EXPORTING textid = /usi/cx_bal_invalid_input=>unsupported_line_type
previous = exception.
ENDTRY.

" Serialize
DATA(serializer) = CAST lif_serializer( NEW lcl_serializer( i_table_reference = target_table_ref
i_table_descriptor = table_descriptor
i_external_fieldcatalog = external_fieldcatalog
i_title = title ) ).
r_result = serializer->serialize( ).
ENDMETHOD.

METHOD /usi/if_bal_data_container_rnd~render.
DATA: fieldcatalog_collection TYPE REF TO lcl_fieldcatalog_collection,
grid_control TYPE REF TO lcl_grid_control.

ASSIGN internal_table_ref->* TO FIELD-SYMBOL(<table>).
DATA(table_descriptor) = lcl_table_descriptor=>get_by_data( i_table = <table> ).

Check failure on line 106 in src/#usi#bal_data_containers/#usi#cl_bal_dc_itab.clas.abap

View workflow job for this annotation

GitHub Actions / results

Omit default parameter name "I_TABLE"

omit_parameter_name

fieldcatalog_collection = NEW #( i_table_descriptor = table_descriptor
i_external_fieldcatalog = external_fieldcatalog ).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,11 @@ CLASS lcl_table_descriptor IMPLEMENTATION.
CHANGING ct_fieldcat = buffers-fieldcatalog->*
EXCEPTIONS OTHERS = 0.

LOOP AT buffers-fieldcatalog->* REFERENCE INTO DATA(field).
CLEAR field->no_out.
CLEAR field->tech.
ENDLOOP.

ELSE.
LOOP AT type_descriptions-line->components ASSIGNING FIELD-SYMBOL(<component>).
type_descriptions-line->get_component_type( EXPORTING p_name = <component>-name
Expand Down Expand Up @@ -1464,18 +1469,15 @@ CLASS lcl_grid_control IMPLEMENTATION.
METHOD get_excluded_functions.
INSERT cl_gui_alv_grid=>mc_fc_col_invisible INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_fc_col_optimize INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_fc_current_variant INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_fc_fix_columns INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_fc_graph INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_fc_info INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_fc_loc_copy INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_fc_print INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_fc_sort INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_fc_unfix_columns INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_mb_paste INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_mb_subtot INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_mb_sum INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_mb_variant INTO TABLE r_result.
INSERT cl_gui_alv_grid=>mc_mb_view INTO TABLE r_result.
ENDMETHOD.

Expand Down

0 comments on commit c9f3a9e

Please sign in to comment.