Você está na página 1de 13

*&---------------------------------------------------------------------* *& Report ZBR_MM_MATERIAIS_IPEL *& *&---------------------------------------------------------------------* *& EMPRESA: LETNIS *& RESPONSAVEL: HERMIRO MANOEL DA SILVA CARVALHO

*& DATA: 13/06/2011 *& DESCRIO: ESTE REPORT VAI DESCREVER TODOS OS PRODUTOS SOB CUSTDIA *& DA INPEL, CONFORME DESCRITO NO DOCUMENTO FUNCIONAL . *& *&---------------------------------------------------------------------* REPORT zbr_mm_materiais_ipel NO STANDARD PAGE HEADING. TABLES : zbr_mm_matemparc, zbr_mm_matprcfop, kna1, lfa1, makt, j_1bnflin. TYPE-POOLS: vrm, slis. *********************************************************************** *** TIPOS *********************************************************************** TYPES: BEGIN OF ty_zbr_mm_matemparc, material TYPE zbr_mm_matemparc-material, lote TYPE zbr_mm_matemparc-lote, parc_comercial TYPE zbr_mm_matemparc-parc_comercial, tipo_parceiro TYPE zbr_mm_matemparc-tipo_parceiro, notafiscal_saida TYPE zbr_mm_matemparc-notafiscal_saida, serie_nf TYPE zbr_mm_matemparc-serie_nf, data_nffiscal TYPE zbr_mm_matemparc-data_nffiscal, cfop TYPE zbr_mm_matemparc-cfop, quantidade TYPE zbr_mm_matemparc-quantidade, notafiscal_entr TYPE zbr_mm_matemparc-notafiscal_entr, serie_nf_entr TYPE zbr_mm_matemparc-serie_nf_entr, data_nffiscal_en TYPE zbr_mm_matemparc-data_nffiscal_en, quantidade_entr TYPE zbr_mm_matemparc-quantidade_entr, END OF ty_zbr_mm_matemparc. TYPES: BEGIN OF ty_saida, marc material lote descricao(20) parc_comercial tipo_parceiro notafiscal_saida serie_nf data_nffiscal cfop quantidade quantidade_pen(16) data_limite notafiscal_entr serie_nf_entr data_nffiscal_en quantidade_entr docnum END OF ty_saida. TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE c, zbr_mm_matemparc-material, zbr_mm_matemparc-lote, c, zbr_mm_matemparc-parc_comercial, c, zbr_mm_matemparc-notafiscal_saida, zbr_mm_matemparc-serie_nf, zbr_mm_matemparc-data_nffiscal, zbr_mm_matemparc-cfop, zbr_mm_matemparc-quantidade, p DECIMALS 3, date, zbr_mm_matemparc-notafiscal_entr, zbr_mm_matemparc-serie_nf_entr, zbr_mm_matemparc-data_nffiscal_en, zbr_mm_matemparc-quantidade_entr, j_1bnflin-docnum,

*********************************************************************** *** CONSTANTES *********************************************************************** DATA: c_x c_e c_s c_nao(13) c_tipo TYPE TYPE TYPE TYPE TYPE c VALUE 'X', c VALUE 'E', c VALUE 'S', c VALUE 'No Informado', dd07v-domname VALUE 'J_1BPARTYP'.

*********************************************************************** *** TABELAS INTERNAS *********************************************************************** DATA: t_zbr_mm_matemparc t_kna1 t_lfa1 t_makt t_j1bnflin t_zbr_mm_matprcfop t_saida t_listheader t_fieldcat TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TABLE OF ty_zbr_mm_matemparc, TABLE OF kna1, TABLE OF lfa1, TABLE OF makt, TABLE OF j_1bnflin, TABLE OF zbr_mm_matprcfop, TABLE OF ty_saida, slis_t_listheader, slis_t_fieldcat_alv.

