lt_fcat IMPORTING et_fieldcat_lvc = t_fcat TABLES it_data = <fs_data> EXCEPTIONS it_data_missing = 1 OTHERS = 2. ENDIF.* Edita os campos que nao sao chaves if p_ver = ''. perform f_edita_campos. endif.* Identifica os campso chave perform f_campos_chave.ENDFORM. " F_FCAT_OO*&---------------------------------------------------------------------**& Form F_LAYOUT*&---------------------------------------------------------------------*FORM f_layout . concatenate 'Tabela -' p_tab into st_layout-grid_title separated by space. st_layout-zebra = 'X'. st_layout-cwidth_opt = 'X'.ENDFORM. " F_LAYOUT*&---------------------------------------------------------------------**& Module STATUS_9999 OUTPUT*&---------------------------------------------------------------------*MODULE status_9999 OUTPUT. SET PF-STATUS 'PF_9999'. SET TITLEBAR '999'.ENDMODULE. " STATUS_9999 OUTPUT*&---------------------------------------------------------------------**& Module INITIAL_9999 OUTPUT*&---------------------------------------------------------------------*MODULE initial_9999 OUTPUT. IF o_docking IS NOT BOUND.* Aqui que encontramos a parte mais importante desse post, esse objeto* docking que sera criado tera a tela chamada(9999) como referencia,* o parametro 'extension' sera o tamanho do uso da tela. CREATE OBJECT o_docking EXPORTING repid = sy-repid dynnr = sy-dynnr extension = 2000 " Tela Full rs " Extension EXCEPTIONS cntl_error = 1 cntl_system_error = 2 create_error = 3 lifetime_error = 4 lifetime_dynpro_dynpro_link = 5 OTHERS = 6. ENDIF. IF o_alv IS NOT BOUND.* Criacao da catalogo de campos PERFORM f_fcat_oo.* Alimentacao dos parametros do Layout do alv PERFORM f_layout.* Criacao do alv com referencia no Objeto Docking criado anteriormente CREATE OBJECT o_alv 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.* Exibicao do alv o_alv->set_table_for_first_display( EXPORTING i_save = 'A' " Save Layout i_default = 'X' " Default Display Variant is_layout = st_layout " Layout CHANGING it_outtab = <fs_data> " Output Table it_fieldcatalog = t_fcat " Field Catalog EXCEPTIONS invalid_parameter_combination = 1 program_error = 2 too_many_lines = 3 OTHERS = 4 ).* Caso o alv ja tenha sido criado ELSE.* Atualizacao do alv. o_alv->refresh_table_display( EXCEPTIONS finished = 1 OTHERS = 2 ). ENDIF.ENDMODULE. " INITIAL_9999 OUTPUT*&---------------------------------------------------------------------**& Module EXIT_COMMAND_9999 INPUT*&---------------------------------------------------------------------*MODULE exit_command_9999 INPUT. CASE sy-ucomm. WHEN 'BACK'. LEAVE TO SCREEN 0. WHEN 'EXIT' OR 'CANCEL'. LEAVE TO SCREEN 0. WHEN OTHERS. ENDCASE.ENDMODULE. " EXIT_COMMAND_9999 INPUT*&---------------------------------------------------------------------**& Form F_BUSCA_FIELDCAT*&---------------------------------------------------------------------*FORM f_busca_fieldcat USING u_structure_name TYPE dd02l-tabname. free: it_fieldcat, it_fieldcat_aux. check u_structure_name(1) = 'Z' or u_structure_name(1) = 'Y' or u_structure_name(6) = '/FNTY/'. CALL FUNCTION 'LVC_FIELDCATALOG_MERGE' EXPORTING i_structure_name = u_structure_name i_client_never_display = 'X' CHANGING ct_fieldcat = it_fieldcat[] EXCEPTIONS inconsistent_interface = 1 program_error = 2 OTHERS = 3.* Cria tabela auxiliar SEM mandante. it_fieldcat_aux[] = it_fieldcat[]. delete it_fieldcat_aux where FIELDNAME = 'MANDT'.ENDFORM. " F_BUSCA_FIELDCAT*&---------------------------------------------------------------------**& Form F_CRIA_TAB_DINAMICA*&---------------------------------------------------------------------*FORM f_cria_tab_dinamica . DATA: lt_alvdata TYPE REF TO data. DATA: lt_alvdata_aux TYPE REF TO data. DATA: lt_alvbkp TYPE REF TO data. DATA: lt_alvbkp_aux TYPE REF TO data. DATA: lt_alvdel TYPE REF TO data. DATA: lt_alvdel_aux TYPE REF TO data.* Monta tabela dinamica CALL METHOD cl_alv_table_create=>create_dynamic_table EXPORTING i_style_table = ' ' " tab com as informacoes de campo it_fieldcatalog = it_fieldcat IMPORTING " retorna tab dinamica com campos informados ep_table = it_interface. CALL METHOD cl_alv_table_create=>create_dynamic_table EXPORTING i_style_table = ' ' " tab com as informacoes de campo it_fieldcatalog = it_fieldcat IMPORTING " retorna tab dinamica com campos informados ep_table = it_bkp. CALL METHOD cl_alv_table_create=>create_dynamic_table EXPORTING i_style_table = ' ' " tab com as informacoes de campo it_fieldcatalog = it_fieldcat IMPORTING " retorna tab dinamica com campos informados ep_table = it_del.* Carrega <fs_data> com a estrutura dos campos passados