cancel
Showing results for 
Search instead for 
Did you mean: 

New page based on condition

Former Member
0 Kudos

Hi all,

i want to trigger new-page, if records in my table are more than 5.

that is one page should contain only 5 records of a table.

pls tell me how to do it

Edited by: Alvaro Tejada Galindo on Mar 4, 2008 12:45 PM

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Guys - don't forget to reset the counter after the new page!

Rob

Former Member
0 Kudos

Thanks Rob.

Former Member
0 Kudos

Hi,

Please refer the below code:


REPORT demo_list_new_page LINE-SIZE 40.

data : count type i value 0.

TOP-OF-PAGE.

  WRITE: 'TOP-OF-PAGE', sy-pagno.
  ULINE AT /(17).

START-OF-SELECTION.

Select Fields from <tablename> into itab.

loop at itab.
write : itab-field1, itab-field2.
count = count + 1.

if count GT 5.
    NEW-PAGE.
count = 0.
endif.
endloop.

Thanks,

Sriram Ponna.

Edited by: Sriram Ponna on Mar 4, 2008 11:46 PM

Former Member
0 Kudos
Former Member
0 Kudos

hi write in the command line of ur smart form.

write condition in the command line as:

counter line = 5.

then call the new page.

<REMOVED BY MODERATOR>

venkat.

Edited by: Alvaro Tejada Galindo on Mar 4, 2008 12:46 PM

Former Member
0 Kudos

Sekar,

Good!

In the Main window of the smart form for the loop there are some events are there. call a perform statment and write custom logic to do the same.

thanks,

Sunil