‎2006 Dec 11 6:35 PM
hi to all
help me this issue
i have devoloped a simple report and need the customer address at the top in
output.
below that
the invoices records text needs to be displayed
thanks in advance
kiran kumar
‎2006 Dec 11 6:39 PM
Use the event TOP-OF-PAGE and write the code under that to display the customer address.
- Guru
Reward helpful answers
‎2006 Dec 11 6:39 PM
Use the event TOP-OF-PAGE and write the code under that to display the customer address.
- Guru
Reward helpful answers
‎2006 Dec 11 6:51 PM
hi can u provide sameple example code.
thanks & regards
kiran kumar
‎2006 Dec 11 7:03 PM
TOP-OF-PAGE is a event and can be written anywhere in the main program.
So in your code write:
TOP-OF-PAGE.
Write : ' Customer Name ' , Kan1-Kunnr.
.
.
.
Etc.
Similarly you can code other fields also.
- Guru
Reward answers if helpful
‎2006 Dec 11 7:13 PM
Basic Coding, nothing fancy.
report zrich_0001.
data: ivbrk type table of vbrk with header line.
data: xkna1 type kna1.
start-of-selection.
select * into table ivbrk from vbrk
up to 500 rows.
sort ivbrk ascending by kunrg.
loop at ivbrk.
on change of ivbrk-kunrg.
new-page.
endon.
write:/ ivbrk-vbeln.
endloop.
top-of-page.
select single * into xkna1 from kna1
where kunnr = ivbrk-kunrg.
write:/ xkna1-kunnr.
write:/ xkna1-name1.
write:/ xkna1-stras.
write:/ xkna1-ort01, xkna1-regio, xkna1-pstlz.
Regards,
Rich Heilman
‎2006 Dec 11 7:22 PM
Hi Kiran,
You should get the Customer addresses before the first WRITE statement in your report because TOP-OF-PAGE will be trigger for first WRITE statement in your report.
You can have a query on KNA1 to get the addresses.
You can place this code in your START-OF-SELECTION or AT SELECTION-SCREEN.
SELECT KUNNR LAND1 NAME1 ORT01 PSTLZ STRAS
FROM KNA1
INTO TABLE IT_KNA1
WHRE KNA1 IN S_KNA1.
TOP-OF-PAGE.
WRITE:/005 IT_KNA1-KUNNR,
015 IT_KNA1-NAME1,
035 IT_KNA1-STRAS,
055 IT_KNA1-PSTLZ,
075 IT_KNA1-ORT01.
Thanks,
Vinay
‎2006 Dec 11 6:44 PM
Hi Kiran,
If you want to display report at the top in output, use the event <b>TOP-OF-PAGE</b> for a simple report and <b>TOP-OF-PAGE DURING LINE-SELECTION</b> for an interactive report.
TOP_OF_PAGE.
WRITE:/ 'Customer Address'.
Thanks,
Vinay
‎2006 Dec 11 6:58 PM
HI,
Check the below code....
1. If you want to display details for one customer the follow the below procedure.
start-of-selection
<Get Data>
End-of-selection
<Display Invoice Text>
Top-of-page
<Display Customer Address>
2. If you want to display details for many customers, then follow the below procedure
start-of-selection
<Get Data>
End-of-selection
sort <itab> by customer.
loop at <itab> into <work area>.
at new customer.
<display Customer>
endat
<display invoice text for the customer>
endloop.
TOP-of-page
<display Page Header>
I hope you got the answer.
Regards,
Vara