Application Development 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: 

Object oriented ALV with zebra layout

Former Member
0 Kudos

Hello all,

couldn't find anything regarding the above mentioned topic via search function so here my question:

How can I get a zebra layout while using the method cl_salv_table=>factory and further steps. Can someone post some example coding?

Thanks!!

Jan Schnee

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate

Sure, try this.

report  zalvom_demo1.

data: ispfli type table of spfli.

data: gr_table     type ref to cl_salv_table.
data: gr_functions type ref to cl_salv_functions.
data: gr_display   type ref to cl_salv_display_settings.

start-of-selection.

  select * into table ispfli from spfli.

  cl_salv_table=>factory( importing r_salv_table = gr_table
                           changing t_table      = ispfli ).

  gr_functions = gr_table->get_functions( ).
  gr_functions->set_all( abap_true ).

  gr_display = gr_table->get_display_settings( ).
  gr_display->set_striped_pattern( cl_salv_display_settings=>true ).

  gr_table->display( ).

Regards,

Rich Heilman

4 REPLIES 4

RichHeilman
Developer Advocate
Developer Advocate

Sure, try this.

report  zalvom_demo1.

data: ispfli type table of spfli.

data: gr_table     type ref to cl_salv_table.
data: gr_functions type ref to cl_salv_functions.
data: gr_display   type ref to cl_salv_display_settings.

start-of-selection.

  select * into table ispfli from spfli.

  cl_salv_table=>factory( importing r_salv_table = gr_table
                           changing t_table      = ispfli ).

  gr_functions = gr_table->get_functions( ).
  gr_functions->set_all( abap_true ).

  gr_display = gr_table->get_display_settings( ).
  gr_display->set_striped_pattern( cl_salv_display_settings=>true ).

  gr_table->display( ).

Regards,

Rich Heilman

0 Kudos

thats it!

Thanks a lot!!

0 Kudos

Yep, no problem. If your question is answered, you may want to mark it as "solved" next to the answer which answered it. This will close your thread. If you leave 10 or more questions open, you will not be able to ask anymore questions untill they are closed. Thanks in advance and welcome to SDN.

Regards,

Rich Heilman

Edited by: Rich Heilman on Jul 8, 2008 10:31 AM

0 Kudos

ok thanks for the short guide! I think this wasn't the last time I posted something here!