Can some body help me?
form show-recap.
data: dmbtr_o_txt(25) type c.
if p_bukrs eq '5000'.
dmbtr_o_txt = 'Discount'.
else.
dmbtr_o_txt = 'Output Tax Payable'.
endif.
skip 5.
write: /05 'Recapitulation of Accounts:'.
skip 1.
write: /05 'Accounts',
40(15) 'Debit' right-justified,
60(15) 'Credit' right-justified.
write: /05 sy-uline(71).
loop at htab.
sum.
recdmbtr_a = htab-dmbtr_a.
recdmbtr_s = htab-dmbtr_s.
recdmbtr_o = htab-dmbtr_o.
endloop.
"neza 111313
" write: /05 'Sales'.
" if recdmbtr_s gt 0.
" write: 40 recdmbtr_s no-sign.
" else.
" write: 60 recdmbtr_s no-sign.
" endif.
" write: /05 'Accounts Receivable'.
" if recdmbtr_a lt 0.
" write: 60 recdmbtr_a no-sign.
" else.
" write: 40 recdmbtr_a no-sign.
" endif.
write: /05 dmbtr_o_txt.
if recdmbtr_o lt 0.
write: 60 recdmbtr_o no-sign.
else.
write: 40 recdmbtr_o no-sign.
endif.
sort rtab by hkont.
loop at rtab where hkont <> '0020305001' AND "neza 111813
hkont <> '0020305002' AND
hkont <> '0020305003' AND
hkont <> '0020305004' AND
hkont <> '0020305005' AND
hkont <> '0041002010' AND
hkont <> '0041002011' AND
hkont <> '0041002014' AND
hkont <> '0041002020' AND
hkont <> '0041002030'.
rectotal_d = rectotal_d + rtab-dmbtr_d.
rectotal_c = rectotal_c + rtab-dmbtr_c.
select single * from zfi_ska1 where saknr eq rtab-hkont.
if sy-subrc ne 0.
* zfi_ska1-txt50 = 'NO DESCRIPTION'.
zfi_ska1-txt50 = rtab-hkont.
endif.
write: /05 zfi_ska1-txt50,
40 rtab-dmbtr_d no-sign,
60 rtab-dmbtr_c no-sign.
endloop.
write: /05 sy-uline(71).
if p_bukrs eq '1000' or p_bukrs eq '2000' or p_bukrs eq '3000'
or p_bukrs eq '6000' or p_bukrs eq '8000'.
if recdmbtr_s gt 0. recdmbtr_s = recdmbtr_s * -1. endif.
rectotal_d = rectotal_d + recdmbtr_o. "recdmbtr_a +
rectotal_c = recdmbtr_s - rectotal_c.
else.
if recdmbtr_s gt 0. recdmbtr_s = recdmbtr_s * -1. endif.
if recdmbtr_o gt 0. recdmbtr_o = recdmbtr_o * -1. endif.
if rectotal_c gt 0. rectotal_c = rectotal_c * -1. endif.
select single * from zfi_ska1 where saknr eq rtab-hkont.
if sy-subrc ne 0.
rectotal_d = rectotal_d. " + recdmbtr_a.
rectotal_c = rectotal_c + recdmbtr_s + recdmbtr_o.
else.
rectotal_d = rectotal_d - recdmbtr_o.
rectotal_c = rectotal_c + recdmbtr_s + recdmbtr_o.
endif.
endif.
write: /05 'Total',
40 rectotal_d no-sign,
60 rectotal_c no-sign.
write: /05
'======================================================================='.
endform. " show-recap