*********************************************************************** *** WORK-AREAS *********************************************************************** DATA: wa_dados_fieldcat wa_header wa_zbr_mm_matemparc wa_zbr_mm_matprcfop wa_makt wa_j1bnflin DATA: BEGIN OF wa_saida, mark material lote descricao(20) parc_comercial tipo_parceiro notafiscal_saida serie_nf data_nffiscal cfop quantidade quantidade_pen(16) data_limite notafiscal_entr serie_nf_entr data_nffiscal_en quantidade_entr docnum END OF wa_saida. TYPE TYPE TYPE TYPE TYPE TYPE slis_fieldcat_alv, slis_listheader, ty_zbr_mm_matemparc, zbr_mm_matprcfop, makt, j_1bnflin.

TYPE LIKE LIKE TYPE LIKE TYPE LIKE LIKE LIKE LIKE LIKE TYPE TYPE LIKE LIKE LIKE LIKE LIKE

c, zbr_mm_matemparc-material, zbr_mm_matemparc-lote, c, zbr_mm_matemparc-parc_comercial, c, zbr_mm_matemparc-notafiscal_saida, zbr_mm_matemparc-serie_nf, zbr_mm_matemparc-data_nffiscal, zbr_mm_matemparc-cfop, zbr_mm_matemparc-quantidade, p DECIMALS 3, date, zbr_mm_matemparc-notafiscal_entr, zbr_mm_matemparc-serie_nf_entr, zbr_mm_matemparc-data_nffiscal_en, zbr_mm_matemparc-quantidade_entr, j_1bnflin-docnum,

********************************************************************** ** VARIVEIS **********************************************************************

DATA: v_flag TYPE c. *********************************************************************** *** TELA DE SELEO *********************************************************************** SELECTION-SCREEN BEGIN OF BLOCK 001 WITH FRAME TITLE text-001. SELECT-OPTIONS: s_mat FOR zbr_mm_matemparc-material OBLIGATORY, s_lote FOR zbr_mm_matemparc-lote, s_pcom FOR zbr_mm_matemparc-parc_comercial, s_nsaida FOR zbr_mm_matemparc-notafiscal_saida, s_serie FOR zbr_mm_matemparc-serie_nf, s_data FOR zbr_mm_matemparc-data_nffiscal, s_cfop FOR zbr_mm_matemparc-cfop. SELECTION-SCREEN END OF BLOCK 001. *********************************************************************** *** AT SELECTION-SCREEN *** VALIDAO DOS DADOS NA TELA. *********************************************************************** IF s_mat SELECT FROM INTO WHERE IS NOT INITIAL. SINGLE Material zbr_mm_matemparc zbr_mm_matemparc Material in s_mat.

IF sy-subrc <> 0. MESSAGE text-002 TYPE c_s. ELSE. PERFORM busca_dados. ENDIF. ENDIF. *&--------------------------------------------------------------------* *& Form BUSCA_DADOS *&--------------------------------------------------------------------* *& Seleciona os dados do banco *---------------------------------------------------------------------* FORM busca_dados . SELECT material lote parc_comercial tipo_parceiro notafiscal_saida serie_nf data_nffiscal cfop quantidade notafiscal_entr serie_nf_entr data_nffiscal_en quantidade_entr INTO CORRESPONDING FIELDS OF TABLE t_zbr_mm_matemparc FROM zbr_mm_matemparc WHERE material in s_mat AND lote in s_lote AND parc_comercial in s_pcom AND notafiscal_saida in s_nsaida AND serie_nf in s_serie AND data_nffiscal_en in s_data AND cfop in s_cfop. SELECT maktx INTO CORRESPONDING FIELDS OF TABLE t_makt FROM makt

