Skip to Content
avatar image
Former Member

Dynamic amount of visible rows in ALV

Hi there,

I would like to have an ALV displaying the row amount according to the amount of entries (10 entries in the list -> 10 visible rows). So no ALV-Scrolling is needed. Is there a possibility how to achieve that? The best would be if there is already existing ALV functionality which has to be swithed of via a flag or something like that. Can you provide any help?

Kind regards,

Albert

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jun 24, 2008 at 08:53 AM

    Yeah, you can do that using the method set_visible_row_count in the interface if_salv_wd_table_settings. When you get the data to be bound to the ALV, you can get a count of the rows in the internal table and pass that to this method.

    Regards,

    Nithya

    Add comment
    10|10000 characters needed characters exceeded

    • >

      > Hi Nithay,

      >

      > this is all manual setting of the visible row count, but I don't want that, because I have many places and many alv encapsulations. I don't want to set amount manually. I would be great if the ALV interface would provide a possiblity to activate or deactivate such a function, which is handled then by the ALV itself.

      >

      > Kind regards,

      > Albert

      Be it as it may, that functionality simply doesn't exist within the ALV currently. You are left to code such functionality yourself as already described.

  • avatar image
    Former Member
    Nov 13, 2008 at 03:52 PM

    Hi Albert,

    in "Quick tips and tricks on Web Dynpro for ABAP u2013 How to use ALV and Pop ups"

    there is a way how you can set it. Have a look at page 4 -> "Automatically set number of visible rows to number of items."

    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40794172-b95a-2910-fb98-b86d8a0918b4]

    DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings.
    u201Dget reference of table settings by cast
     lr_table_settings ?= wd_this->r_table .
     lr_table_settings->set_visible_row_count( -1 ). 
     lr_table_settings->set_footer_visible( 0 ).
    

    Maybe this can help you.

    Regards,

    Andreas

    Add comment
    10|10000 characters needed characters exceeded