Está en la página 1de 5

*&---------------------------------------------------------------------*

*& Include MZFICOM003TOP


*
*&
*
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Declarao de dados globais
*&---------------------------------------------------------------------*
*&
constants: c_mark

type c value 'X'.

controls: tb_comissao
tb_impostos
tb_historico
tb_tvbur

type
type
type
type

tableview
tableview
tableview
tableview

using
using
using
using

screen
screen
screen
screen

0200,
0200,
0400,
0500.

tables : zfitcom011, zfiecom001, zfitcom009, tvbur, bsis, zfitcom014,


lfbw.
data

: v_lines
v_mark
v_copied
v_cop400
v_indice
v_oldind
v_indatu
v_answer
v_rescisao
v_confirm
v_tabix
v_dynnr
ok_code
code100
v_totreal
v_totpdd
v_linhas(02)
v_mod3
v_vlcorr
v_zuonr
v_numdoc
v_compdc
v_totbase12
v_msg(256)
v_valor(16)
v_totlin
v_valant
v_dest
v_campo(20)
v_chg_lfbw
v_bukrs

like
type
type
type
type
type
type
type
type
type
like
like
like
like
like
like
type
type
like
like
like
like
like
type
type
type
type
like
type
type
like

sy-loopc,
c,
c,
c,
i,
i,
i,
c,
c,
c,
sy-tabix,
sy-dynnr,
sy-ucomm,
sy-ucomm,
zfitcom004-vlreal,
zfitcom004-vlpdd,
n,
c,
zfitcom011-vlcorr,
bseg-zuonr,
zfitcom003-numdoc,
zfitcom003-compdc,
zfitcom011-vlcorr,
c,
c,
i,
p decimals 8,
rfcdes-rfcdest,
c,
c,
zfitcom004-bukrs.

*&---------------------------------------------------------------------*
*& Macros e field-symbols
*&---------------------------------------------------------------------*
*&
define append_compda.
loop at t_compdoc into wa_compdoc

where ( bukrs eq wa_bsad-bukrs )


and ( kunnr eq wa_bsad-kunnr )
and ( augbl eq wa_bsad-augbl ).
wa_compda = wa_compdoc.
append wa_compda to t_compda.
endloop.
end-of-definition.
*&---------------------------------------------------------------------*
*& Tabelas internas e work areas ( telas )
*&---------------------------------------------------------------------*
*&
data:

wa_auxhist
wa_historico

type zfic2_wa_historico,
type zfic2_wa_historico.

data:

t_item
t_aux
t_itemaux
wa_itemaux
t_oldite
t_oldhist
t_auxhist
t_historico

type
type
type
type
type
type
type
type

zfic2_zfitcom004,
zfic2_zfitcom004,
zfic2_zfitcom004,
zfic2_wa_item,
zfic2_zfitcom004,
zfic2_historico,
zfic2_historico,
zfic2_historico.

*&---------------------------------------------------------------------*
*& Tabelas internas e work areas ( funes e rotinas )
*&---------------------------------------------------------------------*
*&
data:

data:

begin of wa_shdb,
mark
type
hkont
like
belnr
like
buzei
like
gjahr
like
nfnum
like
zuonr
like
gsber
like
lifnr
like
vkbur
like
pagnr
like
totalnf
like
vlpgto
like
vlperd
like
vldesc
like
vlpdd
like
end of wa_shdb.

c,
zfitcom004-hkont,
zfitcom004-belnr,
zfitcom004-buzei,
zfitcom004-gjahr,
zfitcom003-nfnum,
zfitcom004-zuonr,
zfitcom004-gsber,
lfa1-lifnr,
tvbur-vkbur,
zfitcom003-pagnr,
zfiecom002-totalnf,
zfitcom004-vlpgto,
zfitcom004-vlperd,
zfitcom004-vldesc,
zfitcom004-vlpdd,

begin of wa_shdb60,
mark
type c,
hkont
like zfitcom004-hkont,
gsber
like zfitcom004-gsber,
belnr
like zfitcom004-belnr,
buzei
like zfitcom004-buzei,
gjahr
like zfitcom004-gjahr,
nfnum
like zfitcom003-nfnum,
zuonr
like zfitcom004-zuonr,
lifnr
like lfa1-lifnr,
vkbur
like tvbur-vkbur,

data:

pagnr
like
totalnf
like
vlpgto
like
vlperd
like
vldesc
like
vlpdd
like
end of wa_shdb60.

zfitcom003-pagnr,
zfiecom002-totalnf,
zfitcom004-vlpgto,
zfitcom004-vlperd,
zfitcom004-vldesc,
zfitcom004-vlpdd,

wa_tvbur
wa_lfa1
wa_spopli
wa_status
wa_aux
wa_shdbaux
wa_60aux
wa_impostos
wa_id
wa_finan

tvbur,
zfico_wa,
spopli,
dd07v,
zfitcom003,
wa_shdb,
wa_shdb60,
zfiecom001,
arfctid,
zfitcom006.

*> estrutura para batch


data:
wa_bdcdata
wa_bdcaux
wa_messtab
t_bdcdata
t_bdcaux
t_bdcaux2
t_messtab
data:

t_tvbur
t_finan
t_tverr
t_status
t_lfa1
t_spopli
t_impostos
t_auxdev
t_auxprn
t_auxbase
t_shdb
t_shdb60
t_lfbw_old

like
type
like
like
like
like
like
like
like
like

input/call transaction
like bdcdata,
like bdcdata,
like bdcmsgcoll,
like standard table of bdcdata,
like t_bdcdata,
like t_bdcdata,
like standard table of bdcmsgcoll.
like
like
like
like
type
like
like
like
like
like
like
like
like

standard table
standard table
standard table
standard table
zfico_fornec,
standard table
standard table
standard table
t_zfitcom004,
t_base12,
standard table
standard table
standard table

of
of
of
of

wa_tvbur,
wa_finan,
wa_tvbur,
dd07v,

of spopli,
of wa_impostos,
of wa_item,
of wa_shdb,
of wa_shdb60,
of lfbw.

*&---------------------------------------------------------------------*
*& Tela de seleo
*&---------------------------------------------------------------------*
*&
selection-screen begin of screen 0110 as subscreen.
selection-screen begin of block b1 with frame title text-s01.
parameters: p_bukrs like zfitcom003-bukrs obligatory.
select-options: s_vkbur for zfitcom003-vkbur,
s_pagnr for zfitcom004-pagnr matchcode object
zficom_pagnr.
select-options: s_docto for bsis-belnr modif id aba.
parameters
p_data like zfitcom003-quinzena.
selection-screen end of block b1.

selection-screen begin of block b2 with frame title text-s02.


selection-screen begin of line.
parameters
p_novcom as checkbox default c_mark.
selection-screen comment (40) for field p_novcom.
selection-screen end of line.
selection-screen begin of line.
parameters
p_ctocom as checkbox default c_mark.
selection-screen comment (40) for field p_ctocom.
selection-screen end of line.
selection-screen end of block b2.
selection-screen begin of block b3 with frame title text-s07.
selection-screen begin of line.
parameters
p_excjob as checkbox default ' '.
selection-screen comment (40) for field p_excjob.
selection-screen end of line.
selection-screen end of block b3.
selection-screen end

of screen 0110.

selection-screen begin of screen 0101 title text-s03 as window.


selection-screen begin of block s1 with frame title text-s04.
parameters:
p_mode type c default 'N'.
selection-screen end of block s1.
selection-screen end

of screen 0101.

selection-screen begin of screen 0120 title text-s05 as window.


selection-screen begin
parameters:
p_indi
p_mes
p_ano
p_val
selection-screen end

of block s2 with frame title text-s06.


like zfitcom009-indice default 'CORR' obligatory,
like zfitcom009-mes
obligatory,
like zfitcom009-ano
obligatory,
like zfitcom009-valind
obligatory.
of block s2.

selection-screen end

of screen 0120.

*&---------------------------------------------------------------------*
*& Event selection-screen output
*&---------------------------------------------------------------------*
*&
at selection-screen output.
loop at screen.
if ( screen-group1
( sy-uname+00(04)
sy-uname
sy-uname
sy-uname
screen-active = 0.
modify screen.
endif.
endloop.

eq
ne
ne
ne
ne

'ABA'
) and
'ABAP'
and
'FABIANO' and
'SILVIO'
and
'PATI' ).

*&---------------------------------------------------------------------*
*& Event at selection-screen
*&---------------------------------------------------------------------*
*&

at selection-screen.
if ( not sy-ucomm is initial ).
case sy-dynnr.
when '0110'.
refresh s_xref3.
loop at s_vkbur.
move-corresponding s_vkbur to s_xref3.
append s_xref3.
endloop.
when '0120'.
select single * from zfitcom009
into zfitcom009
where ( indice eq p_indi )
and ( mes
eq p_mes )
and ( ano
eq p_ano ).
if ( sy-subrc eq 0 ).
message e999(zarm) with text-m31.
endif.
select * from zfitcom009
into table t_indices
where ( indice eq p_indi ).
sort t_indices by indice ano descending mes descending.
*> Verifica se o perodo informado o prximo esperado.
read table t_indices into wa_indices index 1.
if ( sy-subrc eq 0 ).
if ( wa_indices-mes eq 12 ).
wa_indices-mes = 1.
wa_indices-ano = wa_indices-ano + 1.
else.
wa_indices-mes = wa_indices-mes + 1.
endif.
if ( wa_indices-ano ne p_ano ) or
( wa_indices-mes ne p_mes ).
message e999(zarm) with text-m32 wa_indices-mes
wa_indices-ano.
endif.
endif.
clear zfitcom009.
zfitcom009-indice
zfitcom009-mes
zfitcom009-ano
zfitcom009-valind
zfitcom009-valori

=
=
=
=
=

p_indi.
p_mes.
p_ano.
p_val.
p_val.

insert zfitcom009.
commit work.
endcase.
endif.
at selection-screen on p_bukrs.
REFRESH S_BUKRS.
s_bukrs-sign = 'I'.
s_bukrs-option = 'EQ'.
s_bukrs-low
= P_BUKRS.
append s_bukrs.

También podría gustarte