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 Grid row limit

Former Member
0 Likes
909

Hi Friends,

I am working on a ALV Grid report using FM REUSE_ALV_GRID_DISPLAY wherein when the ALV report is executed I have to see only 20 default rows by default. I am not pulling the data from any database tables into this report. So when the user executes this report he/she should see 20 blank rows by default. Is this possible to do. If yes, I need some hints on how to achieve this. Appreciate your answers.

Thanks,

Nani

Hi Friends,

I am working on a ALV Grid report using FM REUSE_ALV_GRID_DISPLAY wherein when the ALV report is executed I have to see only 20 default rows by default. I am not pulling the data from any database tables into this report. So when the user executes this report he/she should see 20 blank rows by default. Is this possible to do. If yes, I need some hints on how to achieve this. Appreciate your answers.

Thanks,

Nani

2 REPLIES 2
Read only

Former Member
0 Likes
652

First check that your internal table is empty. then apply loop on it 20 times and store any null character in character type field and append it to itab. through this you will get the itab with 20 entries now pass it to ALV.

if itab is not INITIAL.

   do 20 times.

     itab-xyz = '-'.

     append itab.

     enddo.

   endif.

Read only

Former Member
0 Likes
652

Hello,

According to screen resolution the ALV grid/report but mostly the screen on which the ALV grid is present will change it is size and so the table control or ALV report inside.

A better way is gray out the lines. Keep 20 lines editable and remaining grayed out.

Here is the code

In PBO

loop at itab with control tc.

endloop.

module disable_row. " This must be next to the loop at statement

in program.

module disable_row.

describe table itab lines tc-lines.

if tc-lines = 0.

loop at screen.

if screen-group1 = 'GRP'. " For all the Columns of TC create a Group1 with GRP

screen-input = 0.

modify screen.

ENDIF.

endloop. " Take care of inserting a row after this

endif. " I have checked this and working fine

endmodule.

Assign group name 'GRP' to all fields that need to be grayed out.

Hope this helps.

Best regards,

swanand