tadir INTO CORRESPONDING FIELDS OF TABLE gt_tadir WHERE author = sy-uname.* Popula o range do popup de objetos. PERFORM popula_range.* Criacao de do Objeto docking que vai a tela alv CREATE OBJECT o_docking EXPORTING repid = sy-repid dynnr = '9001' extension = 9999 EXCEPTIONS cntl_error = 1 cntl_system_error = 2 create_error = 3 lifetime_error = 4 lifetime_dynpro_dynpro_link = 5 OTHERS = 6.* ALV CREATE OBJECT o_grid EXPORTING i_parent = o_docking " Parent Container EXCEPTIONS error_cntl_create = 1 error_cntl_init = 2 error_cntl_link = 3 error_dp_create = 4 OTHERS = 5. PERFORM add_fieldcatalog_alv_9001 USING :* Col fname tabname texto "Edit "No_out "CheckBox '1' 'SELECTED' 'GT_TADIR' 'Selecao' abap_true abap_false abap_true, '2' 'OBJECT' 'GT_TADIR' 'Tipo' abap_false abap_false abap_false, '3' 'OBJ_NAME' 'GT_TADIR' 'Nome' abap_false abap_false abap_false, '4' 'KORRNUM' 'GT_TADIR' 'Ordem' abap_false abap_false abap_false, '5' 'SRCSYSTEM' 'GT_TADIR' 'Sistema' abap_false abap_false abap_false, '6' 'DEVCLASS' 'GT_TADIR' 'Pacote' abap_false abap_false abap_false. gs_layout-zebra = abap_true. gs_layout-cwidth_opt = abap_true.* Exibe alv o_grid->set_table_for_first_display( EXPORTING is_layout = gs_layout " Layout it_toolbar_excluding = gt_exclude " Excluded Toolbar Standard Functions CHANGING it_outtab = gt_tadir " Output Table it_fieldcatalog = gt_fieldcat " Field Catalog EXCEPTIONS invalid_parameter_combination = 1 program_error = 2 too_many_lines = 3 OTHERS = 4 ). ELSE. o_grid->refresh_table_display( ). ENDIF.ENDMODULE.*&---------------------------------------------------------------------**& Form ADD_FIELDCATALOG_ALV_9001*&---------------------------------------------------------------------*FORM add_fieldcatalog_alv_9001 USING col_pos TYPE lvc_s_fcat-col_pos fieldname TYPE lvc_s_fcat-fieldname tabname TYPE lvc_s_fcat-tabname descricao TYPE lvc_s_fcat-scrtext_s edit TYPE lvc_s_fcat-edit no_out TYPE lvc_s_fcat-no_out checkbox TYPE lvc_s_fcat-checkbox. DATA : ls_fieldcat LIKE LINE OF gt_fieldcat. ls_fieldcat-col_pos = col_pos. ls_fieldcat-fieldname = fieldname. ls_fieldcat-tabname = tabname. ls_fieldcat-scrtext_s = ls_fieldcat-scrtext_m = ls_fieldcat-scrtext_l = descricao. ls_fieldcat-edit = edit. ls_fieldcat-no_out = no_out. ls_fieldcat-checkbox = checkbox. APPEND ls_fieldcat TO gt_fieldcat.ENDFORM.*&---------------------------------------------------------------------**& Module USER_COMMAND_9001 INPUT*&---------------------------------------------------------------------*MODULE user_command_9001 INPUT.* Atualiza a tabela com as alteracoes o_grid->check_changed_data( ). CASE sy-ucomm. WHEN 'BACK' OR 'EXIT'. LEAVE TO SCREEN 0. WHEN 'EXIT' OR 'CANCEL'. LEAVE PROGRAM. WHEN 'MALL'. " Marca todos PERFORM marca_todos_alv. WHEN 'DALL'. " Desmarca Todos. PERFORM desmarcar_todos_alv. ENDCASE.ENDMODULE.*&---------------------------------------------------------------------**& Form DESMARCAR_TODOS_ALV*&---------------------------------------------------------------------*FORM desmarcar_todos_alv . FIELD-SYMBOLS : <tadir> LIKE LINE OF gt_tadir.* Atualiza a tabela com as alteracoes o_grid->check_changed_data( ). LOOP AT gt_tadir ASSIGNING <tadir>. <tadir>-selected = abap_false. ENDLOOP. o_grid->refresh_table_display( ).ENDFORM.*&---------------------------------------------------------------------**& Form MARCA_TODOS_ALV*&---------------------------------------------------------------------*FORM marca_todos_alv . FIELD-SYMBOLS : <tadir> LIKE LINE OF gt_tadir. DATA : lv_all TYPE i, lv_count TYPE i.* PopUp com todas as opcoes de status para identificar quais selecionar PERFORM : popup_com_multipla_escolha. lv_all = lines( gt_tadir ). IF r_object[] IS NOT INITIAL. LOOP AT gt_tadir ASSIGNING <tadir>. IF <tadir>-object IN r_object. <tadir>-selected = abap_true. ADD 1 TO lv_count. ELSE. <tadir>-selected = abap_false. ENDIF. ENDLOOP. gs_layout-grid_title = `Foram selecionadas ` && lv_count && `/` && lv_all && ` registros!`. o_grid->set_frontend_layout( gs_layout ). o_grid->refresh_table_display( ). ENDIF.ENDFORM.*&---------------------------------------------------------------------**& Form POPULA_RANGE*&---------------------------------------------------------------------*FORM popula_range . DATA : lt_tadir TYPE TABLE OF ty_tadir, ls_tadir LIKE LINE OF lt_tadir, ls_popup LIKE LINE OF gt_popup. lt_tadir[] = gt_tadir[]. SORT lt_tadir BY object. DELETE ADJACENT DUPLICATES FROM lt_tadir COMPARING object. LOOP AT lt_tadir INTO ls_tadir. ls_popup-select = abap_true. ls_popup-text = ls_tadir-object. COLLECT ls_popup INTO gt_popup. ENDLOOP.ENDFORM.