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

Object oriented ALV with zebra layout

Former Member
0 Likes
9,413

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
Read only

RichHeilman
Developer Advocate
Developer Advocate
4,124

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
Read only

RichHeilman
Developer Advocate
Developer Advocate
4,125

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

Read only

0 Likes
4,124

thats it!

Thanks a lot!!

Read only

0 Likes
4,124

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

Read only

0 Likes
4,124

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