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

ALV

P311729
Explorer
0 Likes
980

can we restrict the number of records to be displayed in an alv to the required number of records per page.

for ex: if we have 100 records and i want to display 10 records per page. and it shud be in 10 pages.

how can we do this?

6 REPLIES 6
Read only

anversha_s
Active Contributor
0 Likes
903

hi,

try to alter the

line count

.

Regards

Anver

Read only

P311729
Explorer
0 Likes
903

can you be more precise.

can you give me an example?

Read only

Former Member
0 Likes
903

have you declared a PF-status. or can you add two buttons to your alv toolbar.

Read only

Former Member
0 Likes
903

then simply do this

inyour program

DESCRIBE TABLE itab LINES help.

IF help >= maxline.

zdiv = help MOD maxline.

count = 1.

APPEND LINES OF itab FROM 1 TO maxline TO it_out.

start = maxline + 1 .

ENDIF.

PERFORM alv_display.

in your user_command of alv do this

FORM <usr_comman_name> USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN 'NEXT'.

IF count NE zdiv.

count = count + 1 .

CLEAR it_out[].

end = start + maxline - 1.

APPEND LINES OF itab FROM start TO end TO it_out.

start = end.

PERFORM alv_display.

ELSE.

MESSAGE 'no more entries to be displayed' TYPE 'I' .

ENDIF.

ENDCASE.

ENDFORM.

to go back you can simply use the back button

i.e.F3

Read only

former_member480923
Active Contributor
0 Likes
903

Hi,

The output of a ALV is in form of a Screen, which will not match with page size defined in the Line-Count defined, this things can only be defined in the print time if you are going for a grid output. Other wise if you are using the list output try this program BCALV_TEST_LIST_PRINT.

Hope that Helps

Anirban M.

Read only

0 Likes
903

hi,

can you add two buttons in your pf_status to go to the next and the previos page.

reply