Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Report

Former Member
0 Likes
677

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
647

Use the event TOP-OF-PAGE and write the code under that to display the customer address.

- Guru

Reward helpful answers

7 REPLIES 7
Read only

Former Member
0 Likes
648

Use the event TOP-OF-PAGE and write the code under that to display the customer address.

- Guru

Reward helpful answers

Read only

0 Likes
647

hi can u provide sameple example code.

thanks & regards

kiran kumar

Read only

0 Likes
647

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

Read only

0 Likes
647

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

Read only

0 Likes
647

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

Read only

Former Member
0 Likes
647

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

Read only

Former Member
0 Likes
647

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