Color coding of a row in ALV grid output.

Hi Experts,
I am using 'REUSE_ALV_GRID_DISPLAY_LVC' to display output of an Editable ALV.
Only one column is editable, if it does have any value.
I want to change the color of the row if a particular field in that row is not initial.
i have defined the layout and fieldcatalog as mentioned below:
DATA : gwa_fieldcat TYPE lvc_s_fcat,
       git_fieldcat TYPE lvc_t_fcat ,
       gwa_layout TYPE lvc_s_layo. "slis_layout_alv,
Please let me know how should i proceed.
Sample code will be very helpful for me, if any please paste here.
Thanks in Advance....

Hello.
Check this example:
TYPES:
  BEGIN OF ty_out,
    aufnr TYPE aufk-aufnr,
    linecolor(4) TYPE c, "Line color for alv
  END OF ty_out.
DATA: ti_out TYPE STANDARD TABLE OF ty_out.
DATA: wa_out TYPE ty_out.
DATA: gt_layout TYPE slis_layout_alv OCCURS 0 WITH HEADER LINE.
CLEAR w_linecolor.
LOOP AT ti_out ASSIGNING <fs1>.
    IF w_linecol EQ 'C000'.
       w_linecol = 'C300'.
    ELSE.
       w_linecol = 'C000'.
    ENDIF.
    <fs1>-linecolor = w_linecol.
  ENDLOOP.
* END-OF-SELECTION
END-OF-SELECTION.
  CLEAR gt_layout.
  MOVE 'LINECOLOR' TO gt_layout-info_fieldname.
  APPEND gt_layout.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program      = 'ZRPPVDO05'
      i_callback_user_command = 'USER'
      it_fieldcat             = ti_flat[]
      i_default               = 'X'
      i_save                  = 'A'
      is_variant              = variant_detail
      is_layout               = gt_layout
    TABLES
      t_outtab                = ti_out
    EXCEPTIONS
      program_error           = 1
      OTHERS                  = 2.
Hope this helps. Reward if helpfull.
Best regards.
Valter Oliveira.

