Skip to Content
1
Former Member
Jul 06, 2015 at 07:57 AM

i want to print the billing detail of the tcode vf03,but its repeating the billing document with change of field

33 Views

TYPES : BEGIN OF ty_vbrp,
VBELN TYPE VBELN_VF,
POSNR TYPE POSNR,
ARKTX TYPE ARKTX,
FKIMG TYPE FKIMG,
VRKME TYPE VRKME,
NETWR TYPE NETWR,
MATNR TYPE MATNR,
MWSBP TYPE MWSBP,
END OF ty_vbrp.

TYPES: BEGIN OF ty_vbrk,
vbeln TYPE vbeln_vf,
kunrg TYPE kunrg,
fkdat TYPE fkdat,
netwr TYPE netwr,
END OF ty_vbrk.




DATA : wa_vbrp TYPE ty_vbrp,
wa_vbrk TYPE ty_vbrk,

v_msehl TYPE t006a-msehl.

PARAMETERS : p_vbeln TYPE vbeln_vf.





select VBELN
POSNR
ARKTX
FKIMG
VRKME
NETWR
MATNR
MWSBP
FROM vbrp
into wa_vbrp
WHERE
vbeln eq p_vbeln.




SELECT single msehl FROM t006a
INTO v_msehl
WHERE
spras eq sy-langu
AND
msehi eq wa_vbrp-vrkme.




sELECT vbeln kunrg fkdat netwr FROM vbrk into wa_vbrk
WHERE vbeln eq wa_vbrp-vbeln.
ENDSELECT.

WRITE:/'Billing document',wa_vbrk-vbeln.
WRITE:/'payer',wa_vbrk-kunrg.
WRITE:/'billing date',wa_vbrk-fkdat.
WRITE:/'net value',wa_vbrk-netwr.
uline.
skip.

write :/5(7)'ITEM',
15(20)'DESCRIPTION',
38(15)'SU',
55(10)'NET VALUE',
68(10)'MATERIAL MASTER',
80(10)'TAX AMOUNT'.


WRITE :/5(7) wa_vbrp-posnr,
15(20) wa_vbrp-ARKTX,
38(15) V_MSEHL,
55(10) WA_VBRP-FKIMG,
68(10) WA_VBRP-NETWR,
80(10) WA_VBRP-MATNR.
endselect.