How to color a line in ALV Dispaly

Hi Abaper,
As of my requirement i want to display output of the report for certain lines in a color iam using ALV method,
Plz help me ASAP
answer will be reward.
Thanks in advance
hema

Hi Hema..
this is The code for Applying the colors For Lines or Cells also..
report  yacpr0007.
This must be included in order to create the fieldcatalog.
type-pools: slis.
parameters: p_dummy type c.
types: begin of ty_data,
         select type c,
         f1 type i,
         f2 type i,
         f3 type i,
         color_line(4) type c, " Line color
         color_cell type lvc_t_scol, " Cell color
       end of ty_data.
constants: c_true  type boolean_flg value 'X',
           c_false type boolean_flg value space.
data: i_data type table of ty_data,
      i_field_cat type slis_t_fieldcat_alv,
      s_layout    type slis_layout_alv.
start-of-selection.
  perform f_create_field_cat.
  perform f_set_layout.
  perform f_create_data.
end-of-selection.
  perform f_display_grid.
*&      @FORMS
*&      Form  f_create_data
Create some sample data.
form f_create_data.
  data: lw_data type ty_data,
        lw_color_cell like line of lw_data-color_cell.
  do 15 times.
    clear lw_data.
    lw_data-f1 = sy-index.
    case sy-index.
      when 3.
**/ Set the row or cell to color
        lw_data-color_line = 'C410'.
      when 8.
        lw_color_cell-color-col = 6.
        lw_color_cell-fname = 'F1'.
        append lw_color_cell to lw_data-color_cell. "/ .
    endcase.
    lw_data-f2 = sy-index * 2.
    lw_data-f3 = lw_data-f1 + lw_data-f2.
    append lw_data to i_data.
  enddo.
endform.                    "f_create_data
*&      Form  f_create_field_cat
  Create the fieldcatalog.  This needs to contain a minimum of
  the names of the fields you wish to display.  However there are
  numerous other things which can be added such as position, colour etc.
form f_create_field_cat.
**/ Add data to the field catalog
  perform f_append_row using: 'F1' 'field one' 3,
                              'F2' 'field two' 2,
                              'F3' 'field three' 1.  "/ .
endform.                    "f_create_field_cat
*&      Form  f_append_row
Append a single row to the field catalog.
     -->L_NAME     The name of the field to be added.
     -->L_DESC     The description for the column heading.
     -->L_POS      The column number for the field.
form f_append_row using pv_name pv_desc pv_pos.
  data: lw_field_cat like line of i_field_cat.
**/ Append the field catalog record.
  lw_field_cat-fieldname = pv_name.
  lw_field_cat-seltext_l = pv_desc.
  lw_field_cat-col_pos = pv_pos.
  append lw_field_cat to i_field_cat. "/ .
endform.                    "f_append_row
*&      Form  f_set_layout
Set the layout including the field names used to indicate the
cells or rows should be coloured.
form f_set_layout.
  s_layout-colwidth_optimize = space.
  s_layout-no_colhead = space.
  s_layout-zebra = space.
  s_layout-no_vline = space.
**/ Field that identify color line in internal table
  s_layout-info_fieldname = 'COLOR_LINE'.
Field that identify cell color in inetrnal table
  s_layout-coltab_fieldname = 'COLOR_CELL'. "/ .
endform.                    "f_create_layout
*&      Form  f_display_grid
Call the function to display the grid.
form f_display_grid.
**/ You need to pass in a minimum of the fieldcatalog and the table of data
  call function 'REUSE_ALV_GRID_DISPLAY'
exporting
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
  I_CALLBACK_PROGRAM                = ' '
  I_CALLBACK_PF_STATUS_SET          = ' '
  I_CALLBACK_USER_COMMAND           = ' '
  I_CALLBACK_TOP_OF_PAGE            = ' '
  I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
  I_CALLBACK_HTML_END_OF_LIST       = ' '
  I_STRUCTURE_NAME                  =
  I_BACKGROUND_ID                   = ' '
  I_GRID_TITLE                      =
  I_GRID_SETTINGS                   =
   is_layout                         = s_layout