Similar Messages

  • Changing font size(bold) or color of a particular row in ALV Grid Digplay

    Hi Experts ,
    I am having a requirment to highlight some particular rows in ALV Grid Display . To achieve this i need to change font size or make it bold or change color of that row .
    Please give me some inputs .
    Thanks in Advance.
    Vijyeta

    Hi
    Coloring An Entire Row
    Coloring a row is a bit (really a bit) more complicated. , you should add an additional field to your list data table. It should be of character type and length at least 4. This field will contain the color code for the row.
    First you have to declaration of our list data table u201Cgt_listu201D.
    DATA BEGIN OF gt_list OCCURS 0 .
    INCLUDE STRUCTURE SFLIGHT .
    DATA rowcolor(4) TYPE c .
    DATA END OF gt_list .
    Adding the field that will contain row color data
    As you guess, you should fill the color code to this field.  But how will ALV Grid know that you have loaded the color data for the row to this field. So, you make it know this by passing the name of the field containing color codes to the field u201CINFO_FNAMEu201D of the layout structure.
    e.g.
    ps_layout-info_fname = <field_name_containing_color_codes>. u201Ce.g. u2018ROWCOLORu2019
    You can fill that field anytime during execution. But, of course, due to the flow logic of screens, it will be reflected to your list display as soon as an ALV refresh occurs.
    Try this link also:
    Possible functionalities in ALV
    Regards
    Neha

  • Displaying the selected rows in ALV Grid output

    Hi Experts,
    I am developing one interactive ALV Grid report where user can process the selected records/rows from the ALV Grid output.
    for displaying the ALV Grid, I have used the class CL_GUI_ALV_GRID class. I am working on ECC 6.0 system.
    when I select any records/rows from output and then press any Application Toolbar button, PAI and then PBO modules of the screen gets executed as per the normal flow.
    however After PBO, when same ALV output comes, all the selected/highlighted rows appear as unselected, that means I want to retain the ALV
    rows selection during the round trip.
    please advise.
    Regards,
    Jagesh

    Hi,
    Feiyun Wu is correct.
    Get_selected_rows and set_selected_rows are the methods to be used .
    Some code:
    Note the sequence of code:
    FORM set_gui_alv_grid_1 .
      DATA: wa_layout TYPE lvc_s_layo ,
            wa_print TYPE lvc_s_prnt .
      DATA: it_sort TYPE lvc_t_sort ,
            wa_sort TYPE LINE OF lvc_t_sort .
      DATA: it_fieldcatalog TYPE lvc_t_fcat.
      IF gui_custom_container_1 IS INITIAL .
        CREATE OBJECT gui_custom_container_1
          EXPORTING
            container_name = 'GUI_CUSTOM_CONTAINER_1'
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS                      = 6 .
        IF sy-subrc <> 0.
        ENDIF.
        PERFORM get_field_catalog
          USING gc_log_group_1
          CHANGING it_fieldcatalog  .
        CREATE OBJECT gui_alv_grid_1
          EXPORTING i_parent = gui_custom_container_1.
        CREATE OBJECT ob_event_receiver_1
          EXPORTING log_group = gc_log_group_1 .
    * registers the event handlers
        SET HANDLER ob_event_receiver_1->handle_toolbar      FOR gui_alv_grid_1 .
        SET HANDLER ob_event_receiver_1->handle_user_command FOR gui_alv_grid_1 .
        SET HANDLER ob_event_receiver_1->print_top_of_page   FOR gui_alv_grid_1 .
        SET HANDLER ob_event_receiver_1->hotspot_click       FOR gui_alv_grid_1 .
        wa_layout-cwidth_opt = abap_true .
    *   wa_layout-excp_fname = gc_excp_fname .
    *   wa_layout-ctab_fname = gc_ctab_fname.
    *   wa_layout-excp_led   = abap_true .
        CALL METHOD gui_alv_grid_1->set_table_for_first_display
          EXPORTING
            is_layout       = wa_layout
            is_print        = wa_print
            i_save          = 'A'
            is_variant      = gs_disvariant_1
          CHANGING
            it_sort         = it_sort
            it_fieldcatalog = it_fieldcatalog
            it_outtab       = it_alv_grid_1.
      ELSE .
        CALL METHOD gui_alv_grid_1->refresh_table_display.
    * Restore selections
        CALL METHOD gui_alv_grid_1->set_selected_rows
          EXPORTING
            it_index_rows = ob_event_receiver_1->it_rows.
    * Restore position
        CALL METHOD gui_alv_grid_1->set_scroll_info_via_id
          EXPORTING
            is_col_info = ob_event_receiver_1->wa_col
            is_row_no   = ob_event_receiver_1->wa_roid.
      ENDIF.
    ENDFORM .                    "set_gui_alv_grid_1
    Regards.

  • Getting selected rows in ALV grid output

    Hi All,
    As per my requirement, in the ALV output i have 3 push buttons (Display, Edit and Print).
    Using the below code, I am trying to get the selected rows from the output.
        CALL METHOD ob_grid->check_changed_data
          CHANGING
            c_refresh = w_x.
        CALL METHOD ob_grid->get_selected_rows
          IMPORTING
            et_index_rows = is_rows.
    When I execute the code wid Display/Edit push buttons it is working fine as long as Print button is not used.
    If I use the Print button and then try to select any other push button, I am not getting the entries in is_rows internal table.
    Kindly help me.
    Thanks in Advance.

    Would your user actually select a row if they wanted simply to print?   I don't see that you're checking to see if the user actually selected a row ( after et_index_rows = is_rows, need to be sure is_rows is not initial (zero)).    Debug should show you exactly what is happening in the situation you described.

  • How to change a color for a row in ALV grid display

    Hi,
       how to change a color for a row in ALV grid display based on a condition.Any sample code plz

    Hello Ramya,
    Did you check in [SCN|How to color a row of  alv grid]
    Thanks!

  • Deactivate the double click/ hot spot for a particular row in alv grid.

    Hello,
       As per a certain condition how to deactivate the double click/ hot spot for a particular row in alv grid.
    Regards,
    Saroj

    where u define layout there is a field hotspot.like
    data: var.
    if con is true
    var = 'X'. (show hotspot)
    else.
    var = ' '. (deactive hotspot)
    elseif ws_fieldcat-fieldname = 'DMBTR'
                    AND ws_fieldcat-tabname = 'T_MTAB'.
          ws_fieldcat-do_sum = C_X.
          <b>ws_fieldcat-hotsopts = var.</b>
          MODIFY Wt_fieldcat FROM ws_fieldcat
                  TRANSPORTING   DO_SUM.
    It is helpful for u. if any problen send me ur coding i will change it.
    Regards
    Manish Kumar

  • Coloring of a (specific) row in ALV report-How?

    Hi Experts,
    Am looking to assign a color for a (specific)row in ALV report.......so, pls. let me know How to get it done?
    thanq

    TABLES:LFA1.
    SELECT-OPTIONS:LIFNR FOR LFA1-LIFNR.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    REGIO LIKE LFA1-REGIO,
    SORTL LIKE LFA1-SORTL,
    CFIELD(4) TYPE C,
    END OF ITAB.
    data:col(4).
    data:num value '1'.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE LIFNR
    IN LIFNR.
    LOOP AT ITAB.
    concatenate 'C' num '10' into col .
    ITAB-CFIELD = col.
    num = num + 1.
    if num = '8'.
    num = '1'.
    endif.
    MODIFY ITAB.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    DATA:EVE TYPE SLIS_T_EVENT WITH HEADER LINE.
    LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    LAYOUT-WINDOW_TITLEBAR = 'VENDORS DETAILS SCREEN'.
    LAYOUT-EDIT = 'X'.
    LAYOUT-info_fieldname = 'CFIELD'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    this is for coloring cols
    REPORT ZBHCOLOR_COLS.
    TABLES:LFA1.
    SELECT-OPTIONS:C_LIFNR FOR LFA1-LIFNR. " FOR GRID ONLY
    PARAMETERS:LIST RADIOBUTTON GROUP ALV DEFAULT 'X',
    GRID RADIOBUTTON GROUP ALV.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    SORTL LIKE LFA1-SORTL,
    REGIO LIKE LFA1-REGIO,
    COL TYPE LVC_T_SCOL,
    END OF ITAB.
    DATA:COLR TYPE LVC_S_SCOL.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB.
    LOOP AT ITAB.
    IF ITAB-LIFNR IN C_LIFNR.
    COLR-FNAME = 'NAME1'.
    COLR-COLOR-COL = '5'.
    COLR-COLOR-INT = '1'.
    COLR-COLOR-INV = '0'.
    COLR-NOKEYCOL = 'X'.
    APPEND COLR TO ITAB-COL.
    COLR-FNAME = 'LIFNR'.
    APPEND COLR TO ITAB-COL.
    MODIFY ITAB.
    ENDIF.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    LAYOUT-ZEBRA = 'X'.
    layout-coltab_fieldname = 'COL'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    IF LIST = 'X'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ELSEIF GRID = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ENDIF.
    Reward points if useful.

  • Color in ALV grid output based on condition

    Hi,
    I have generated a ALV Grid output.
    I have a internal table ITAB1. It has 2 fields - field1 and field2.
    Now, my requirement is if field1 is 'X', the row should be colored in RED, else if field1 is 'Y', the row should be colored in GREEN.
    How can it be done?
    Thanks,
    Shivaa.........

    Hi,
    add another field in the internal table with the type of char04.
    use the code given below....
    DATA : begin of itab occurs 0,
                  field1(10) type c,
                  field2(10) type c,
                  color(4) type c,
              end of itab.
    " fetch records in itab..
    loop at itab.
      if itab-field1 = 'X'.
          itab-color = 'C700'.         " Trial and error to get the color you want...
      elseif itab-field1 = 'Y'.
          itab-color = 'C300'.         " Trial and error to get the color you want...
      endif.
    endloop.
      fs_fcat-fieldname = 'FIELD1'.
      fs_fcat-col_pos = 1.
      fs_fcat-coltext = 'FIRST FIELD'.
      APPEND fs_fcat TO t_fcat.
      fs_fcat-fieldname = 'FIELD2'.
      fs_fcat-col_pos = 2.
      fs_fcat-coltext = 'SECOND FIELD'.
      APPEND fs_fcat TO t_fcat.
        fs_layo-sel_mode = 'A'.
        fs_layo-INFO_FNAME = 'COLOR'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_callback_program    = sy_cprog
          is_layout_lvc         = fs_layo
          it_fieldcat_lvc       = t_fcat
        TABLES
          t_outtab              = itab
        EXCEPTIONS
          program_error         = 1
          OTHERS                = 2.
    This resolves you issue....
    Cheers,
    Siddarth

  • HOW CAN I HAVE THE NUMBER OF SELECTED ROWS IN ALV GRID?

    HI.
    HOW CAN I HAVE THE NUMBER OF SELECTED ROWS IN ALV GRID????
    GABRY =)

    You need to use
    data : grid1  type ref to cl_gui_alv_grid.
      call method grid1->get_selected_rows
        importing
          et_index_rows = i_sel_alvrows[].

  • How to transpose rows to columns and columns to rows in alv grid

    can u plz tell me in alv grid how to
    display data from itab having data
    1
    2
    3 and so on
    how to print in alv in a single row ie
    1 2 3 and so on

    chk this code...
    REPORT  Z_TRANSPOSEALV                                    .
    * Type pools declaration for ALV
    TYPE-POOLS: slis.
    *Declarations for ALV, dynamic table and col no for transpose
    DATA:    l_col    TYPE sy-tabix,
             l_structure   TYPE REF TO data,
             l_dyntable    TYPE REF TO data,
             wa_lvc_cat  TYPE lvc_s_fcat,
             lt_lvc_cat  TYPE lvc_t_fcat,
             lt_fieldcatalogue     TYPE slis_t_fieldcat_alv,
             wa_fieldcat TYPE slis_fieldcat_alv,
             lt_fieldcat TYPE slis_t_fieldcat_alv,
             lt_layout   TYPE slis_layout_alv.
    *Field symbols declarations
    FIELD-SYMBOLS :
      <header>    TYPE ANY,
      <dynheader> TYPE ANY,
      <dyndata>   TYPE ANY,
      <ls_table>      TYPE ANY,
      <dynamictable>      TYPE STANDARD TABLE,
      <it_table> TYPE STANDARD TABLE.
    *Input the name of the table
    PARAMETERS p_table TYPE dd02l-tabname OBLIGATORY.
    *Initialization event
    INITIALIZATION.
    *Start of selection event
    START-OF-SELECTION.
    * Create internal table of dynamic type
      CREATE DATA l_dyntable TYPE STANDARD TABLE OF (p_table)
                           WITH NON-UNIQUE DEFAULT KEY.
      ASSIGN l_dyntable->* TO <it_table>.
    *select statement to select data from the table as input into
    *our dynamic internal table.
    *Here i have restricted only till 5 rows.
    *You can set a variable and give no of rows to be fetched
    *The variable can be set in your select statement
    SELECT * INTO CORRESPONDING FIELDS OF TABLE <it_table>
                    FROM (p_table) up to 5 rows.
    *Fieldcatalogue definitions
      wa_lvc_cat-fieldname = 'COLUMNTEXT'.
      wa_lvc_cat-ref_table = 'LVC_S_DETA'.
      APPEND wa_lvc_cat TO lt_lvc_cat.
      wa_fieldcat-fieldname = 'COLUMNTEXT'.
      wa_fieldcat-ref_tabname = 'LVC_S_DETA'.
      wa_fieldcat-key  = 'X'..
      APPEND wa_fieldcat TO lt_fieldcat.
      DESCRIBE TABLE <it_table>.
      DO sy-tfill TIMES.
    *   For each line, a column 'VALUEx' is created in the fieldcatalog
    *   Build Fieldcatalog
        WRITE sy-index TO wa_lvc_cat-fieldname LEFT-JUSTIFIED.
        CONCATENATE 'VALUE' wa_lvc_cat-fieldname
               INTO wa_lvc_cat-fieldname.
        wa_lvc_cat-ref_field = 'VALUE'.
        wa_lvc_cat-ref_table = 'LVC_S_DETA'.
        APPEND wa_lvc_cat TO lt_lvc_cat.
    *   Build Fieldcatalog
        CLEAR wa_fieldcat.
        wa_fieldcat-fieldname = wa_lvc_cat-fieldname.
        wa_fieldcat-ref_fieldname = 'VALUE'.
        wa_fieldcat-ref_tabname = 'LVC_S_DETA'.
        APPEND wa_fieldcat TO lt_fieldcat.
      ENDDO.
    * Create dynamic internal table
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = lt_lvc_cat
        IMPORTING
          ep_table        = l_dyntable.  ASSIGN l_dyntable->* TO <dynamictable>.
    * Create structure as structure of the internal table
      CREATE DATA l_structure LIKE LINE OF <dynamictable>.
      ASSIGN l_structure->* TO <header>.
    * Create structure = structure of the internal table
      CREATE DATA l_structure LIKE LINE OF <it_table>.
      ASSIGN l_structure->* TO <ls_table>.
    * Create field catalog from our table structure
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = p_table
        CHANGING
          ct_fieldcat            = lt_fieldcatalogue
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.  DESCRIBE TABLE lt_fieldcatalogue.
    * Fill the internal to display <dynamictable>
      DO sy-tfill TIMES.
        IF sy-index = 1.
          READ TABLE lt_fieldcatalogue INTO wa_fieldcat INDEX 1.
        ENDIF.
    *   For each field of it_table
        ASSIGN COMPONENT 1 OF STRUCTURE <header> TO <dynheader>.
        IF sy-subrc NE 0. EXIT .ENDIF.
        READ TABLE lt_fieldcatalogue INTO wa_fieldcat INDEX sy-index.
    *   Fill 1st column
        <dynheader> = wa_fieldcat-seltext_m.
        IF <dynheader> IS INITIAL.
          <dynheader> = wa_fieldcat-fieldname.
        ENDIF.
    *Filling the other columns
        LOOP AT <it_table> INTO <ls_table>.
          l_col = sy-tabix + 1.
          ASSIGN COMPONENT sy-index OF STRUCTURE <ls_table> TO <dyndata>.
          IF sy-subrc NE 0. EXIT .ENDIF.
          ASSIGN COMPONENT l_col OF STRUCTURE <header> TO
    <dynheader>.
          IF sy-subrc NE 0. EXIT .ENDIF.
          WRITE <dyndata> TO <dynheader> LEFT-JUSTIFIED.
        ENDLOOP.
        APPEND <header> TO <dynamictable>.
      ENDDO.
    *Layout for ALV output
      lt_layout-zebra = 'X'.
      lt_layout-no_colhead = 'X'..
      lt_layout-colwidth_optimize ='X'.
      lt_layout-window_titlebar = 'ALV GRID TRANSPOSED'.
    *ALV Grid output for display
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          is_layout   = lt_layout
          it_fieldcat = lt_fieldcat
        TABLES
          t_outtab    = <dynamictable>.

  • Grey out(disable) a row in ALV grid

    Hi,
    I want to know how to grey out(disable) row wise in ALV grid display.
    i..e.. Few rows in ALV grid display shoud be editable and few rows non editable based on certain condition.
    How do we do that....Please help.
    Thanks in advance.

    Hi,
    Since fieldcatalog is used to modify coloum and not the row, the fieldcatalog would not solve the problem.
    Thankyou.

  • Default 10 rows in ALV grid

    Hi Group,
    My requirement is to show 10 default rows in ALV grid (with 4 fields in ALV grid), whenever Create radio button is selected in Selection Screen.
    Please could you help me with this.
    Thanks and Regards,
    Kumar.

    Thanks for your reply.
    Sorry I forgot to mention earlier.
    I have to show default 10 empty rows (editable) whenever the Create radio button is selected on the Sel Screen.
    Kindly assist with this regard.
    Thanks and Regards,
    Kumar.

  • Set specific rows in ALV grid ready for input

    Hi everyone,
      I have a question about how to set specific rows in ALV grid ready for input.
      I know that I can make some columns ready for input before the ALV displayed,but I have no idea how to make specific rows displayed in the ALV ready for input.

    Hello Aaron
    For editable columns we can use the fieldcatalog (LVC_S_FCAT-EDIT = 'X') but for rows you need to define editability on cell level.
    The required steps are documented in sample report BCALV_EDIT_02. Below I point out a few crucial points:
    *§1.Extend your output table for a field, e.g., CELLTAB, that holds
    *   information about the edit status of each cell for the
    *   corresponding row (the table type is SORTED!).
    DATA: BEGIN OF gt_outtab occurs 0.  "with header line
            include structure sflight.
    DATA: celltab type LVC_T_STYL.
    DATA: END OF gt_outtab.
    *§3.Provide the fieldname of the celltab field by using field
    *   STYLEFNAME of the layout structure.
       gs_layout-stylefname = 'CELLTAB'.
       CALL METHOD grid1->set_table_for_first_display
             EXPORTING i_structure_name = 'SFLIGHT'
                       is_layout        = gs_layout
             CHANGING  it_outtab        = gt_outtab[].
    Note: in the sample report only field SEATSMAX is editable. In your case you need
    to fill CELLTAB for all fields in a row.
    *§2.After selecting data, set edit status for each row in a loop
    *   according to field SEATSMAX.
      LOOP AT gt_outtab.
        l_index = sy-tabix.
        refresh lt_celltab.
        if gt_outtab-seatsmax ge 300.
            perform fill_celltab using 'RW'
                                 changing lt_celltab.
        else.
            perform fill_celltab using 'RO'
                                 changing lt_celltab.
        endif.
    *§2c.Copy your celltab to the celltab of the current row of gt_outtab.
        INSERT LINES OF lt_celltab INTO TABLE gt_outtab-celltab.
        MODIFY gt_outtab INDEX l_index.
      ENDLOOP.
    ENDFORM.                               " SELECT_DATA_AND_INIT_STYLE
    NOTE: LVC_T_STYL is a SORTED table type. Thus, take care that you are using the
    INSERT ... INTO TABLE statement and not APPEND (because then nothing is appended
    to the CELLTAB itab).
      IF p_mode EQ 'RW'.
    *§2a.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell
    *    to status "editable".
        l_mode = cl_gui_alv_grid=>mc_style_enabled.
      ELSE. "p_mode eq 'RO'
    *§2b.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_DISABLED to set a cell
    *    to status "non-editable".
        l_mode = cl_gui_alv_grid=>mc_style_disabled.
      ENDIF.
      ls_celltab-fieldname = 'SEATSMAX'.
      ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
      INSERT ls_celltab INTO TABLE pt_celltab.
    Regards
      Uwe

  • How to download alv grid output(with field catalog) into excel file format

    Hi all,
    How to download alv grid output(with field catalogs) into excel file format and same file has to download to application server.
    Please help.
    Regards,
    Satya.

    Hi,
    On list where alv is displayed, select export icon( green color -> ),select spread sheet.
    This will display records in Excel sheet.

  • Bold line in ALv grid output

    Hi,
    I want show few line item informations in bold in ALV grid output.
    Please let me know your suggestions.

    You may check the below links.
    some methods to achieve this is mentioned out there.
    Re: BOLD cell in ALV.
    Re: ALV Row should apper in BOLD when order type is "ZSTP1" in the cloumn
    Regards,
    Anil

