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

Problem with cl_salv_form_layout_grid

MichiFr
Participant
0 Likes
1,201

Hi,

I do encounter some strange painting issue with class cl_salv_form_layout_grid. The following code paints three rows of cells.

Row 1 with months names

Row 2 with calendar weeks

Row 3 with days 1 - 21

Row 1 spans from colums 1 - 7 and from 8 - 21

Row 2 spans from columns 1-7, 8-14 and from 15-21

Please see the following sample code


REPORT  zsdsm_form_demo_layout_grid.

DATA: lr_grid TYPE REF TO cl_salv_form_layout_grid.
DATA: lr_text TYPE REF TO cl_salv_form_text.
DATA: l_columns TYPE i VALUE 1..
DATA: lr_dydos_window TYPE REF TO cl_salv_form_window_dydos.
DATA: gr_content TYPE REF TO cl_salv_form_element.
DATA: l_day(2) TYPE n.


CREATE OBJECT lr_grid.

lr_grid->create_text(
      row     = 1
      column  = 1
      colspan = 7
      text    = 'July' ).

lr_grid->create_text(
      row     = 1
      column  = 8
      colspan = 14
      text    = 'August' ).

lr_grid->create_text(
      row     = 2
      column  = 1
      colspan = 7
      text    = 'Week 29' ).

lr_grid->create_text(
      row     = 2
      column  = 8
      colspan = 7
      text    = 'Week 30' ).

lr_grid->create_text(
      row     = 2
      column  = 15
      colspan = 7
      text    = 'Week 31' ).

"Create columns 1 - 21
WHILE l_columns <= 21.
  l_day = l_columns.

  lr_grid->create_text(
    row     = 3
    column  = l_columns
    text    = l_day ).

  l_columns = l_columns + 1.
ENDWHILE.

lr_grid->set_grid_lines( if_salv_form_c_grid_lines=>horizontal_lines ).

gr_content = lr_grid.

CREATE OBJECT lr_dydos_window
  EXPORTING
    r_content = gr_content.

lr_dydos_window->display( ).

I expected to get a properly displayed grid with some spanned columns, however, the resulting grid shows up some additional black cells I did not added before. See [sample image|http://imageshack.us/photo/my-images/853/20110718122924.png/]

Currently I cannot figure out what causes this issue, can you?

Edit: I noticed when using an Abap list with class cl_salv_form_window_abap instead, the output is correct, no additional cells at the end. Obviously there is a flaw in the HMTL renderer.

Thanks,

Michael

Edited by: Michael Fritz on Jul 18, 2011 3:49 PM

Hi,

I do encounter some strange painting issue with class cl_salv_form_layout_grid. The following code paints three rows of cells.

Row 1 with months names

Row 2 with calendar weeks

Row 3 with days 1 - 21

Row 1 spans from colums 1 - 7 and from 8 - 21

Row 2 spans from columns 1-7, 8-14 and from 15-21

Please see the following sample code


REPORT  zsdsm_form_demo_layout_grid.

DATA: lr_grid TYPE REF TO cl_salv_form_layout_grid.
DATA: lr_text TYPE REF TO cl_salv_form_text.
DATA: l_columns TYPE i VALUE 1..
DATA: lr_dydos_window TYPE REF TO cl_salv_form_window_dydos.
DATA: gr_content TYPE REF TO cl_salv_form_element.
DATA: l_day(2) TYPE n.


CREATE OBJECT lr_grid.

lr_grid->create_text(
      row     = 1
      column  = 1
      colspan = 7
      text    = 'July' ).

lr_grid->create_text(
      row     = 1
      column  = 8
      colspan = 14
      text    = 'August' ).

lr_grid->create_text(
      row     = 2
      column  = 1
      colspan = 7
      text    = 'Week 29' ).

lr_grid->create_text(
      row     = 2
      column  = 8
      colspan = 7
      text    = 'Week 30' ).

lr_grid->create_text(
      row     = 2
      column  = 15
      colspan = 7
      text    = 'Week 31' ).

"Create columns 1 - 21
WHILE l_columns <= 21.
  l_day = l_columns.

  lr_grid->create_text(
    row     = 3
    column  = l_columns
    text    = l_day ).

  l_columns = l_columns + 1.
ENDWHILE.

lr_grid->set_grid_lines( if_salv_form_c_grid_lines=>horizontal_lines ).

gr_content = lr_grid.

CREATE OBJECT lr_dydos_window
  EXPORTING
    r_content = gr_content.

lr_dydos_window->display( ).

I expected to get a properly displayed grid with some spanned columns, however, the resulting grid shows up some additional black cells I did not added before. See [sample image|http://imageshack.us/photo/my-images/853/20110718122924.png/]

Currently I cannot figure out what causes this issue, can you?

Edit: I noticed when using an Abap list with class cl_salv_form_window_abap instead, the output is correct, no additional cells at the end. Obviously there is a flaw in the HMTL renderer.

Thanks,

Michael

Edited by: Michael Fritz on Jul 18, 2011 3:49 PM

2 REPLIES 2
Read only

former_member201275
Active Contributor
Read only

0 Likes
912

Hi,

thanks for your reply and the provided link.

The information within this link, however, is related to the ALV Grid control and not for the single class cl_salv_form_layout_grid, I'm using here to draw a grid with some data inline.

I did not use this class in any of the ALV Grid's events e.g. print_top_of_list or similar and I'm using SAP Gui for Windows and do not display this layout grid in any web browser, although this class builds some HMTL code to display its data.

Michael