Skip to Content
0
Former Member
Mar 27, 2008 at 06:37 AM

Displays only the last record of the internal table.

64 Views

Hi all,

&----


*& Report ZPU_ASN_REPORT

*&

&----


*&

*&

&----


report zpu_asn_report line-size 300

line-count 25.

tables: vbrk , vbrp , j_1iexchdr .

data: begin of itab occurs 0,

vbeln like vbrk-vbeln,

netwr like vbrk-netwr,

xblnr like vbrk-xblnr,

mwsbk like vbrk-mwsbk,

vkorg like vbrk-vkorg,

kunrg like vbrk-kunrg,

posnr like vbrp-posnr,

fkimg like vbrp-fkimg,

werks like vbrp-werks,

end of itab.

data: wa_j_1iexchdr like j_1iexchdr occurs 0 with header line.

data: sfrom(15) , end(15).

data: exbed type p decimals 2.

data: fkimg type p decimals 0.

data: amount type p decimals 2.

data: l_vbeln like vbrk-vbeln.

data: indx like sy-tabix.

data: indx1 like sy-tabix.

data: t_stxh like stxh occurs 0 with header line,

t_tline like tline occurs 0 with header line, " LR No

t_tline1 like tline occurs 0 with header line, "Vehicle No

t_tline2 like tline occurs 0 with header line. "TPT Name

selection-screen begin of block blk1 with frame title tit.

select-options: custcode for vbrk-kunrg,

plant for vbrp-werks,

salesorg for vbrk-vkorg,

bildocno for vbrk-vbeln,

prprn for j_1iexchdr-preprn,

date for j_1iexchdr-cpudt.

selection-screen end of block blk1.

at selection-screen on bildocno.

select single vbeln from vbrk into corresponding fields of itab

where vbeln in bildocno.

select single kunrg from vbrk into corresponding fields of itab

where kunrg in custcode.

select single werks from vbrp into corresponding fields of itab

where werks in plant.

select single vkorg from vbrk into corresponding fields of itab

where vkorg in salesorg.

select single preprn from j_1iexchdr into corresponding fields of wa_j_1iexchdr

where preprn in prprn.

select single cpudt from j_1iexchdr into corresponding fields of wa_j_1iexchdr

where cpudt in date.

top-of-page.

format color 7.

write:/'PO/SA Number',

20 'Item Sr No',

38 'ASN Quantity',

55 'Pre printed Invoice No',

85 'Invoice Date',

105 'Invoice Amount',

130 'Excise Amount',

150 'LR No',

165 'LR Date',

185 'Vehicle No',

210 'TPT Name',

245 'Billing Document No'.

uline.

end-of-page.

uline.

start-of-selection.

select vbeln netwr xblnr mwsbk vkorg kunrg from vbrk into corresponding fields of itab

where vbeln in bildocno

and vkorg in salesorg.

select posnr fkimg werks from vbrp into corresponding fields of itab

where vbeln = itab-vbeln

and werks in plant.

append itab.

endselect.

endselect.

select cpudt exbed preprn from j_1iexchdr into corresponding fields of wa_j_1iexchdr

where rdoc = itab-vbeln

and cpudt = wa_j_1iexchdr-cpudt.

endselect.

amount = itab-netwr + itab-mwsbk.

fkimg = itab-fkimg.

exbed = wa_j_1iexchdr-exbed.

loop at itab.

write:/ itab-xblnr,

22 itab-posnr,

28 fkimg,

60 wa_j_1iexchdr-preprn,

85 wa_j_1iexchdr-cpudt,

100 amount,

125 exbed,

165 wa_j_1iexchdr-cpudt,

255 itab-vbeln.

endloop.

end-of-selection.

this is the code for the output of the report.

the problem the info. of only the last billing doc is displayed for all the billing doc nos.

i m able to retrieve the respective info of the particular billing doc. in the internal table.

but while displaying it displays the info. of the last billing doc. to all the others.

suggest me the corrections in my code for the same.

Its urgent.

Thanks & regards,

Purva.