Skip to Content
author's profile photo Former Member
Former Member

regarding Top-of-page

i have Report, listing Records each time with

header as company code at the top

see below format.

Companycode :200.

Business Area :011A.

GL account Code : 12345678.

Date Document no. Amount ......

2005/01/02 300001 1000 ......

Companycode :200.

Business Area :130B.(different Value)

GL account Code : 12345678.

Date Document no. Amount ......

2005/01/02 300001 1000 ......

Companycode :300.(different company code)

Business Area :011A.

GL account Code : 12345678.

Date Document no. Amount ......

2005/01/02 300001 1000 ......

it goes like this...

But in report they code the header part in TOP-OF-PAGE.

could you pls confirm does Header part display each time

in program in listing report.

my thinking is top-of-page display only once at top

in listing. is it not?

let me give outline report structure as below.

Report Ztxxxxx.

Start-of-selection.

Loop itab_t001(Internal table with Companycode.)

Perform make data.

Perform listdata. (details output itab_data internal table)

endloop.

TOP-OF-PAGE.

read table itab_t001 with key itab_data-bukrs.

write itab_Data-bukrs.(company code)

write itab_data-gsber.(business area)

write itab_data-hkont.(GL account code.)

Form makedata.

loop....

endform

Form listdata.

loop....

endform.

ambichan.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Feb 06, 2005 at 04:13 PM

    TOP-OF-PAGE is fired when the program encounters its first "write" statement. If in the REPORT statement at the top of the program, there is a LINE-COUNT extension, the program will fire the TOP-OF-PAGE event when the LINE-COUNT has be exceeded. Example, say you have a report which is 132 characters wide by 65 lines, program will write the header at the begining of the report and after every 65th line. By setting the LINE-COUNT, you are telling the program to change page numbers every 65 lines.

    From what I see in your program, the TOP-OF-PAGE will only be fired once.

    Hope this helps.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi

      Rich is right. Moreover, if you want your "<b>TOP-OF-PAGE</b>" event triggered only once at the beginning of the report, use:

      TOP-OF-PAGE .
      
      IF sy-pagno = '1' .
      *--include your top_of_page coding here
      ENDIF .

      However, I am still not sure your requirement is this. Why do you write something from the internal table at top_of_page. Generally, general report data (e.g. selection criteria, date, user name, etc. are written there)

      May be what is done (since the code you wrote is an outline and this may occur at other parts) is to group the report list content and at a control level execute a <b>"NEW-PAGE"</b> statement which will also trigger the "<b>TOP_OF_PAGE</b>" event with the next "WRITE" statement.

      Hope this helps...

      *--Serdar

  • author's profile photo Former Member
    Former Member
    Posted on Feb 07, 2005 at 03:41 PM

    Hi,

    As per your Logic the Top-of-page will be triggered once for each page. But if you want to have header for each new entry based on Company code and Business area..

    then use control break statements in your program.

    Instead of writing the headings in Top-of-page... write the headings in the Loop and Endloop statements.

    The program structure will be as below...

    sort itab_data by bukrs gsber.

    loop at itab_data.

    v_index = sy-tabix.

    at new gsber.

    read table itab_data index v_index.

    write:/ 'company code:",itab_data-bukrs.

    write:/ 'business area:',itab_Data-gsber.

    write:/ 'GL Account:',itab_data-hkont.

    endat.

    endloop.

    I hope the above code could be of use to you..

    Regards,

    Vara

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.