FOR ALL ENTRIES IN t_zbr_mm_matemparc WHERE matnr EQ t_zbr_mm_matemparc-material AND spras EQ 'PT'. SELECT cfop num_dias INTO CORRESPONDING FIELDS OF TABLE t_zbr_mm_matprcfop FROM zbr_mm_matprcfop FOR ALL ENTRIES IN t_zbr_mm_matemparc WHERE cfop = t_zbr_mm_matemparc-cfop. SORT: t_zbr_mm_matemparc BY material, t_makt BY matnr, t_zbr_mm_matprcfop BY cfop . SELECT docnum INTO CORRESPONDING FIELDS OF TABLE t_j1bnflin FROM j_1bnflin FOR ALL ENTRIES IN t_zbr_mm_matemparc WHERE charg = t_zbr_mm_matemparc-lote AND cfop = t_zbr_mm_matemparc-cfop AND matnr = t_zbr_mm_matemparc-material AND menge = t_zbr_mm_matemparc-quantidade. IF sy-subrc IS NOT INITIAL. MESSAGE text-003 TYPE c_s. ELSE. PERFORM gera_relatorio. ENDIF. ENDFORM. " BUSCA_DADOS *&--------------------------------------------------------------------* *& Form GERA_RELATORIO *&--------------------------------------------------------------------* *& Le os registros da tabela t_zbr_mm_matemparc e insere os dados den*& tro da tabela de sada. *---------------------------------------------------------------------* FORM gera_relatorio . DATA: ldom1 TYPE l_ddtipo TYPE v_quan TYPE v_quan1 TYPE v_dias TYPE dd07v-domvalue_l, dd07v-ddtext, zbr_mm_matemparc-quantidade, zbr_mm_matemparc-quantidade_entr, zbr_mm_matprcfop-num_dias.

LOOP AT t_zbr_mm_matemparc INTO wa_zbr_mm_matemparc. wa_saida-material = wa_zbr_mm_matemparc-material. wa_saida-lote = wa_zbr_mm_matemparc-lote. wa_saida-parc_comercial = wa_zbr_mm_matemparc-parc_comercial. READ TABLE t_makt INTO wa_makt WITH KEY matnr = wa_zbr_mm_matemparc-material BINARY SEARCH. wa_saida-descricao = wa_makt-maktx. * if wa_zbr_mm_matemparc-tipo_parceiro eq 'C'. * Aguardar posio. * endif. wa_saida-notafiscal_saida = wa_zbr_mm_matemparc-notafiscal_saida. wa_saida-serie_nf = wa_zbr_mm_matemparc-serie_nf. wa_saida-data_nffiscal = wa_zbr_mm_matemparc-data_nffiscal. wa_saida-cfop = wa_zbr_mm_matemparc-cfop. wa_saida-quantidade = wa_zbr_mm_matemparc-quantidade.

v_quan = wa_zbr_mm_matemparc-quantidade. v_quan1 = wa_zbr_mm_matemparc-quantidade_entr. wa_saida-quantidade_pen = v_quan - v_quan1. READ TABLE t_zbr_mm_matprcfop INTO wa_zbr_mm_matprcfop WITH KEY cfop = wa_zbr_mm_matemparc-cfop BINARY SEARCH. v_dias = wa_zbr_mm_matprcfop-num_dias. wa_saida-data_limite = wa_zbr_mm_matemparc-data_nffiscal + v_dias. wa_saida-notafiscal_entr = wa_zbr_mm_matemparc-notafiscal_entr. wa_saida-serie_nf_entr = wa_zbr_mm_matemparc-serie_nf_entr. wa_saida-data_nffiscal_en = wa_zbr_mm_matemparc-data_nffiscal_en. wa_saida-quantidade_entr = wa_zbr_mm_matemparc-quantidade_entr. READ TABLE t_j1bnflin INTO wa_j1bnflin WITH KEY charg = wa_zbr_mm_matemparc-lote cfop = wa_zbr_mm_matemparc-cfop matnr = wa_zbr_mm_matemparc-material menge = wa_zbr_mm_matemparc-quantidade. wa_saida-docnum = wa_j1bnflin-docnum. * APPEND wa_saida. MODIFY t_saida FROM wa_saida. ENDLOOP. IF sy-subrc IS INITIAL. PERFORM monta_relatorio. ENDIF. ENDFORM. " GERA_RELATORIO *&--------------------------------------------------------------------* *& Form MONTA_RELATORIO *&--------------------------------------------------------------------* *& Monta o fieldcat e gera o relatrio na tela. *---------------------------------------------------------------------* FORM monta_relatorio . DATA: vl_repid TYPE sy-repid, vl_layout TYPE slis_layout_alv. MOVE: c_e TO vl_layout-zebra, c_e TO vl_layout-colwidth_optimize. vl_repid = sy-repid. CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' EXPORTING i_program_name = vl_repid i_internal_tabname = 'WA_SAIDA' i_inclname = vl_repid CHANGING ct_fieldcat = t_fieldcat EXCEPTIONS inconsistent_interface = 1 program_error = 2 OTHERS = 3. PERFORM alterar_fieldcat. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING i_callback_program = vl_repid

