Code listing for: Z_SET_CELL_STYLE

Description: Cell Style

**************************************************************************
*   Method attributes.                                                   *
**************************************************************************
Instantiation: Public
**************************************************************************

METHOD z_set_cell_style.

  FIELD-SYMBOLS <fs_data> TYPE lvc_s_data.
  IF row IS INITIAL.
    IF col IS INITIAL.
* Beides leer -> nichts zu tun.
      EXIT.
    ELSE.
* Nur Spalte setze komplette Spalte
      LOOP AT mt_data ASSIGNING <fs_data>
            WHERE col_pos = col.
        <fs_data>-style  = <fs_data>-style + style.
        <fs_data>-style2 = <fs_data>-style2 + style2.
      ENDLOOP.
    ENDIF.
  ELSE.
    IF col IS INITIAL.
* Nur Zeile eingegeben -> komplette Zeile setzen
      LOOP AT mt_data ASSIGNING <fs_data>
            WHERE row_pos = row.
        <fs_data>-style  = <fs_data>-style + style.
        <fs_data>-style2 = <fs_data>-style2 + style2.
      ENDLOOP.
    ELSE.
      READ TABLE mt_data ASSIGNING <fs_data>
          WITH KEY row_pos = row
                   col_pos = col.
      IF sy-subrc EQ 0.
        <fs_data>-style  = <fs_data>-style + style.
        <fs_data>-style2 = <fs_data>-style2 + style2.
      ELSE.
        EXIT.
      ENDIF.
    ENDIF.
  ENDIF.

ENDMETHOD.