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

SALV GRID - Zebra pattern

Former Member
0 Likes
10,906

Please help, I am using the SALV classes to display a grid and i want to use the striped pattern, but it's not working.

I'm set CL_SALV_DISPLAY_SETTINGS->SET_STRIPED_PATTERN to abap_true but the rows are still all white.

when the grid is display if i look in the alv layout setting the striped pattern tick box is flagged!

can anyone please suggest why this is not working.

Thanks

8 REPLIES 8
Read only

Former Member
0 Likes
4,545

I do it like this....

  • SALV Display settings.

gr_display = gr_alv->get_display_settings( ). "General Display Settings "get them all first

gr_display->set_striped_pattern( cl_salv_display_settings=>true ). "zebra stripes

gr_display->set_list_header( 'Standard Product Report' ). "Title

. . . .

gr_alv->display( ).

gr_display is defined as

gr_display type ref to cl_salv_display_settings,

By the way, there are very good SALV demo programs named like: SALV_DEMO* and SALV_TEST* and others, plus Rich Heilman, now at SAP Labs, has an excellent set of tutorials for SALV in the articles....search for SALV tutorial....

Read only

Former Member
0 Likes
4,545

That's how i'm doing it!, my code is


* create the SALV object
  try.
      call method cl_salv_table=>factory
        importing
          r_salv_table = gr_salv_table
        changing
          t_table      = gt_output.
    catch cx_salv_msg .
  endtry.
* set custom menu functions & buttons
  gr_salv_table->set_screen_status(
     pfstatus      =  'SALV_STANDARD'
     report        =  'ZM_GDW_OPEN_PURCH_ORDERS_INT'
     set_functions = gr_salv_table->c_functions_all ).
* set functions
  gr_salv_functions = gr_salv_table->get_functions( ).
  gr_salv_functions->set_all( 'X' ).
* set output control
  gr_salv_dsp_set = gr_salv_table->get_display_settings( ).
  gr_salv_dsp_set->set_striped_pattern( 'X' ).
  gr_salv_dsp_set->set_list_header( text-t01 ).
* set column settings
  gr_salv_columns = gr_salv_table->get_columns( ).
  gr_salv_columns->set_optimize( 'X' ).
* set event handling
  gr_salv_events = gr_salv_table->get_event( ).
  create object gr_salv_event_handler.
  set handler gr_salv_event_handler->link_click  for gr_salv_events.
  set handler gr_salv_event_handler->send_to_gdw for gr_salv_events.
* output the table
  gr_salv_table->display( ).

but it just display all rows white.

Thanks

Read only

0 Likes
4,545

Well, perhaps the X is not interpreted correctly...this absolutely works for me....

gr_display = gr_alv->get_display_settings( ). "General Display Settings "get them all first

gr_display->set_striped_pattern( cl_salv_display_settings=>true ). "zebra stripes

Read only

Former Member
0 Likes
4,545

That doesn't do anything either!

Coult this be a system setting or something?

Read only

4,545

Matthew,

I noticed your post and that it was not answered... I was seeing the same problem on a grid that I built this morning. You are not seeing the striped pattern because of your GUI version. I am using version 7200.1.0.3166, patch level 0 (I cannot see the striped pattern with this version). A co-worker is running version 7200.3.11.3238, patch level 11 (striped pattern is visible).

Respectfully,

Brian

Read only

Former Member
0 Likes
4,545

Hi,

daclare it_layout and pass it_layout-zebra = 'X'.

pass this in reuse_alv_grid_display'.you will get the striped patterns lines in your output.

Regards,

Gurunath Kumar D

Read only

0 Likes
4,545

Guess nagesh hasn't heard of SALV or OO ALV yet.

Read only

0 Likes
4,545

Just installed GUI 7200.3.11.3238 and problem was solved with no change in code... (Sorry, I like my CAPS.)

DATA:
   GR_TABLE        TYPE REF TO CL_SALV_TABLE,
   GR_DSPSET     TYPE REF TO CL_SALV_DISPLAY_SETTINGS.

*****Set striped pattern*****
   GR_DSPSET = GR_TABLE->GET_DISPLAY_SETTINGS( ).
   GR_DSPSET->SET_STRIPED_PATTERN( ABAP_TRUE ).