i_callback_top_of_page i_callback_user_command i_callback_pf_status_set is_layout it_fieldcat TABLES t_outtab

= = = = =

'ZF_TOP_OF_PAGE' 'COMANDO_USUARIO' 'Z_STATUS' vl_layout t_fieldcat

= t_saida.

ENDFORM. " MONTA_RELATORIO *&--------------------------------------------------------------------* *& Form ALTERAR_FIELDCAT *&--------------------------------------------------------------------* *& Formata o fieldcat para incluir no alv. *---------------------------------------------------------------------* FORM alterar_fieldcat . DATA: wa_fcat TYPE slis_fieldcat_alv. SORT t_fieldcat BY fieldname. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'MATERIAL' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l wa_fcat-seltext_m wa_fcat-seltext_s wa_fcat-hotspot MODIFY t_fieldcat ENDIF. = 'Material'. = 'Material'. = 'Material'. = c_x. " Cria links FROM wa_fcat INDEX sy-tabix.

READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'LOTE' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l = 'Lote'. wa_fcat-seltext_m = 'Lote'. wa_fcat-seltext_s = 'Lote'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'DESCRICAO' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l = 'Descrio'. wa_fcat-seltext_m = 'Descrio'. wa_fcat-seltext_s = 'Descrio'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF.

READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'PARC_COMERCIAL' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l = 'Parceiro Comercial'. wa_fcat-seltext_m = 'Parc. Comercial'. wa_fcat-seltext_s = 'Parc. Comercial'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'TIPO_PARCEIRO' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l wa_fcat-seltext_m wa_fcat-seltext_s wa_fcat-no_out = = = = 'Razo Social'. 'Razo Social'. 'Razo Soc.'. 'X'.

MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'DOCNUM' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l wa_fcat-seltext_m wa_fcat-seltext_s wa_fcat-no_out = = = = 'N Documento'. 'N Documento'. 'N Documento'. 'X'."Oculta o campo no alv.

MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'NOTAFISCAL_SAIDA' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l = 'Nota Fiscal. Saida'. wa_fcat-seltext_m = 'Nota F. Saida'. wa_fcat-seltext_s = 'NF. Saida'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'SERIE_NF' BINARY SEARCH. IF sy-subrc = 0.

wa_fcat-seltext_l = 'Serie NF.'. wa_fcat-seltext_m = 'Serie NF.'. wa_fcat-seltext_s = 'Serie NF.'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'DATA_NFFISCAL' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l = 'Data Nota Fiscal Entrada.'. wa_fcat-seltext_m = 'Data NF. Entr.'. wa_fcat-seltext_s = 'Data NF.'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'CFOP' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l = 'CFOP'. wa_fcat-seltext_m = 'CFOP'. wa_fcat-seltext_s = 'CFOP'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'QUANTIDADE' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l = 'Quantidade'. wa_fcat-seltext_m = 'Quantidade'. wa_fcat-seltext_s = 'Quantidade'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'QUANTIDADE_PEN' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l = 'Quantidade Pendente'. wa_fcat-seltext_m = 'Quantidade Pend.'. wa_fcat-seltext_s = 'Quant. Pend.'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF.

READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'DATA_LIMITE' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l = 'Data Limite'. wa_fcat-seltext_m = 'Data Limite'. wa_fcat-seltext_s = 'Data Limite'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'NOTAFISCAL_ENTR' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l = 'Nota Fiscal Entrada'. wa_fcat-seltext_m = 'NF. Entrada'. wa_fcat-seltext_s = 'NF. Entrada'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'SERIE_NF_ENTR' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l = 'Serie NF. Entrada'. wa_fcat-seltext_m = 'Serie NF. Entrada'. wa_fcat-seltext_s = 'Serie NF. Entrada'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'DATA_NFFISCAL_EN' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l = 'Data NF. Entrada'. wa_fcat-seltext_m = 'Data NF. Entrada'. wa_fcat-seltext_s = 'Data NF. Entrada'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. READ TABLE t_fieldcat INTO wa_fcat WITH KEY fieldname = 'QUANTIDADE_ENTR' BINARY SEARCH. IF sy-subrc = 0. wa_fcat-seltext_l = 'Quantidade Entrada'. wa_fcat-seltext_m = 'Quant. Entrada'.

wa_fcat-seltext_s = 'Quant. Entrada'. MODIFY t_fieldcat FROM wa_fcat INDEX sy-tabix. ENDIF. ENDFORM. " ALTERAR_FIELDCAT *&--------------------------------------------------------------------* *& Form ZF_TOP_OF_PAGE *&--------------------------------------------------------------------* *& Cabealho do relatrio. *---------------------------------------------------------------------* FORM zf_top_of_page . CHECK v_flag IS INITIAL. ** Ttulo DATA: vl_mate(30) vl_lote(30) vl_parc(30) vl_saida(15) vl_serie(15) vl_data(24) vl_data1(10) vl_data2(10) vl_cfop(15) TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE c, c, c, c, c, c, c, c, c.

wa_header-typ = 'H'. wa_header-info = 'Relatrio: Controle de Materiais - IPEL'. APPEND wa_header TO t_listheader. CLEAR wa_header. * Data wa_header-typ = 'S'. wa_header-key = 'Data: '. CONCATENATE sy-datum+6(2) '.' sy-datum+4(2) '.' sy-datum(4) INTO wa_header-info. "todays date APPEND wa_header TO t_listheader. CLEAR: wa_header. *DADOS DIGITADOS - MATERIAIS vl_mate = s_mat. REPLACE 'IEQ' WITH '' INTO vl_mate. wa_header-typ = 'S'. wa_header-key = 'Material: '. wa_header-info = vl_mate. APPEND wa_header TO t_listheader. CLEAR: wa_header. *DADOS DIGITADOS - LOTE IF s_lote IS INITIAL. wa_header-typ = 'S'. wa_header-key = 'Lote: '. wa_header-info = c_nao. APPEND wa_header TO t_listheader. CLEAR: wa_header.

