Billing Document Reports

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

types : begin of ty_vbrk, vbeln type vbrk-vbeln, fkart type vbrk-fkart, knumv type vbrk-knumv, kunag type vbrk-kunag,

erdat type vbrk-erdat, end of ty_vbrk, begin of ty_vbrp, vbeln type vbrp-vbeln, posnr type vbrp-posnr, fkimg type vbrp-fkimg, WERKS type vbrp-WERKS, NETWR type vbrp-NETWR, vgbel type vbrp-vgbel, vgpos type vbrp-vgpos, aubel type vbrp-aubel, aupos type vbrp-aupos, End of ty_vbrp, begin of ty_konv, knumv type konv-knumv, kposn type konv-kposn, kschl type konv-kschl, kbetr type konv-kbetr, kwert type konv-kwert, end of ty_konv.

" " " " "

Billing Doucment Billing Doucment 3 Number of the document condition 4 Customer Number Date on Which Record Was Created

" " " " " " " " "

Billing DOucment 1 ITem NUmber 2 Invoice Qty 5 Plant 6 Total Value 7 Delivery Doucment 9 Delivery Item SALES Document 10 Sales DOCUMENT ITEM

" " " " "

Number of the document condition ITem number Conditiona type Rate (condition amount or percentage) Condition value 8

data: it_vbrk type table of ty_vbrk, it_vbrp type table of ty_vbrp, it_konv type table of ty_konv. data: wa_vbrk type ty_vbrk, wa_vbrp type ty_vbrp, wa_konv type ty_konv. data: v_vbeln type vbrk-vbeln, v_erdat type vbrk-erdat.

selection-screen begin of block b1 with FRAME title text-001. * parameter: P_vbeln type vbrp-vbeln. select-options: s_vbeln for v_vbeln, s_erdat for v_erdat.

selection-screen end of block b1.

select

vbeln fkart knumv kunag erdat from vbrk into table it_vbrk where vbeln in s_vbeln

and select

erdat in s_erdat.

vbeln posnr fkimg WERKS NETWR vgbel vgpos aubel aupos from vbrp into table it_vbrp for all entries in it_vbrk where vbeln eq it_vbrk-vbeln. knumv kposn kschl kbetr kwert from konv into table it_konv for all entries in it_vbrk where knumv eq it_vbrk-knumv.

select

FORMAT color 3 inverse on. uline 0(224). write: /0 sy-vline , 3(12) 15 sy-vline, 16(6) 22 sy-vline, 23(12) 35 sy-vline, 36(12) 48 sy-vline, 49(12) 62 sy-vline, 63(8) 72 sy-vline, 73(20) 94 sy-vline, 95(12) 108 sy-vline, 109(8) 118 sy-vline, 119(12) 132 sy-vline, 133(8) 142 sy-vline, 143(20) 164 sy-vline, 165(6) 172 sy-vline, 173(8) 182 sy-vline, 183(6) 190 sy-vline, 191(18) 210 sy-vline, 211(12) 224 sy-vline. format color 6 inverse off.

'Billing Doc.', 'D.Type', 'Doc.Cond No.', 'Sold2Party', 'Created Dt.', 'B.Item', 'Invoice Quantity', 'Ref.Doc.No.', 'Ref.It.', 'Sales Doc.No', 'SalesIt.', 'Net Value in Doc. Currency', 'Plant', 'C.It.No', 'C.type', 'Condition value', 'Rate',

loop at it_vbrp into wa_vbrp where vbeln in s_vbeln . read table it_vbrk into wa_vbrk with key vbeln = wa_vbrp-vbeln . read table it_konv into wa_konv with key knumv = wa_vbrk-knumv. uline /0(224). format color 7 inverse on. write: /0 sy-vline , 15 sy-vline, 22 sy-vline, 35 sy-vline, 3(12) 16(6) 23(12) 36(12) wa_vbrk-vbeln wa_vbrk-fkart wa_vbrk-knumv wa_vbrk-kunag , , , ,

48 62 72 94 108 118 132 142 164 172 182 190 210 224 format color

sy-vline, sy-vline, sy-vline, sy-vline, sy-vline, sy-vline, sy-vline, sy-vline, sy-vline, sy-vline, sy-vline, sy-vline, sy-vline, sy-vline. 7 inverse

49(12) 63(8) 73(20) 95(12) 109(8) 119(12) 133(8) 143(20) 165(6) 173(8) 183(6) 191(18) 211(12) off.

wa_vbrk-erdat wa_vbrp-posnr wa_vbrp-fkimg wa_vbrp-vgbel wa_vbrp-vgpos wa_vbrp-aubel wa_vbrp-aupos wa_vbrp-netwr wa_vbrp-werks wa_konv-kposn wa_konv-kschl wa_konv-kwert wa_konv-kbetr

, , , , , , , , , , , , ,

at end of vbeln. sum. uline /0(224). format color 4 inverse on. write: /0 sy-vline,60(10) 'Totals',72 sy-vline, 73(20) wa_vbrp-fkimg,94 sy-v line, 142 sy-vline, 143(20) wa_vbrp-netwr, 164 sy-vline, 190 sy-vline, 191(18) wa_konv-kwert, 210 sy-vline, 211(12) wa_konv-kbetr, 224 sy-vline. uline /0(224). endat. format color 4 inverse off. at last. sum. uline /0(224). format color 5 inverse on. write: /0 4 sy-vline, 142 190 210 224 sy-vline,54(15) 'Grand Totals',72 sy-vline, 73(20) wa_vbrp-fkimg,9 sy-vline, sy-vline, sy-vline, sy-vline. 143(20) wa_vbrp-netwr, 164 sy-vline, 191(18) wa_konv-kwert, 211(12) wa_konv-kbetr,

format color 5 inverse off. uline /0(224). endat.

You might also like