Table Scanner - Abap
Table Scanner - Abap
Table Scanner - Abap
*&
*&---------------------------------------------------------------------*
*&
*& Select tables by domain, data element or tabname
*& and scan them for a given value
*& result is shown in splitter control within up to 256 ALV grids
*&
*& additional features:
*& - save situation before refresh and show differences after refresh
*&
(-> user settings)
*& - jump to DDIC for selected fields (double click)
*& - show technical names or field lables (->user settings)
*& - select any values from the result list and re-submit scanner
*& (where used button)
*& - all ALV functions like sort, filter, layouts per table
*&
*& prerequisite: SAP_BASIS 640
*&---------------------------------------------------------------------*
*
*
*
*
REPORT table_scanner.
CONSTANTS: gc_se16
TYPE sytcode VALUE 'SE16',
gc_alv_screen TYPE sydynnr VALUE '0100',
gc_list_screen TYPE sydynnr VALUE '0200',
gc_col_column TYPE fieldname VALUE '/TABLESCANNER/TABCOL',
gc_col_red
TYPE n VALUE 6,
gc_col_green TYPE n VALUE 5,
gc_col_yellow TYPE n VALUE 3,
gc_max_row_height TYPE i VALUE 30000.
TABLES: tadir,
dd01l,
dd02l,
dd03l,
dd25l,
dd27s.
"object directory
"Domains
"tables
"table fields
"views
"view fields
edit,
selkz,
END OF ty_table.
TYPES: BEGIN OF ty_sub_splitter,
container TYPE REF TO cl_gui_splitter_container,
height TYPE i,
END OF ty_sub_splitter.
DATA: gt_tables
TYPE
g_container
TYPE
g_gui_control_splitter TYPE
gt_sub_splitter
TYPE
g_with_edit
TYPE
ok_code TYPE syucomm.
TABLE OF ty_table,
REF TO cl_gui_custom_container,
REF TO cl_gui_splitter_container,
TABLE OF ty_sub_splitter,
abap_bool,
PERFORM selection_screen_output.
AT SELECTION-SCREEN ON BLOCK fields.
IF fieldnam[] IS INITIAL AND
rollname[] IS INITIAL AND
domain[] IS INITIAL AND
sy-ucomm(1) NE '%'. "multiple selection
MESSAGE e237(law_messages).
ENDIF.
INITIALIZATION.
PERFORM initialization.
AT USER-COMMAND.
ok_code = sy-ucomm.
PERFORM user_command.
*&---------------------------------------------------------------------*
START-OF-SELECTION.
PERFORM get_tables.
LOOP AT gt_tables ASSIGNING <gs_table>.
PERFORM select_data.
ENDLOOP.
IF rb_alv EQ abap_true.
PERFORM alv_show.
CALL SCREEN gc_alv_screen.
ELSE.
CALL SCREEN gc_list_screen.
ENDIF.
*---------------------------------------------------------------------*
* ALV grid classes
*---------------------------------------------------------------------*
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
handle_user_command
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm,
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column.
PRIVATE SECTION.
ENDCLASS.
"lcl_event_receiver DEFINITION
*---------------------------------------------------------------------*
*
CLASS lcl_event_receiver IMPLEMENTATION
*---------------------------------------------------------------------*
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_toolbar.
PERFORM handle_toolbar CHANGING e_object e_interactive.
ENDMETHOD.
"handle_toolbar
*------------------------------------------------------------------METHOD handle_user_command.
"assign_current_table
*&--------------------------------------------------------------------*
*&
Form handle_toolbar
*&--------------------------------------------------------------------*
FORM handle_toolbar
CHANGING e_object TYPE REF TO cl_alv_event_toolbar_set
e_interactive TYPE char01.
DATA: ls_toolbar TYPE stb_button,
lt_icon TYPE TABLE OF stypeicon.
* append a separator to normal toolbar
CLEAR ls_toolbar.
MOVE 3 TO ls_toolbar-butn_type.
APPEND ls_toolbar TO e_object->mt_toolbar.
IF g_with_edit EQ abap_true.
* append button for change
CLEAR ls_toolbar.
MOVE 'CHANGE' TO ls_toolbar-function.
PERFORM get_icon USING icon_toggle_display_change
CHANGING ls_toolbar.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDIF.
IF <gs_table>-edit EQ abap_true.
* append button for save
CLEAR ls_toolbar.
ENDFORM.
"handle_toolbar
*&--------------------------------------------------------------------*
*&
Form handle_user_command
*&--------------------------------------------------------------------*
FORM handle_user_command USING e_ucomm TYPE syucomm.
DATA: lt_rows
ls_row
ls_col
lt_fieldcat
l_fnam
l_dref
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
lvc_t_row,
lvc_s_row,
lvc_s_col,
lvc_t_fcat,
d021s-fnam,
REF TO data.
CASE e_ucomm.
WHEN 'REFRESH'.
PERFORM refresh_table.
WHEN 'CLOSE'.
g_gui_control_splitter->remove_control( row
= <gs_table>-row
column = 1 ).
DELETE gt_tables WHERE tabname = <gs_table>-tabname.
WHEN 'COLLAPSE'.
CLEAR <gs_table>-count.
PERFORM set_pane_height USING <gs_table>.
CALL METHOD <gs_table>-alv->refresh_table_display.
WHEN 'EXPAND'.
ASSIGN <gs_table>-entries->* TO <lt_entries>.
DESCRIBE TABLE <lt_entries> LINES <gs_table>-count.
PERFORM set_pane_height USING <gs_table>.
CALL METHOD <gs_table>-alv->refresh_table_display.
WHEN 'SHOWDDIC'.
CALL METHOD <gs_table>-alv->get_current_cell
IMPORTING
es_col_id = ls_col.
l_fnam = ls_col-fieldname.
CALL FUNCTION 'RS_DD_FIEL_SHOW'
"#EC FB_OLDED
EXPORTING
fname = l_fnam
objname = <gs_table>-tabname.
WHEN 'WHEREUSED'.
CALL METHOD <gs_table>-alv->get_current_cell
IMPORTING
es_col_id = ls_col
es_row_id = ls_row.
PERFORM where_used USING ls_row ls_col.
WHEN 'NEWMODE'.
WHEN 'CHANGE'.
TRANSLATE <gs_table>-edit USING 'X X'.
PERFORM set_table_for_first_display.
WHEN 'SAVE'.
CREATE DATA l_dref TYPE (<gs_table>-tabname).
ASSIGN l_dref->* TO <ls_dbtab>.
ASSIGN <gs_table>-entries->* TO <lt_entries>.
ASSIGN <gs_table>-entries2->* TO <lt_entries2>.
*
save new values
<lt_entries2>[] = <lt_entries>[].
PERFORM select_data.
DELETE (<gs_table>-tabname) FROM TABLE <lt_entries>.
LOOP AT <lt_entries2> ASSIGNING <ls_entry>.
MOVE-CORRESPONDING <ls_entry> TO <ls_dbtab>.
INSERT (<gs_table>-tabname) FROM <ls_dbtab>.
ENDLOOP.
<lt_entries>[] = <lt_entries2>[].
*
update alv
CLEAR <gs_table>-edit.
PERFORM set_table_for_first_display.
ENDCASE.
ENDFORM.
"handle_user_command
*&--------------------------------------------------------------------*
*&
Form handle_double_click
*&--------------------------------------------------------------------*
FORM handle_double_click USING is_row
TYPE lvc_s_row
"handle_double_click
*&--------------------------------------------------------------------*
*&
Form where_used
*&--------------------------------------------------------------------*
FORM where_used USING is_row
TYPE lvc_s_row
is_column TYPE lvc_s_col.
DATA: lr_values
ls_value
lt_rows
ls_row
ls_varid
lf_level
lt_dfies
TYPE
LIKE
TYPE
LIKE
TYPE
LIKE
TYPE
RANGE OF ty_value,
LINE OF lr_values,
lvc_t_row,
LINE OF lt_rows,
varid,
level,
TABLE OF dfies WITH HEADER LINE.
'DDIF_FIELDINFO_GET'
= <gs_table>-tabname
= is_column-fieldname
= lt_dfies
= 0.
ENDLOOP.
SORT lr_values.
DELETE ADJACENT DUPLICATES FROM lr_values.
ENDIF.
* check whether there is a varint
SELECT SINGLE * FROM varid INTO
WHERE report EQ
AND variant EQ
"where_used
*&---------------------------------------------------------------------*
*&
Form get_icon
*&---------------------------------------------------------------------*
FORM get_icon USING
i_icon
TYPE icon_d
CHANGING cs_toolbar TYPE stb_button.
cs_toolbar-icon = i_icon.
CLEAR cs_toolbar-disabled.
SELECT SINGLE
INTO
WHERE
AND
CLEAR cs_toolbar-text.
ENDFORM.
" get_icon
*&--------------------------------------------------------------------*
*&
Form initialization
*&--------------------------------------------------------------------*
FORM initialization.
CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
EXPORTING
tcode = gc_se16
EXCEPTIONS
ok
= 1
not_ok = 2
OTHERS = 3.
IF sy-subrc NE 1.
MESSAGE e077(s#) WITH gc_se16.
ENDIF.
* generate screen
PERFORM generate_screen USING gc_list_screen.
* get texts for selection screen titles
SELECT SINGLE ddtext FROM dd02t INTO t_tables
WHERE tabname
EQ 'DD02L'
AND ddlanguage EQ sy-langu
AND as4local EQ 'A'
AND as4vers
EQ 0.
SELECT SINGLE ddtext FROM
WHERE
AND
AND
AND
ENDFORM.
dd02t INTO
tabname
ddlanguage
as4local
as4vers
t_fields
EQ 'DD03L'
EQ sy-langu
EQ 'A'
EQ 0.
"initialization
*&--------------------------------------------------------------------*
*&
Form selection_screen_output
*&--------------------------------------------------------------------*
*
get selection texts dynamically
*---------------------------------------------------------------------*
FORM selection_screen_output.
FIELD-SYMBOLS: <sn>.
DATA: lf_name LIKE dcobjdef-name,
lf_tabname LIKE dfies-tabname,
lf_fieldname LIKE dfies-fieldname,
lf_length LIKE sy-fdpos,
ls_dd04v LIKE dd04v,
lt_dfies LIKE TABLE OF dfies WITH HEADER LINE.
STATICS: lt_sscr LIKE TABLE OF rsscr WITH HEADER LINE,
lf_repid LIKE sy-repid.
IF sy-repid NE lf_repid.
LOAD REPORT sy-repid PART 'SSCR' INTO lt_sscr.
lf_repid = sy-repid.
ENDIF.
LOOP AT SCREEN.
CHECK screen-group3 EQ 'TXT'.
ASSIGN (screen-name) TO <sn>.
CHECK sy-subrc EQ 0.
ENDFORM.
"selection_screen_output
*&---------------------------------------------------------------------*
*&
Form get_tables
*&---------------------------------------------------------------------*
FORM get_tables .
DATA: lr_table_type
lr_line_type
lt_comp
ls_comp
ls_table
TYPE
TYPE
TYPE
LIKE
LIKE
REF TO cl_abap_tabledescr,
REF TO cl_abap_structdescr,
cl_abap_structdescr=>component_table,
LINE OF lt_comp,
LINE OF gt_tables,
lt_dd01l
lt_dd02t
ls_dfies
lt_domname
TYPE
TYPE
TYPE
TYPE
'CDSOLMIG_HDR-OBJECTID',
'CDSOLMIG_HDR-OBJECTID',
'CUCO-OBJEK'.
ENDIF.
IF 'AENNR' IN domain.
addfield: 'JEST-OBJNR'.
ENDIF.
ENDIF.
CHECK gt_tables[] IS NOT INITIAL.
SORT gt_tables.
SELECT tabname ddtext
FROM dd02t INTO CORRESPONDING FIELDS OF TABLE lt_dd02t
FOR ALL ENTRIES IN gt_tables
WHERE tabname
EQ gt_tables-tabname
AND ddlanguage EQ sy-langu.
SORT lt_dd02t BY tabname.
LOOP AT gt_tables ASSIGNING <ls_table>.
READ TABLE lt_dd02t WITH KEY tabname = <ls_table>-tabname
BINARY SEARCH.
IF sy-subrc EQ 0.
<ls_table>-ddtext = lt_dd02t-ddtext.
ENDIF.
*
*
* compare domains
READ TABLE lt_dd01l INDEX 1.
LOOP AT lt_dd01l FROM 2 WHERE
OR
OR
OR
OR
OR
OR
EXIT.
ENDLOOP.
datatype
leng
outputlen
decimals
lowercase
signflag
convexit
NE
NE
NE
NE
NE
NE
NE
lt_dd01l-datatype
lt_dd01l-leng
lt_dd01l-outputlen
lt_dd01l-decimals
lt_dd01l-lowercase
lt_dd01l-signflag
lt_dd01l-convexit.
IF sy-subrc NE 0.
all domains are similar -> input conversion
MOVE-CORRESPONDING lt_dd01l TO ls_dfies.
LOOP AT values.
PERFORM input_conversion USING ls_dfies
CHANGING: values-low,
values-high.
MODIFY values.
ENDLOOP.
ENDIF.
ENDFORM.
" get_tables
*&--------------------------------------------------------------------*
*&
Form show_tables
*&--------------------------------------------------------------------*
*
show result of gt_table in popup.
*---------------------------------------------------------------------*
FORM show_tables.
DATA: lr_table
lr_columns
lr_column
lr_functions
TYPE
TYPE
TYPE
TYPE
REF
REF
REF
REF
TO
TO
TO
TO
cl_salv_table,
cl_salv_columns,
cl_salv_column_table,
cl_salv_functions.
TRY.
cl_salv_table=>factory(
IMPORTING
r_salv_table = lr_table
CHANGING
t_table
= gt_tables ).
lr_columns = lr_table->get_columns( ).
lr_columns->set_optimize( abap_true ).
lr_column ?= lr_columns->get_column( 'ROW' ).
lr_column->set_technical( abap_true ).
lr_column ?= lr_columns->get_column( 'SELKZ' ).
lr_column->set_technical( abap_true ).
lr_column ?= lr_columns->get_column( 'EDIT' ).
lr_column->set_technical( abap_true ).
lr_column ?= lr_columns->get_column( 'COL' ).
lr_column->set_technical( abap_true ).
lr_column ?= lr_columns->get_column( 'COUNT' ).
lr_column->set_zero( abap_false ).
CATCH cx_salv_msg.
CATCH cx_salv_not_found.
CATCH cx_salv_existing cx_salv_wrong_call.
ENDTRY.
lr_functions = lr_table->get_functions( ).
lr_functions->set_all( abap_true ).
lr_table->set_screen_popup(
start_column = 2
end_column = 100
start_line = 2
end_line
= 40 ).
"#EC NO_HANDLER
"#EC NO_HANDLER
lr_table->display( ).
ENDFORM.
"show_tables
*&--------------------------------------------------------------------*
*&
Form input_conversion
*&--------------------------------------------------------------------*
FORM input_conversion USING is_dfies TYPE dfies
CHANGING ch_value.
DATA lc_func TYPE funcname VALUE 'SMAN_IF_CONVERT_TO_INTERN'.
CALL FUNCTION lc_func
EXPORTING
ls_struc
=
ld_input_value =
IMPORTING
ld_output_value =
EXCEPTIONS
OTHERS
=
is_dfies
ch_value
ch_value
0.
IF is_dfies-lowercase IS INITIAL.
TRANSLATE ch_value TO UPPER CASE.
ENDIF.
ENDFORM.
"#EC TRANSLANG
"input_conversion
*&--------------------------------------------------------------------*
*&
Form select_data
*&--------------------------------------------------------------------*
FORM select_data.
types: ch72(72).
DATA: lf_total TYPE sydbcnt,
lf_percentage TYPE i,
lt_where TYPE TABLE OF ch72 WITH HEADER LINE.
FIELD-SYMBOLS: <lt_entries> TYPE ANY TABLE.
DESCRIBE TABLE gt_tables LINES lf_total.
CHECK <gs_table>-fieldname IS NOT INITIAL.
lf_percentage = sy-tabix * 100 / lf_total.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = lf_percentage
text
= <gs_table>-tabname.
*
"#EC NOTEXT
<gs_table>-count = sy-dbcnt.
IF <gs_table>-count NE 0.
SORT <lt_entries>. "not during SELECT cause of performance
PERFORM append_col_column. "convert entries, create entries2
ENDIF.
ENDFORM.
"select_data
*&--------------------------------------------------------------------*
*&
Form write_result
*&--------------------------------------------------------------------*
FORM write_result.
DATA: lf_length TYPE syfleng,
lt_dfies TYPE TABLE OF dfies WITH HEADER LINE.
FIELD-SYMBOLS: <ls_table> LIKE LINE OF gt_tables,
<lt_entries> TYPE ANY TABLE,
<ls_entry_now> TYPE any,
<lf_field> TYPE any.
*
'DDIF_FIELDINFO_GET'
= <ls_table>-tabname
= lt_dfies
= 0.
"write_result
*&--------------------------------------------------------------------*
*&
Form alv_show
*&--------------------------------------------------------------------*
FORM alv_show.
DATA: lf_panes TYPE sylinno,
EXPORTING
row
= sy-index
column
= 1
RECEIVING
container = l_container.
CREATE OBJECT ls_sub_splitter-container
EXPORTING
parent
= l_container
rows
= lf_panes
columns
= 1
no_autodef_progid_dynnr = space
EXCEPTIONS
others
= 1.
ls_sub_splitter-container->set_row_mode(
cl_gui_splitter_container=>mode_absolute ).
ls_sub_splitter-container->set_border( space ).
APPEND ls_sub_splitter TO gt_sub_splitter.
ENDDO.
*
ENDFORM.
"alv_show
*&--------------------------------------------------------------------*
*&
Form alv_show_loop
*&--------------------------------------------------------------------*
FORM alv_show_loop.
DATA: lf_column TYPE sycolno,
lf_splitter TYPE sytabix,
lf_count TYPE sydbcnt,
lf_max
TYPE sydbcnt VALUE 16,
l_splitter_container TYPE REF TO cl_gui_container.
FIELD-SYMBOLS: <l_sub_splitter> LIKE LINE OF gt_sub_splitter.
LOOP AT gt_sub_splitter ASSIGNING <l_sub_splitter>.
CLEAR <l_sub_splitter>-height.
ENDLOOP.
LOOP AT gt_tables ASSIGNING <gs_table> WHERE count NE 0.
ADD 1 TO lf_count.
lf_column = 1.
lf_splitter
= ( lf_count DIV lf_max ) + 1.
<gs_table>-row = lf_count MOD lf_max.
IF <gs_table>-row EQ 0.
<gs_table>-row = lf_max.
create alv-grid
IF <gs_table>-alv IS INITIAL.
CREATE OBJECT <gs_table>-alv
EXPORTING
i_parent = l_splitter_container.
SET HANDLER:
g_event_receiver->handle_user_command FOR <gs_table>-alv,
g_event_receiver->handle_toolbar
FOR <gs_table>-alv,
g_event_receiver->handle_double_click FOR <gs_table>-alv.
ENDIF.
PERFORM set_pane_height USING <gs_table>.
PERFORM set_table_for_first_display.
<l_sub_splitter>-height
50
"Header, toolar
19 * <gs_table>-count "Entries
20.
"Scrollbar
ADD 4 TO <l_sub_splitter>-height.
"separator
"alv_show_loop
*&--------------------------------------------------------------------*
*&
Form set_table_for_first_display
*&--------------------------------------------------------------------*
FORM set_table_for_first_display.
DATA: ls_layout TYPE lvc_s_layo,
ls_variant TYPE disvariant,
cl_gui_alv_grid=>mc_mb_export
cl_gui_alv_grid=>mc_mb_subtot
cl_gui_alv_grid=>mc_mb_sum
cl_gui_alv_grid=>mc_mb_view
cl_gui_alv_grid=>mc_fc_graph
cl_gui_alv_grid=>mc_fc_info
cl_gui_alv_grid=>mc_fc_print
TO
TO
TO
TO
TO
TO
TO
lt_exclude.
lt_exclude.
lt_exclude.
lt_exclude.
lt_exclude.
lt_exclude.
lt_exclude.
ls_layout-sel_mode = 'A'.
ls_layout-cwidth_opt = 'X'.
ls_layout-ctab_fname = gc_col_column.
ASSIGN <gs_table>-entries->* TO <lt_entries>.
*
*
TYPE
TYPE
TYPE
TYPE
TYPE
TABLES
fields_to_containers
containers
flow_logic
EXCEPTIONS
OTHERS
ls_dynp_header-program
ls_dynp_header-screen
ls_dynp_header-lines
ls_dynp_header-columns
=
=
=
=
= lt_dynp_fields
= lt_containers
= lt_flow_logic
= 0.
sy-repid.
i_dynnr.
80.
150.
CASE i_dynnr.
WHEN gc_alv_screen.
LOOP AT gt_tables ASSIGNING <gs_table> WHERE count NE 0.
lf_count = lf_count
+ '0.9' * <gs_table>-count
+ '3.4'.
ENDLOOP.
ADD 2 TO lf_count.
IF lf_count > 255.
* MESSAGE w398(00) WITH 'Hit list does not match on the screen.'.
lf_count = 255.
ENDIF.
ls_dynp_header-lines
lt_containers-line
lt_containers-column
lt_containers-length
lt_containers-height
MODIFY lt_containers
= lf_count.
= 1.
= 1.
= ls_dynp_header-columns.
= ls_dynp_header-lines.
TRANSPORTING line column length height
WHERE name = 'CONT1'.
WHEN gc_list_screen.
DELETE lt_containers WHERE name = 'CONT1'.
lf_count = 80.
ENDCASE.
CALL FUNCTION 'RPY_DYNPRO_INSERT'
EXPORTING
suppress_corr_checks
= 'X'
suppress_exist_checks
= 'X'
suppress_dict_support
= 'X'
suppress_extended_checks = 'X'
header
= ls_dynp_header
TABLES
containers
= lt_containers
fields_to_containers
= lt_dynp_fields
flow_logic
= lt_flow_logic
EXCEPTIONS
OTHERS
= 0.
ENDFORM.
"generate_screen
*&--------------------------------------------------------------------*
*&
Form set_height
*&--------------------------------------------------------------------*
FORM set_pane_height USING ls_table TYPE ty_table.
DATA: lf_height TYPE i.
lf_height = 50
+ 19 * ls_table-count
+ 20.
"Header, toolar
"Entries
"Scrollbar
EQ
EQ
EQ
EQ
EQ
EQ
'BACK'
'%EX'
'%SC'
'RW'
'SOUP'
'SODO'
OR
OR
OR
OR
OR
table_line
table_line
table_line
table_line
table_line
EQ
EQ
EQ
EQ
EQ
'HILF'
'MARK'
'DMAR'
'REFR'
'FNAM'.
ENDIF.
SET PF-STATUS i_status OF PROGRAM lc_program
EXCLUDING lt_cua_exclude.
* READ TABLE values INDEX 1.
* CONCATENATE sy-repid ' (' values-low ')' INTO l_title.
CONDENSE level NO-GAPS.
IF level IS INITIAL.
l_title = sy-repid.
ELSE.
CONCATENATE sy-repid ' (' level ')' INTO l_title.
ENDIF.
SET TITLEBAR 'POP' OF PROGRAM 'SAPLKKBL' WITH l_title.
ENDFORM.
"status
*&---------------------------------------------------------------------*
*&
Module USER_COMMAND INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
MODULE pai INPUT.
PERFORM user_command.
ENDMODULE.
" USER_COMMAND INPUT
*&---------------------------------------------------------------------*
*&
Form user_command
*&---------------------------------------------------------------------*
*
handle button from global applicatio toolbar
*----------------------------------------------------------------------*
FORM user_command.
DATA: lc_edit
lf_system
lt_rows
ls_row
ls_col
TYPE
TYPE
TYPE
TYPE
TYPE
CASE ok_code.
WHEN 'BACK' OR 'ENTR'.
CLEAR sy-ucomm.
LEAVE TO SCREEN 0.
WHEN 'MARK' OR 'DMAR'.
LOOP AT gt_tables ASSIGNING <gs_table>
WHERE alv IS NOT INITIAL.
REFRESH lt_rows.
IF ok_code EQ 'MARK'.
DO <gs_table>-count TIMES.
ls_row-row_id = sy-index.
APPEND ls_row TO lt_rows.
ENDDO.
ENDIF.
<gs_table>-alv->set_selected_rows( it_row_no = lt_rows ).
ENDLOOP.
WHEN '%SC'. "search
*
*
*
*
*
*
*
*
*
no_systemtype = 2.
IF lf_system NE lc_edit+1(3).
MESSAGE i031(s_cus_img_tool).
sy-subrc = 1.
ENDIF.
IF sy-subrc EQ 0.
AUTHORITY-CHECK OBJECT 'S_DEVELOP'
ID 'ACTVT'
FIELD '01'
ID 'OBJTYPE' FIELD 'DEBUG'
ID 'DEVCLASS' DUMMY
ID 'OBJNAME' DUMMY
ID 'P_GROUP' DUMMY.
ENDIF.
IF sy-subrc EQ 0.
AUTHORITY-CHECK OBJECT 'S_DEVELOP'
ID 'ACTVT'
FIELD '02'
ID 'OBJTYPE' FIELD 'DEBUG'
ID 'DEVCLASS' DUMMY
ID 'OBJNAME' DUMMY
ID 'P_GROUP' DUMMY.
ENDIF.
IF sy-subrc EQ 0.
AUTHORITY-CHECK OBJECT 'S_DEVELOP'
ID 'ACTVT'
FIELD '03'
ID 'OBJTYPE' FIELD 'DEBUG'
ID 'DEVCLASS' DUMMY
ID 'OBJNAME' DUMMY
ID 'P_GROUP' DUMMY.
ENDIF.
IF sy-subrc EQ 0.
g_with_edit = abap_true.
ELSE.
g_with_edit = abap_false.
MESSAGE i202(37).
ENDIF.
LOOP AT gt_tables ASSIGNING <gs_table> WHERE count NE 0.
<gs_table>-alv->refresh_table_display( ).
ENDLOOP.
WHEN OTHERS.
RETURN.
ENDCASE.
CLEAR ok_code.
ENDFORM.
" user_command
*&--------------------------------------------------------------------*
*&
Form refresh_table
*&--------------------------------------------------------------------*
FORM refresh_table.
DATA: ls_col
lt_col_red
lt_col_green
lr_line_type
lr_table_type
lt_comp
ls_comp
dref
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
LIKE
TYPE
lvc_s_scol,
lvc_t_scol,
lvc_t_scol,
REF TO cl_abap_structdescr,
REF TO cl_abap_tabledescr,
cl_abap_structdescr=>component_table,
LINE OF lt_comp,
REF TO data.
DATA: lf_force_refresh.
FIELD-SYMBOLS: <lt_entries_now>
<lt_entries_before>
<ls_entry_now>
<ls_entry_before>
<ls_key>
<lf_field_now>
<lf_field_before>
<lt_col>
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
TYPE
STANDARD TABLE,
STANDARD TABLE,
any,
any,
any,
any,
any,
lvc_t_scol.
<lt_col> = lt_col_green.
ENDLOOP.
"refresh_tables
*&--------------------------------------------------------------------*
*&
Form search_value
*&--------------------------------------------------------------------*
FORM search_value USING i_pattern.
DATA: ls_elem_descr TYPE
ls_struct_descr TYPE
ls_comp_descr TYPE
ls_col
TYPE
lf_character(200),
lf_found.
REF TO cl_abap_elemdescr,
REF TO cl_abap_structdescr,
LINE OF abap_compdescr_tab,
lvc_s_scol,
lt_comp
ls_comp
dref
TYPE cl_abap_structdescr=>component_table,
LIKE LINE OF lt_comp,
TYPE REF TO data.
FIELD-SYMBOLS: <lt_entries_now>
<lt_entries_before>
<ls_entry_now>
<ls_entry_before>
TYPE
TYPE
TYPE
TYPE
STANDARD TABLE,
STANDARD TABLE,
any,
any.
ENDFORM.
"append_col_column