Maybe you are looking for

  • How do I easily transfer data from Palm Desktop to iCal and Address Book?

    Hello, How do I easily transfer data from Palm Desktop to iCal and Address Book? I have a Palm Tungsten E handheld which just died. Luckily, all my data is backed-up on my Palm Desktop V4.2.1. I just bought an iPod-Touch, so I would like to easily tr

  • Problem in IDOC to SOAP Scenario

    Hi All, we have an IDOC to SOAP scenario in which we have got WSDL from the client for the targets.. Please let us know the WSDL would be the message type and we need to create interface for it . Also the SOAP header is not appearing in the target  x

  • Why object M_MATE_NEU?

    Hi together In different Retail systems we have (now) the object M_MATE_NEU which is used o.e. in transaction mm41. Until now we inserted the object in the roles whit mm41 because is needed to create new products, etc... But in my opinion this object

  • Parent.opener don´t work

    I have a problem in FireFox (10.0.2). I´m java developer. I have two windows: A with 2 frames A1 and A2 B with 2 frames B1 and B2 O frame A1 call a new window B (with rames B1 and B2) . When I in B1 and want to call A or A1, give a error. "parent.ope

  • Partition problems for OSX upgrade! YIPES!!

    Hello, I have an original bondi blue imac with an upgraded 466mhz chip and a 40G harddrive. I have performed all of the tasks required to upgrade to OSX I have acquired the system on BLACK Cds (10.3.5) I have upgraded my firmware I have backed up my