ELSE. vl_lote = s_lote. REPLACE 'IEQ' WITH '' INTO vl_lote. wa_header-typ = 'S'. wa_header-key = 'Lote: '. wa_header-info = vl_lote. APPEND wa_header TO t_listheader. CLEAR: wa_header. ENDIF. *DADOS DIGITADOS - PARC. COMERCIAL. IF s_pcom IS INITIAL. wa_header-typ = 'S'. wa_header-key = 'Parceiro Comercial: '. wa_header-info = c_nao. APPEND wa_header TO t_listheader. CLEAR: wa_header. ELSE. vl_parc = s_pcom. REPLACE 'IEQ' WITH '' INTO vl_parc. wa_header-typ = 'S'. wa_header-key = 'Parceiro Comercial: '. wa_header-info = vl_parc. APPEND wa_header TO t_listheader. CLEAR: wa_header. ENDIF. *DADOS DIGITADOS - NF SAIDA. IF s_nsaida IS INITIAL. wa_header-typ = 'S'. wa_header-key = 'Nota Fiscal : '. wa_header-info = c_nao. APPEND wa_header TO t_listheader. CLEAR: wa_header. ELSE. vl_saida = s_nsaida. REPLACE 'IEQ' WITH '' INTO vl_saida. wa_header-typ = 'S'. wa_header-key = 'Nota Fiscal : '. wa_header-info = vl_saida. APPEND wa_header TO t_listheader. CLEAR: wa_header. ENDIF. *DADOS DIGITADOS - SERIE. IF s_serie IS INITIAL. wa_header-typ = 'S'. wa_header-key = 'Serie : '. wa_header-info = c_nao. APPEND wa_header TO t_listheader. CLEAR: wa_header. ELSE. vl_serie = s_serie. REPLACE 'IEQ' WITH '' INTO vl_serie. wa_header-typ = 'S'. wa_header-key = 'Serie : '. wa_header-info = vl_serie. APPEND wa_header TO t_listheader.

CLEAR: wa_header. ENDIF. *DADOS DIGITADOS - DATA. IF s_data IS INITIAL. wa_header-typ = 'S'. wa_header-key = 'Data : '. wa_header-info = c_nao. APPEND wa_header TO t_listheader. CLEAR: wa_header. ELSE. CONCATENATE s_data-low+6(2) '.' s_data-low+4(2) '.' s_data-low(4) INTO vl_data1. CONCATENATE s_data-high+6(2) '.' s_data-high+4(2) '.' s_data-high(4) INTO vl_data2. CONCATENATE vl_data1 'a' vl_data2 INTO vl_data SEPARATED BY space. REPLACE 'IBT' WITH '' INTO vl_data. wa_header-typ = 'S'. wa_header-key = 'Data : '. wa_header-info = vl_data. APPEND wa_header TO t_listheader. CLEAR: wa_header. ENDIF. *DADOS DIGITADOS - CFOP. IF s_cfop IS INITIAL. wa_header-typ = 'S'. wa_header-key = 'CFOP: '. wa_header-info = c_nao. APPEND wa_header TO t_listheader. CLEAR: wa_header. ELSE. vl_cfop = s_cfop. REPLACE 'IEQ' WITH '' INTO vl_cfop. wa_header-typ = 'S'. wa_header-key = 'CFOP: '. wa_header-info = vl_cfop. APPEND wa_header TO t_listheader. CLEAR: wa_header. ENDIF. CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE' EXPORTING it_list_commentary = t_listheader. * i_logo = 'ENJOYSAP_LOGO'. v_flag = 'X'. ENDFORM. " ZF_TOP_OF_PAGE *&--------------------------------------------------------------------* *& Form COMANDO_USUARIO *&--------------------------------------------------------------------* *& BOTES DO USURIO NA TELA. *---------------------------------------------------------------------* FORM comando_usuario. DATA: p_selfield TYPE slis_selfield.

CASE sy-ucomm. WHEN '&J1B3N'. READ TABLE t_saida INTO wa_saida INDEX p_selfield-tabindex. SET PARAMETER ID: 'DOCNUM' FIELD wa_saida-docnum. CALL TRANSACTION 'J1B3N' AND SKIP FIRST SCREEN. ENDCASE. ENDFORM. " COMANDO_USUARIO *&--------------------------------------------------------------------* *& Form Z_STATUS *&--------------------------------------------------------------------* *& Seta o Pf-Status. *---------------------------------------------------------------------* FORM z_status USING rt_extab TYPE slis_t_extab. SET PF-STATUS 'MATERIAIS_IPEL'. ENDFORM. " Z_STATUS