**--------------------------------------------------------------------* * flino solu��es em t.i. *--------------------------------------------------------------------* * projeto : migra��o 6.0 * objetivo: controle de processos de qualidade * autor : mariana lara bottazzini / pedro aparecido silva * data : 28/09/2007 * analista: * obs : transa��o: *--------------------------------------------------------------------* report
zmm094_rp message-id zcbr.
*----------------------------------------------------------------------* transparent tables (tabelas transparentes) *----------------------------------------------------------------------tables: ekpo, " linha de cabe�alho pedido mara, " dados gerais de material makt, " textos breves de material lfb1, " mestre de fornecedores (empresa) lfa1, " mestre de fornecedores (parte geral) adr6, wyt3, " endere�os de e-mail (administra��o de endere�os central) mseg. " segmento de documento - material type-pools:
vrm, " value request manager: typen und konstanten slis. " tipos globais para alv *----------------------------------------------------------------------* internal tables (tabelas internas) *----------------------------------------------------------------------data: begin of t_relat occurs 0, lifnr like lfa1-lifnr, " n� conta do fornecedor name1 like lfa1-name1, " nome 1 parvw like wyt3-parvw, telf1 like lfa1-telf1, telfx like lfa1-telfx, addrnumber like adr6-smtp_addr, ebeln like eord-ebeln, bismt like mara-bismt, matnr like mara-matnr, werks like mseg-werks, maktx like makt-maktx, menge like mseg-menge, verkf like lfm1-verkf, adrnr like lfa1-adrnr, stras like lfa1-stras, ort01 like lfa1-ort01, end of t_relat. data: begin of t_material occurs 0, bismt like mara-bismt, matnr like mara-matnr, werks like mseg-werks, maktx like makt-maktx, menge like mseg-menge, end of t_material.
data: begin of t_lfa1 occurs 0, ebeln like eord-ebeln, matnr like eord-matnr, lifnr like lfa1-lifnr, name1 like lfa1-name1, telf1 like lfa1-telf1, telfx like lfa1-telfx, adrnr like lfa1-adrnr, stras like lfa1-stras, ort01 like lfa1-ort01, end of t_lfa1.
" n� conta do fornecedor " nome 1
data: begin of t_lfm1 occurs 0, lifnr like lfm1-lifnr, verkf like lfm1-verkf, end of t_lfm1. data: begin of t_adr6 occurs 0, addrnumber like adr6-smtp_addr, end of t_adr6. data: begin of t_wyt3 occurs 0, parvw like wyt3-parvw, end of t_wyt3. *----------------------------------------------------------------------* tabela estrutura alv *----------------------------------------------------------------------data: t_fieldcat type slis_t_fieldcat_alv with header line, t_header type slis_t_listheader, t_sort type slis_sortinfo_alv occurs 0 with header line, e_layout type slis_layout_alv, v_variant like disvariant, v_print type slis_print_alv. data: t_cabec type slis_t_listheader. data: e_cabec type slis_listheader. *----------------------------------------------------------------------* variables (variaveis) *----------------------------------------------------------------------data: v_data(50) type c. *----------------------------------------------------------------------* selection-screen (tela de sele��o) *----------------------------------------------------------------------selection-screen begin of block b1 with frame title text-001. selection-screen begin of block b2. select-options: p_numero for ekpo-ebeln obligatory, p_mat for mara-matnr, p_werks for mseg-werks. selection-screen end of block b2. selection-screen end of block b1. *-----------------------------------------------------------------------
* top-of-page (cabe�alho) *----------------------------------------------------------------------top-of-page. perform cabecalho. *----------------------------------------------------------------------*main processing - begin (programa principal - in�cio) *----------------------------------------------------------------------start-of-selection. perform seleciona_dados. perform trata_dados. perform monta_alv. perform zebra_alv. perform imprimir. *&---------------------------------------------------------------------* *& form cabecalho *&---------------------------------------------------------------------* form cabecalho . call function 'reuse_alv_commentary_write' exporting it_list_commentary = t_cabec. * i_logo = 'enjoysap_logo'. * i_logo = 'celestica'. endform. " cabecalho *&---------------------------------------------------------------------* *& form heade *&---------------------------------------------------------------------* form heade . e_cabec-typ = 'h'. e_cabec-info = 'relat�Rio de qualidade'. append e_cabec to t_cabec. clear e_cabec. concatenate 'usuario:&' sy-uname translate v_data using '& '. e_cabec-typ = 's'. e_cabec-info = v_data. append e_cabec to t_cabec. clear e_cabec.
into v_data.
concatenate 'data:&' sy-datum+6(02) ':' sy-datum+4(02) ':' sy-datum(04) into v_data. translate v_data using '& '. e_cabec-typ = 's'. e_cabec-info = v_data. append e_cabec to t_cabec. clear e_cabec.
concatenate 'hora:&' sy-uzeit(02) ':' sy-uzeit+2(02) ':' sy-uzeit+4(02) into v_data. translate v_data using '& '. e_cabec-typ = 's'. e_cabec-info = v_data. append e_cabec to t_cabec. clear e_cabec. endform. " heade *&---------------------------------------------------------------------* *& form seleciona_dados *&---------------------------------------------------------------------* form seleciona_dados . select eord~ebeln eord~matnr eord~lifnr lfa1~name1 lfa1~telf1 lfa1~telfx lfa1~adrnr lfa1~stras lfa1~ort01 into table t_lfa1 from eord inner join lfa1 on eord~lifnr eq lfa1~lifnr where eord~ebeln in p_numero and eord~matnr in p_mat. select into from inner on inner on for where
mara~bismt mara~matnr mseg~werks makt~maktx mseg~menge table t_material mara join makt mara~matnr eq makt~matnr join mseg mara~matnr eq mseg~matnr all entries in t_lfa1 mara~matnr eq t_lfa1-matnr and mseg~werks in p_werks.
select into from for where
lifnr table t_wyt3 wyt3 all entries in t_lfa1 lifnr eq t_lfa1-lifnr.
select into from for where
smtp_addr table t_adr6 adr6 all entries in t_lfa1 addrnumber eq t_lfa1-adrnr.
select lifnr verkf into table t_lfm1 from lfm1 for all entries in t_lfa1 where lifnr eq t_lfa1-lifnr.
endform. " seleciona_dados *&---------------------------------------------------------------------* *& form trata_dados *&---------------------------------------------------------------------* form trata_dados . loop at t_lfa1. loop at t_material where matnr = t_lfa1-matnr. move: t_lfa1-ebeln t_lfa1-lifnr t_lfa1-name1 t_lfa1-telf1 t_lfa1-telfx t_lfa1-adrnr t_lfa1-stras t_lfa1-ort01
to to to to to to to to
t_relat-ebeln, t_relat-lifnr, t_relat-name1, t_relat-telf1, t_relat-telfx, t_relat-adrnr, t_relat-stras, t_relat-ort01.
move: t_material-bismt t_material-matnr t_material-maktx t_material-menge t_material-werks
to to to to to
" nome 1
t_relat-bismt, t_relat-matnr, t_relat-maktx, t_relat-menge, t_relat-werks.
read table t_adr6 with key addrnumber = t_lfa1-adrnr. move t_adr6-addrnumber to t_relat-addrnumber. read table t_wyt3 with key parvw = t_lfa1-lifnr. move t_wyt3-parvw to t_relat-parvw. read table t_lfm1 with key lifnr = t_lfa1-lifnr. move t_lfm1-verkf to t_relat-verkf. append t_relat. clear t_relat. endloop. endloop. endform. " trata_dados *&---------------------------------------------------------------------* *& form inserir_no_alv *&---------------------------------------------------------------------* form inserir_no_alv using p_fieldname p_tabname p_inttype p_outputlen p_reptext p_just. clear t_fieldcat. t_fieldcat-fieldname t_fieldcat-tabname t_fieldcat-datatype t_fieldcat-outputlen t_fieldcat-reptext_ddic t_fieldcat-just
= = = = = =
p_fieldname. p_tabname. p_inttype. p_outputlen. p_reptext. p_just.
append t_fieldcat. clear t_fieldcat. endform. " inserir_no_alv *&---------------------------------------------------------------------* *& form monta_alv *&---------------------------------------------------------------------* form monta_alv . clear: t_fieldcat[], "limpa a tabela que recebera os campos do alv. e_layout. "limpa a estrutura que rec. os dados do layout. clear: t_fieldcat. "limpa a header line da t_fieldcat. perform inserir_no_alv using 'lifnr' 't_relat' 'c' '10' 'n� c. fornecedor' 'l'."left perform inserir_no_alv using 'name1' 't_relat' 'c' '35' 'nome do fornecedor' 'l'."left perform inserir_no_alv using 'ebeln' 't_relat' 'c' '10' 'ordem de compra' 'l'."left perform inserir_no_alv using 'werks' 't_relat' 'c' '4' 'centro' 'l'."left perform inserir_no_alv using 'matnr' 't_relat' 'c' '18' 'n� do material cls' 'l'."left perform inserir_no_alv using 'bismt' 't_relat' 'c' '18' 'cli/for' 'l'."left perform inserir_no_alv using 'maktx' 't_relat' 'c'
'40' 'texto breve de material' 'l'."left * * * * * *
perform inserir_no_alv using 'menge' 't_relat' 'd' '16' 'quantidade' 'l'."left clear t_fieldcat. t_fieldcat-fieldname t_fieldcat-tabname t_fieldcat-ref_tabname t_fieldcat-ref_fieldname append t_fieldcat. clear t_fieldcat.
= = = =
'menge'. 't_relat'. 'mseg'. 'menge'.
perform inserir_no_alv using 'parvw' 't_relat' 'c' '2' 'fun��o do parceiro' 'l'."left perform inserir_no_alv using 'telf1' 't_relat' 'c' '16' 'n� telefone' 'l'."left perform inserir_no_alv using 'telfx' 't_relat' 'c' '31' 'n� telefax' 'l'."left perform inserir_no_alv using 'addrnumber' 't_relat' 'c' '50' 'e-mail' 'l'."left perform inserir_no_alv using 'adrnr' 't_relat' 'c' '10' 'endere�o' 'l'."left perform inserir_no_alv using 'stras' 't_relat' 'c' '35'
'rua e n�' 'l'."left perform inserir_no_alv using 'ort01' 't_relat' 'c' '35' 'local' 'l'."left perform inserir_no_alv using 'verkf' 't_relat' 'c' '30' 'respons�vel' 'l'."left endform. " monta_alv *&---------------------------------------------------------------------* *& form zebra_alv *&---------------------------------------------------------------------* form zebra_alv . e_layout-zebra = 'x'. e_layout-no_keyfix = ' '. endform. " zebra_alv *&---------------------------------------------------------------------* *& form imprimir *&---------------------------------------------------------------------* form imprimir . perform heade. call function 'reuse_alv_grid_display' exporting i_callback_program = sy-repid * i_callback_pf_status_set = 'standard_fullscreen' i_callback_top_of_page = 'cabecalho' i_structure_name = 't_relat' * i_background_id = 'alv_background' is_layout = e_layout it_fieldcat = t_fieldcat[] it_sort = t_sort[] i_default = 'x' i_save = 'a' is_variant = v_variant is_print = v_print tables t_outtab = t_relat exceptions program_error = 1 others . if sy-subrc <> 0. message i000(zcbr) with 'n�O foram impressos os dados'. endif.
endform.
" imprimir