**/ the field catalog.  Tells SAP what to display
   it_fieldcat                       = i_field_cat
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         = 'X'
  I_SAVE                            = ' '
  IS_VARIANT                        =
  IT_EVENTS                         =
  IT_EVENT_EXIT                     =
  IS_PRINT                          =
  IS_REPREP_ID                      =
  I_SCREEN_START_COLUMN             = 0
  I_SCREEN_START_LINE               = 0
  I_SCREEN_END_COLUMN               = 0
  I_SCREEN_END_LINE                 = 0
  IT_ALV_GRAPHICS                   =
  IT_HYPERLINK                      =
  IT_ADD_FIELDCAT                   =
  IT_EXCEPT_QINFO                   =
  I_HTML_HEIGHT_TOP                 =
  I_HTML_HEIGHT_END                 =
IMPORTING
  E_EXIT_CAUSED_BY_CALLER           =
  ES_EXIT_CAUSED_BY_USER            =
**/ The table of data and exceptions
    tables
      t_outtab                          = i_data
   exceptions
     program_error                     = 1
     others                            = 2
  if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.
endform.                    "f_display_grid
<b>reward if Helpful</b>

Similar Messages

  • Color a line in ALV Grid Control

    <<Do not ask for or offer points>>
    Hi all,
    How to color a line in ALV Grid Control using OOPs.
    The appropriate replies will be rewarded.
    regards,
    S Philip
    Edited by: Matt on Dec 22, 2008 11:05 AM

    <<Points unassigned - cut and paste not allowed.  http://sgstocks.tripod.com/alvgrid_control.htm>>
    Hi,
    To color a line, the structure of the  table must include a  Char4 field  for color properties
    TYPES: BEGIN OF st_sflight.
            INCLUDE STRUCTURE zsflight.
          Field for line color
    types:  line_color(4) type c.
    TYPES: END OF st_sflight.
    TYPES: tt_sflight TYPE STANDARD TABLE OF st_sflight.
    DATA: gi_sflight TYPE tt_sflight.
    Loop trough the table to set the color properties of each line. The color properties field is
    Char 4 and the characters is set as follows:
    Char 1 = C = This is a color property
    Char 2 = 6 = Color code (1 - 7)
    Char 3 = Intensified on/of = 1 = on
    Char 4 = Inverse display = 0 = of
         LOOP AT gi_sflight INTO g_wa_sflight.
          IF g_wa_sflight-paymentsum < 100000.
            g_wa_sflight-line_color    = 'C610'.
          ENDIF.
          MODIFY gi_sflight FROM g_wa_sflight.
        ENDLOOP.
    Name of the color field
    gs_layout-info_fname = 'LINE_COLOR'.
    Grid setup for first display
    CALL METHOD go_grid->set_table_for_first_display
          EXPORTING i_structure_name = 'SFLIGHT'
                                 is_layout                = gs_layout
          CHANGING  it_outtab                 = gi_sflight.
    Regards,
    John
    Edited by: Matt on Dec 22, 2008 11:18 AM

  • How to insert horizontal lines in alv report?

    hi,
        i have to insert horizontal lines in alv report.( RM07MLBB )
            actually my requirement is:
                               basis list = RM07MLBB.
    first secondary list = another report is called here ( RM07DOCS )
                      i want to insert horizontal lines in the first secondary list, when i execute individually RM07DOCS , i can get horizontal lines, but when i dounle click in the basic list --> in the first secondary list , i am not getting the horizontal lnes.
    functional modules used are REUSE_ALV_HIERSEQ_LIST_DISPLAY & REUSE_ALV_GRID_DISPLAY.
        here in this program,
                        is_layout = alv_layout.
    hence i tried to give     
                  alv_layout-no_hline = ' '. 
    but not effecting.
              can some one please tell me , how to insert lines in the alv report.
    thanks in advance,
    Dastagir.

    hello,
         so i cannot insert horizontal lines in the first secondary list according to my sorting condition, i.e., in a single block there should be :
           if same delivery challan number is repeating they should come in the same block,
    for the corresponding delivery challen number, if have po number, is repeating , they also should come in the same block.
                       in this way i have to seperate the blocks containing EXNUM , EBELN CONDITIONED.

  • How to create blank line in alv output

    Hi all,
    Iam getting alv output with currency values like below
    text1    20.0  10.0  30.0
    text2    25.0  11.0  30.0
    text3    27.0  19.0  30.0
    text1    24.0  18.0  30.0
    text2    27.0  16.0  30.0
    text3    29.0  15.0  30.0
    text1    23.0  17.0  30.0
    text2    22.0  13.0  30.0
    text3    21.0  14.0  30.0
    and so on...
    My requirement is to create blank line after text3. Since its currency field even i claer work area iam able to get 0.0.
    If i use no-zero in field catalog i will be able to get blank values for all 0.0, but thats not required.
    Can u help me out how to crate blank line after one set of values(text1, text2, text3) in alv display
    Thanks

    Hi,
    If i use no-zero, then all 0.0 will be replaced by blank, but that is not required.
    I want only blank line to be displayed after set of line items.
    Skip doesn't help in alv. Secondly if i append blank work area i will be getting 0.0 as it is a currency field.

  • How to color a row in ALV grid display

    Hi,
    A few rows in the output of ALV grid display should be shown in different color.How can I achieve this?

    Hi,
    Try out this code
    DATA : BEGIN OF G_T_CASH OCCURS 0,
           PARTICULARS TYPE CHAR120,
           AMOUNT1 TYPE CHAR20,
           AMOUNT2 TYPE CHAR20,
           AMOUNT3 TYPE CHAR20,    
           ROW_COLOR TYPE CHAR4,----
    add this in the internal table for alv
          END OF G_T_CASH.
      CLEAR G_WA_CASH.
      G_WA_CASH-PARTICULARS = 'Opening Cash Balance'.
      G_WA_CASH-AMOUNT1 = G_DMBTR.
      G_WA_CASH-AMOUNT2 = ''.
      G_WA_CASH-AMOUNT3 = ''.
    while appending other values also add the following code
      G_WA_CASH-ROW_COLOR = 'C200'.----- C200 depicts light gray color
      APPEND G_WA_CASH TO G_T_CASH.
    add the following code in layout
    MOVE 'ROW_COLOR' TO WA_LS_LAYOUT-INFO_FIELDNAME.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_BYPASSING_BUFFER = ' '
          I_SAVE             = 'A'
        I_CALLBACK_PROGRAM                = SY-REPID
      I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
       I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
         IS_LAYOUT                        = WA_LS_LAYOUT
         IT_FIELDCAT                      = G_T_CATALOG
         IT_EVENTS                         = GT_EVENTS
         TABLES
           T_OUTTAB                       = G_T_CASH[]
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Let me know if the problem still persist.
    Regards,
    Janaki

  • How To Color Alternate Lines in ADF Table

    Hi everyone, I want to color alternate the lines of a ADF Table. I have tried the “banding” property of the <af:table> tag but it alternates rows colours with white background. I would like to alternate with two custom colours like blue and light blue.
    Is this possible?
    Thanks in advance.
    PS: I have checked the styles funcionatily of ADF faces but I could not find any solution there.

    Hi,
    I am new to the Jdeveloper and also for the adf components.Actually i am working with the project which has already designed.Now i have to change the look n feel.
    I want to change the color of the table colums.So could u tell me in which file i have to change and how.
    I put in the jdeveloper.css like this ......
    column.cell-number-band{
    color :Teal
    And in the adf-faces-config.xml i had only "oracle" type of skin.
    I have to finish the work tomarrow itself......
    So anybody helps me it will be greatfull me.

  • Coloring particular line in ALV

    Hi Experts,
    I want to make color to parrticular line when it satisfies the condition in ALV report.
    I am not using SLIS.
    so is there any alternavite to clolor row on specific condition like...NETWR > 10000,
    that row shold be in RED color.
    Please give me Example of code.
    Poins will be awarded soon.
    Thanks,
    Rohan

    Hi,
    Check this code,
    type-pools slis.
    data: fieldcat type slis_t_fieldcat_alv.
    data: begin of imara occurs 0,
          matnr type mara-matnr,
          mtart type mara-mtart,
          maktx type makt-maktx,
          color_line(4) type c,
          end of imara.
    data: xcolor type slis_specialcol_alv.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM write_report.
    Get_Data
    FORM get_data.
      imara-matnr = 'ABC'.
      imara-mtart = 'ZCFG'.
      imara-maktx = 'This is description for ABC'.
      APPEND imara.
      imara-matnr = 'DEF'.
      imara-mtart = 'ZCFG'.
      imara-maktx = 'This is description for DEF'.
      APPEND imara.
      imara-matnr = 'GHI'.
      imara-mtart = 'ZCFG'.
      imara-maktx = 'This is description for GHI'.
      APPEND imara.
      imara-matnr = 'JKL'.
      imara-mtart = 'ZCFG'.
      imara-maktx = 'This is description for JKL'.
      APPEND imara.
      DATA: color_code(1) TYPE n VALUE '1'.
      data: color_line(4) type c.
      LOOP AT imara.
        AT NEW matnr.
          CONCATENATE 'C' color_code '10' INTO color_line.
          color_code = color_code + 1.
          IF color_code = '8'.
            color_code = '1'.
          ENDIF.
        ENDAT.
        imara-color_line = color_line..
        MODIFY imara.
      ENDLOOP.
    ENDFORM.                    "get_data
    WRITE_REPORT
    FORM write_report.
      DATA: layout TYPE  slis_layout_alv.
      layout-info_fieldname = 'COLOR_LINE'.
      PERFORM build_field_catalog.
    CALL ABAP LIST VIEWER (ALV)
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          is_layout   = layout
          it_fieldcat = fieldcat
        TABLES
          t_outtab    = imara.
    ENDFORM.                    "write_report
    BUILD_FIELD_CATALOG
    FORM build_field_catalog.
      DATA: fc_tmp TYPE slis_t_fieldcat_alv WITH HEADER LINE.
      CLEAR: fieldcat. REFRESH: fieldcat.
      CLEAR: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material Number'.
      fc_tmp-fieldname  = 'MATNR'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '18'.
      APPEND fc_tmp TO fieldcat.
      CLEAR: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material Type'.
      fc_tmp-fieldname  = 'MTART'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '4'.
      APPEND fc_tmp TO fieldcat.
      CLEAR: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material'.
      fc_tmp-fieldname  = 'MAKTX'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '40'.
      APPEND fc_tmp TO fieldcat.
    ENDFORM.         
    reward if helpful.
    regards,
    pritha.

  • How to select multiple lines in ALV report

    hi gurus,
    I am working on an interactive ALV report where i have to select multiple lines from the basic list into an internal table, based on check box clicks. Using RS_SELFIELD i can select only 1 row. The coding has been done based on Call Function. Can u please suggest some way.
    Regards,
    Satyajit

    hi,
    try like this
    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    TYPES: BEGIN OF t_ekko,
      sel,                         "stores which row user has selected
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          fieldcatalog1 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE slis_layout_alv,
          gd_repid     LIKE sy-repid.
    DATA : BEGIN OF det_tab OCCURS 0,
            ebeln LIKE ekpo-ebeln,
           END OF det_tab.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
    *       Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.        "Display column total
      fieldcatalog-datatype     = 'CURR'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    FORM build_layout.
      gd_layout-box_fieldname     = 'SEL'.
      "set field name to store row selection
      gd_layout-edit              = 'X'. "makes whole ALV table editable
      gd_layout-zebra             = 'X'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       Display report using ALV grid
    FORM display_alv_report.
      gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = gd_repid
          i_callback_user_command  = 'USER_COMMAND'
          i_callback_pf_status_set = 'SET_STAT'
          is_layout                = gd_layout
          it_fieldcat              = fieldcatalog[]
          i_save                   = 'X'
        TABLES
          t_outtab                 = it_ekko
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO CORRESPONDING FIELDS OF TABLE it_ekko.
    ENDFORM.                    " DATA_RETRIEVAL
    *       FORM USER_COMMAND                                          *
    *       --> R_UCOMM                                                *
    *       --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    * Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
          IF rs_selfield-fieldname = 'EBELN'.
            READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
            SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
            CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
          ENDIF.
        WHEN 'DET'.  "button add by me
          CLEAR det_tab.
          REFRESH det_tab.
          LOOP AT it_ekko INTO wa_ekko WHERE sel = 'X'.
            MOVE-CORRESPONDING wa_ekko TO det_tab.
            APPEND det_tab.
          ENDLOOP.
          PERFORM build_cat.
          PERFORM dis_data.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  set_stat
    *       text
    *      -->RT_EXTAB   text
    FORM set_stat USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZSTAT' EXCLUDING rt_extab.
    ENDFORM.                    "set_stat
    *&      Form  build_cat
    *       text
    FORM build_cat.
      CLEAR fieldcatalog1.
      REFRESH fieldcatalog1.
      fieldcatalog1-fieldname = 'EBELN'.
      fieldcatalog1-tabname = 'DET_TAB'.
      fieldcatalog1-seltext_m = 'Order No.'.
      fieldcatalog1-outputlen = 10.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR fieldcatalog1.
    ENDFORM.                    "build_cat
    *&      Form  dis_data
    *       text
    FORM dis_data.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = 'ZTEST_DS'
          it_fieldcat        = fieldcatalog1[]
          i_save             = 'X'
        TABLES
          t_outtab           = det_tab.
    ENDFORM.                    "dis_data
    here i have copied standard gui status of ALV into my z status ZSTAT and add one button DET......
    here u can select morethan one line using control(ctrl)
    reward if usefull...

  • How to color the title in ALV grid

    Hi all,
    There is a title getting displayed in my ALV grid. could any one pls tell if there is any possibililty to colour it.
    Thanks

    Hi Deepti,
    Kindly check this out:
    MACROS
    FIELD CATALOGUE ENTRY FOR Keyed FIELDS
    DEFINE catfield.
    1= Fieldname,  2= Description, 3=Key
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = &1.
      ls_fieldcat-key          = &3.
      ls_fieldcat-hotspot       = &3.
    ls_fieldcat-key_sel      = 'X'.
      ls_fieldcat-tabname    = 'T_OUT'.
    Output length will be optimised by ALV
    ls_fieldcat-outputlen = '6'.
      ls_fieldcat-seltext_m = &2.
      append ls_fieldcat to gt_fieldcat.
    color   C or X   1-9 = color number 0/1 intensified 0/1 inverse
      ls_fieldcat-emphasize = 'C100'.
    END-OF-DEFINITION.
    FIELD CATALOGUE ENTRY FOR SUMMED FIELDS
    DEFINE catsum.
    1= Fieldname,  2= color, 3= Description,
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = &1.
      ls_fieldcat-do_sum       = 'X'.
      ls_fieldcat-key_sel      = 'X'.
      ls_fieldcat-tabname    = 'T_OUT'.
      ls_fieldcat-emphasize = &2.
      ls_fieldcat-seltext_m = &3.
      append ls_fieldcat to gt_fieldcat.
    END-OF-DEFINITION.

  • How to append a line in alv grid display

    Hi experts!
    I have to append a new line into my existing alv and then save it in the database.
    can you help me out with that.
    thanks

    Hi,
    Check these links for more details -
    http://www.sapfans.com/forums/viewtopic.php?t=84933
    http://www.sapfans.com/forums/viewtopic.php?t=69878
    ashish

  • How to set some line in ALV-OO as selected

    Hi,
    i use ALV-OO and will set some outputlines before first output as selected.
    Example:
    i have an output of 10 line. I will set line 2, 6, and 9 with default as selected because some valuy is greater as 1000.
    I will set it befaore the first output. Is this possible?
    Regards, Dieter

    Hi Himanshu,
    i have tested it and first it works like i want.
    But in second way i think in our case it's better to take editory checkboxes.
    Thanks for answer.
    Regards, Dieter

  • How to See Total line in Alv Table

    hi friends,
             i write all code for totaling in WDDOINIT() Method of my View , but i can not see the total line .
             pls help me

    Hai Shah,
    In the settings tab of alv,you will find <b>Calculation</b>, select that tab
    in that u select the column for which u want the total.
    And u also have one option whethe to display the total at the start of table,
    or at the end of table.
    inorder ot get that calculation tab in settings ,you need to write the follwing code when instantiating the ALV,
    l_value = l_ref_interfacecontroller->get_model(
    l_value->if_salv_wd_std_functions~set_aggregation_allowed( ).
    Cheers,
    Madhu

  • HOW TO REMOVE BORDER LINE IN ALV LIST

    Hi Abapers,
    I am using blockded list  I don't need the border line of list as per my requirement.
    ho to remove the border line for the list output.
    I hope some body will help me.
    Regards,
    Chandra Shaker.

    If you use the OO way to do alv, (class CL_GUI_ALV_GRID), in table GS_LAYOUT you have fields NO_HGRIDLN & NO_VGRIDLN to remove verticals and horizontal lines.
    GS_LAYOUT-NO_HGRIDLN = 'X'.
      CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IS_LAYOUT                      = GS_LAYOUT
          IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
        CHANGING
          IT_OUTTAB                       = WT_MD[]
          IT_FIELDCATALOG           = GT_FIELDCAT.

  • How to print all lines in alv report?

    hi
    i am using the functions 'FP_JOB_OPEN'  and 'FP_JOB_CLOSE'  in order to print the form
    i want it to be printed without prompting me the 'PRINT' window and pushing the ok button .
    is there a way to do that ? i put reqimm = 'X' and nodialog = 'X' but it didnt fix it
    thanks

    Hi Ami,
       At START-OF-SELECTION event write your code between below statements.
    NEW-PAGE PRINT ON NO DIALOG.
    Your Code
    NEW-PAGE PRINT OFF.
    This statement NEW-PAGE PRINT ON with addition of NO DIALOG will not prompt you for Printer selection. It will directly create a spool.

  • Coloring column in an ALV tree

    Hi all,
    What I want to do is set background color for columns in a tree-view ALV(class cl_gui_alv_tree). However no matter how I set the field EMPHASIZE in the fieldcatalog internal table, the display of the ALV tree keeps unchange. Anyone can help me on this?
    Thanks,
    Chen Chang

    Hi,
    <b>If u want to change the node colr in ALV tree do as follows</b>
    Adding Root Nodes for the tree.
    Key:
    NODE_KEY, RELATKEY, RELATSHIP, HIDDEN, DISABLED, ISFOLDER, N_IMAGE,
    EXP_IMAGE, <b>STYLE</b>, LAST_HITEM, NO_BRANCH, EXPANDER, DRAGDROPID, TEXT
      perform f9101_node_list using: '1' 'ROOT' '' '' '' c_x '' '' '' '' ''
                              c_x '' text-003.
    Adding subitems for the root node.
      perform f9101_node_list using:
                            Material Details
                              'MATRL' '1' '' '' '' '' '' '' '' '' '' '' ''
                              text-001,
                            Document Details
                              'DOCU' '1' '' '' '' '' '' '' '' '' '' '' ''
                              text-002.
    form f9101_node_list using    value(pnodekey)
                                 value(prelatkey)
                                 value(prelatship)
                                 value(phidden)
                                 value(pdisabled)
                                 value(pisfolder)
                                 value(pimage)
                                 value(pexpimage)
                                 value(pstyle)
                                 value(plastitem)
                                 value(pnobranch)
                                 value(pexpander)
                                 value(pdragdropid)
                                 value(ptext).
      w_nodes-node_key   = pnodekey.
      w_nodes-relatkey   = prelatkey.
      w_nodes-relatship  = prelatship. "Natural number
      w_nodes-hidden     = phidden.
      w_nodes-disabled   = pdisabled.
      w_nodes-isfolder   = pisfolder.
      w_nodes-n_image    =  pimage.  "Icons / embedded bitmap
      w_nodes-exp_image  = pexpimage. "Icons / embedded bitmap
    <b>  w_nodes-style      = pstyle.</b>  w_nodes-last_hitem = plastitem. "Tree Control: Column Name / Item
      "Name
      w_nodes-no_branch  = pnobranch.
      w_nodes-expander   = pexpander.
      w_nodes-dragdropid = pdragdropid.
      w_nodes-text       = ptext.
      append w_nodes to i_nodes.
    endform.                    " f9101_node_list
    Try changing the style so that u can change the column color.
    If u want that in ALV grid
    1. different color in line of alv
    2. Coloring Cells/rows in ALV Grid.
    Got this from forum
    report .
    Use of colours in ALV grid (cell, line and column) *
    Table
    tables : mara.
    Type
    types : begin of ty_mara,
    matnr like mara-matnr,
    matkl like mara-matkl,
    counter(4) type n,
    free_text(15) type c,
    color_line(4) type c, " Line color
    color_cell type lvc_t_scol, " Cell color
    end of ty_mara.
    Structures
    data : wa_mara type ty_mara,
    wa_fieldcat type lvc_s_fcat,
    is_layout type lvc_s_layo,
    wa_color type lvc_s_scol.
    Internal table
    data : it_mara type standard table of ty_mara,
    it_fieldcat type standard table of lvc_s_fcat,
    it_color type table of lvc_s_scol.
    Variables
    data : okcode like sy-ucomm,
    w_alv_grid type ref to cl_gui_alv_grid,
    w_docking_container type ref to cl_gui_docking_container.
    parameters : p_column as checkbox,
    p_line as checkbox,
    p_cell as checkbox.
    at selection-screen output.
    perform get_data.
    perform fill_catalog.
    if w_docking_container is initial.
    perform create_objects.
    endif.
    *& Form create_objects
    form create_objects.
    create object w_docking_container
    exporting
    ratio = 60
    exceptions
    cntl_error = 1
    cntl_system_error = 2
    create_error = 3
    lifetime_error = 4
    lifetime_dynpro_dynpro_link = 5
    others = 6.
    create object w_alv_grid
    exporting
    i_parent = w_docking_container.
    Field that identify color line in internal table
    move 'COLOR_LINE' to is_layout-info_fname.
    Field that identify cell color in inetrnal table
    move 'COLOR_CELL' to is_layout-ctab_fname.
    call method w_alv_grid->set_table_for_first_display
    exporting
    is_layout = is_layout
    changing
    it_outtab = it_mara
    it_fieldcatalog = it_fieldcat
    exceptions
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    others = 4.
    endform.
    *& Form get_data
    form get_data.
    select * from mara up to 5 rows.
    clear : wa_mara-color_line, wa_mara-color_cell.
    move-corresponding mara to wa_mara.
    add 1 to wa_mara-counter.
    move 'Blabla' to wa_mara-free_text.
    if wa_mara-counter = '0002'
    and p_line = 'X'.
    Color line move 'C410' to wa_mara-color_line.
    elseif wa_mara-counter = '0004'
    and p_cell = 'X'.
    Color cell
    move 'FREE_TEXT' to wa_color-fname.
    move '6' to wa_color-color-col.
    move '1' to wa_color-color-int.
    move '1' to wa_color-color-inv.
    append wa_color to it_color.
    wa_mara-color_cell[] = it_color[].
    endif.
    append wa_mara to it_mara.
    endselect.
    endform.
    *& Form fill_catalog
    form fill_catalog.
    Colour code : *
    Colour is a 4-char field where : *
    - 1st char = C (color property) *
    - 2nd char = color code (from 0 to 7) *
    0 = background color *
    1 = blue *
    2 = gray *
    3 = yellow *
    4 = blue/gray *
    5 = green *
    6 = red *
    7 = orange *
    - 3rd char = intensified (0=off, 1=on) *
    - 4th char = inverse display (0=off, 1=on) *
    Colour overwriting priority : *
    1. Line *
    2. Cell *
    3. Column *
    data : w_position type i value '1'.
    clear wa_fieldcat.
    move w_position to wa_fieldcat-col_pos.
    move 'MATNR' to wa_fieldcat-fieldname.
    move 'MARA' to wa_fieldcat-ref_table.
    move 'MATNR' to wa_fieldcat-ref_field.
    append wa_fieldcat to it_fieldcat.
    add 1 to w_position.
    clear wa_fieldcat.
    move w_position to wa_fieldcat-col_pos.
    move 'MATKL' to wa_fieldcat-fieldname.
    move 'MARA' to wa_fieldcat-ref_table.
    move 'MATKL' to wa_fieldcat-ref_field.
    Color column
    if p_column = 'X'.
    move 'C610' to wa_fieldcat-emphasize.
    endif.
    append wa_fieldcat to it_fieldcat.
    add 1 to w_position.
    clear wa_fieldcat.
    move w_position to wa_fieldcat-col_pos.
    move 'COUNTER' to wa_fieldcat-fieldname.
    move 'N' to wa_fieldcat-inttype.
    move '4' to wa_fieldcat-intlen.
    move 'Counter' to wa_fieldcat-coltext.
    append wa_fieldcat to it_fieldcat.
    add 1 to w_position.
    clear wa_fieldcat.
    move w_position to wa_fieldcat-col_pos.
    move 'FREE_TEXT' to wa_fieldcat-fieldname.
    move 'C' to wa_fieldcat-inttype.
    move '20' to wa_fieldcat-intlen.
    move 'Text' to wa_fieldcat-coltext.
    append wa_fieldcat to it_fieldcat.
    endform.
    Check this link to get code for different colors http://www.sapdesignguild.org/resources/ma_guidelines/VisualDesignRules/colors.html
    Try this out the same thing will work for Reuse also.
    Thanks & Regards,
    Judith.
    Message was edited by: Judith Jessie Selvi

Maybe you are looking for

  • Got ErrorWhile Generating the PDF in BI

    Dear All, We have a Apex integrated with BI Publisher 10.1.3.4 . While running the PDF Report more than 200 pages it is throwing the following Error. [050610_011309664][][STATEMENT] Total time used: 4768ms for processing XSL-FO [050610_011309665][ora

  • Error message in user Exit

    Hi friends, Iam working on sone userexit in tcode Ko01 . actually  i have to through the error message ...break point comes to that point it is not throughting that message...the message format i have used is MESSAGE msgtypemsgnumber(messageid)   WIT

  • Set type problem in sales order integrated into loyalty management

    Hi experts, I try to implement the sales order integrated into loyalty management. As notes said, I should use the set type REWARD_PRO_LOY to assign to a hierarchy for loyalty. But when I use this set type in hierarchy, I found I can only assign it w

  • Save for Web crashes - CS2

    Hi there! I dont know why, I changed nothing on my system, recently I can't save for Web anymore. At the point I click the menue-button, the program shuts down, no chance to save anything. I installed it completely new (the whole CS2 suite!) and didn

  • Audigy 2, Windows XP, Wave volume always resetting to ze

    Hi there, I have original Audigy 2 with WinXP. I just built a new box and installed WinXP fresh and the Audigy 2 drivers. Everytime I reboot, it resets the Wave volume and only the Wave volume to zero! Every time! It's driving me nuts, and I don't kn