Dark Blue color for a column in ALV

Hii all,
How can we make one of the columns in ALV to display in dark blue color?
Please suggest
Thanks

Hi Shakri,
I hope your know how to color a column in ALV, so here i am giving the color codes which we can use.
<i>1
or COL_HEADING
Headers (grayish blue)
2
or COL_NORMAL
List body (bright gray)
3
or COL_TOTAL
Totals (yellow)
4
or COL_KEY
Key columns (bluish green)
5
or COL_POSITIVE
Positive threshold value (green)
6
or COL_NEGATIVE
Negative threshold value (red)
7
or COL_GROUP
Control levels (violet)</i>
Regards,
Raghav

Similar Messages

  • 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!

  • DropDown By Index for a Column in ALV

    Hi,
    I am trying to create a dropdown for a column in ALV. I have used the following code for the same.
    data:
              lr_drdn_by_index type ref to cl_salv_wd_uie_dropdown_by_idx.
            create object lr_drdn_by_index
              exporting
                selected_key_fieldname = ls_column-id.
            lr_drdn_by_index->set_valueset_fieldname( 'VALUESET' ).
            lr_drdn_by_index->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
            ls_column-r_column->set_cell_editor( lr_drdn_by_index ).
    "VALUESET" Contains the Dropdown Data.
    Is there any settings that I have to do which is missing?
    Regards,
    Shruthi

    Hi,
    follow these steps :
    1) create a node for example (NODE_LIST)
    2) crrate an attribute (LIST: type WDY_UIE_LIBRARY_ENUM_TYPE)
    3) in your WDDOINIT method, populate your list :
    lr_node = wd_context->get_child_node('NODE_LIST').
    lr_node_info = lr_node->get_node_info( ).
    ls_value_set-key = 10.
    ls_value_set-value = 'tes'.
    INSERT ls_value_set INTO TABLE lt_value_set.
    ls_value_set-key = 20.
    ls_value_set-value = 'tes'.
    INSERT ls_value_set INTO TABLE lt_value_set.
    lr_node_info->set_attribute_value_set(
    name = 'LIST'
    value_set = lt_value_set ).
    4) in your table settings :
    data :
    list_field    TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
    CREATE OBJECT list_field
          EXPORTING selected_key_fieldname  = ls_columns-id.
    ls_columns-r_column->set_cell_editor( list_field ).
    I hoep this helps, if not please clarify your question.
    Regards

  • Blue color for selected text

    Hello, is any way to change blue color for selected text which is the same as for invisible characters? When I select text all unvisible characters are realy unvisible... In old ID selected text was black and invisible characters inside was orange. Many thx for help... Ilja

    For sure I tried to use "select text" in Illustrator CC on the same system (windows 7) and selected text is black too...
    Many thx for help
    Ilja
    PS
    I must agree with the post about very slowly ID CC. I tried the same indd files in CS6 and CC and CC is slowly in large documents (500 pages and more), for ex. find/replace, but when document is near its end (aprox 80-100 pages) ID CC is much faster than at the start of document. Now I am working on large doc (540 pages) with many headers (aprox 3-4 on each page) and when I want change space for non-breaking space on pages between 1-100, this takes sometimes more than 2 seconds!!! Only simple space change - no styl change etc.
    I think that I am using fast PC (Intel i7, 16GB RAM, SSD disks - cache is on separated mSATA 30GB SSD), all doc are located inside PC, no external drives for normal day work) and I never seen these lags on CS6. Doesn't matter if I using ID CC 32 od 64 bit - it is aprox the same.

  • How to put colours for a column in ALV

    Dear All,
    I need to put green colour for 1 column in an ALV report.
    Can anybody tell me how we can do that ...
    Thanking you in advance,
    Shankar

    Here's a little sample program.....  this illistrates coloring at the column, row, and cell level.
    report zrich_0002 .
    * 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.
    Regards,
    Rich HEilman

  • Color  for a Field in alv output

    Hi All,
    I use a field in the ALV grid output which needs to display color (red or green) depending on certain validations. Please tell me how to display color for this field. The program uses oops.
    Thanks.

    Hi
    1. add one more field to ur final internal table say COLOR(4)
    2. in layout wa_layout-style_fname = 'COLOR'. " if its grid
    wa_layout-style_fieldname = 'COLOR'. "if its list
    3. read table itab index 3.
    itab-color = 'C410'.
    modify itab index 3
    4. see program SHOWCOLO for all color codes
    1. Add a field of data type CHAR(3) to the internal output table.
    2. Enter the color code in the appropriate field of the row to be colored in the internal
    output table:
    Code: 'Cxy'
    C = Color (all codes begin with 'C')
    x = color number ('1' - '9')
    y = highlight ('0' = off, '1' = on)
    3. Assign the internal output table color code field name to the IS_LAYOUT importing
    structure IS_LAYOUT-INFO_FIELDNAME field and pass this structure in the ALV call
    interface.
    To enable row coloring, 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. So, let’s modify declaration of our list data table “gt_list”.
    you should fill the color code to this field. Its format will be the same as explained before at section C.6.3. 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 “INFO_FNAME” of the layout structure.
    e.g.
    ps_layout-info_fname = <field_name_containing_color_codes>. “e.g. ‘ROWCOLOR’
    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.
    You can color an entire row as described in the next section. However, this method is less time consuming.
    Coloring Individual Cells
    This is the last point about coloring procedures for the ALV Grid. The procedure is similar to coloring an entire row. However, since an individual cell can be addressed with two parameters we will need something more. What is meant by “more” is a table type structure to be included into the structure of the list data table. It seems strange, because including it will make our list data structure deep. But anyhow ALV Grid control handles this.
    The structure that should be included must be of type “LVC_T_SCOL”. If you want to color the entire row, this inner table should contain only one row with field “fname” is set to space, some color value at field “col”, “0” or “1” at fields “int” (intensified) and “inv” (inverse).
    If you want to color individual cells, then for each cell column, append a line to this inner table which also contains the column name at field “fname”. It is obvious that you can color an entire column by filling this inner table with a row for that column for each row in the list data table.
    Reward points if useful
    Regards
    Anji

  • To make different colours for the columns of ALV report in Grid display.

    Hai Friends,
                       I have created an ALV report in grid display method by using the call function reuse_alv_grid_display.
    I have obtained the report.In that report i want to change the colour of each column.Plz provide the answer with a sample program.
                    Thank u.

    hi i had a program  for the rows with diff colors....do the same thing for the columns..
    REPORT  zdemo_alvgrid                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      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,
      line_color(4) type c,     "Used to store row color attributes
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog 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.
    *Start-of-selection.
    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-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    Set layout field for row attributes(i.e. color)
      gd_layout-info_fieldname =      'LINE_COLOR'.
    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
                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.
    data: ld_color(1) type c.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into table it_ekko.
    *Populate field with color attributes
    loop at it_ekko into wa_ekko.
      ld_color = ld_color + 1.
    Only 7 colours so need to reset color value
      if ld_color = 8.
        ld_color = 1.
      endif.
      concatenate 'C' ld_color '10' into wa_ekko-line_color.
    wa_ekko-line_color = 'C410'.
      modify it_ekko from wa_ekko.
    endloop.
    endform.                    " DATA_RETRIEVAL
    regards,
    venkat

  • How to set color to a column in ALV?

    Based on standard example BCALV_GRID_01 to modify,
    how to set color to a column???
    Moderator message: please search for available information/documentation before asking.
    Edited by: Thomas Zloch on Nov 6, 2010 9:43 AM

    Hi Sai ,
    you are posting the querry in the wrong forum ..
    but still I will answer ur querry...
    Incase you are not using the standard class to make your ALV then u can set the color of each column in the propertiesof column in the design time .
    Incase u see the colors in the design time but is not able to see the colors at the run time then you check the settings of the table I dont have system right now else I could have told you exact property...
    else if u r amking alv from the standard class then u will have to search the net for the method to color the same ..
    Thanks
    Sahil.

  • Average sum for a column in ALV tree layout

    Hi,
    I've trying to set an average sum for a column in an ALV tree report.  In the field catalog i set the DO_SUM field to 'X' and this will do a total sum, but I can't find out how in the code to do the average sum.
    Also to get round this I was going to just set a default display variant with the "average" sum option saved after i had manually selected the columns and set it to this.  Problem with this is that when i re-run it, the sum comes back as a total rather than an average.  I have tried setting display variants on the SAP example ALV tree programs and the same thing happens.
    Does anyone know how i can get round this?
    Cheers
    Matt.

    Hi,
    In addition to setting DO_SUM = 'X' you need to specify function in H_FTYPE field. It should be set to 'AVG' in your case.
    ls_fielcat-do_sum = 'X'.
    ls_fieldcat-h_ftype = 'AVG.

  • Mulitple Line column headers for a column in ALV using Web Dynpro for ABAP

    Hi WD4A Gurus,
           I have requirement to display the header name in multiple lines for a single column using ALV. How to achieve this, do I need to do some custom code? Please help me with sample code.
    Example:
    existing column name :
                Name   |  Date (mm/dd/yyyy) | Amount
    required column name:
                Name   |    Date               | Amount
    (mm/dd/yyyy)
    Thanks
    Ketan

    Displaying header in multiple lines is not possible in alv
    Regards
    Tamil

  • How to hide headers for specified columns in ALV?

    Hallo guyes,
    is it possible to hide headers just for a few columns in ALV?
    Something like no_headers but just for defined columns...
    Is it also possible to define column description in two lines?
    Thanks.

    Hi,
    Check the below code
    codeFORM prep_fieldcat_xls USING lt_fieldcat_xls TYPE slis_t_fieldcat_alv.
    RANGES: lra_fieldname FOR field_ran.
    DATA: lwa_fieldcat_xls TYPE slis_fieldcat_alv.
    Build range for all unwanted columns:
    lra_fieldname-option = 'EQ'.
    lra_fieldname-sign = 'I'.
    lra_fieldname-low = 'EEP'.
    APPEND lra_fieldname.
    Remove the unwanted columns from the fieldcatalog:
    lt_fieldcat_xls] = lt_fieldcat[.
    LOOP AT lt_fieldcat_xls INTO lwa_fieldcat_xls
    if lwa_fieldcat_xls-fieldname = lra_fieldname-low. "Change here as it is
    lwa_fieldcat_xls-no_out = 'X'.
    endf.
    MODIFY lt_fieldcat_xls FROM lwa_fieldcat_xls INDEX sy-tabix.
    ENDLOOP.[/code]
    Regards,
    Raj.

  • Deactivate Tooltips for every column in ALV

    Hi Everybody,
    how can i deactivate the tooltip for every column in a ALV.
    regards,
    Sid

    The logic to set the tooltip goes something like this:
    data l_table type ref to cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
      data l_column type ref to cl_salv_wd_column.
    data l_header type ref to cl_salv_wd_column_header.
      l_column = l_table->if_salv_wd_column_settings~get_column( 'CREATED_BY' ).
      l_header = l_column->get_header( ).
      l_header->set_prop_ddic_binding_field(
        property =  if_salv_wd_c_ddic_binding=>bind_prop_tooltip
        value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
      l_header->set_tooltip( ` ` ).
    However this logic just sets it for one column at a time.  If you want to do all of them then you would need to loop through a listing of the columns and repeat this logic for each one. Instead of using if_salv_wd_column_settingsget_column, you could use the method if_salv_wd_column_settingsget_columns to return an internal table of object instances for each column object defined in the ALV.

  • Single heading for Multiple columns in ALV

    Hi Experts,
          I need to display a common column heading for multiple columns in my ALV Grid Display output. I am giving the sample output here.
    MATNR...WERKS..| Unrestricted Stock|....|Stock in transfer        |....|Stock in Quality|.
    ............................| CAT | SAP  | Differe| .. |  CAT   |  SAP  | Diff   | .. | CAT   |  SAP  | Diff  |
    As I shown above, for 3 columns CAT, SAP, and for Difference, I need to get "Unrestricted Stock" as column heading... and so on...
    Pl. suggest me on this.
    Thanks in Advance
    Ramakrishna

    Hello Ramki,
    NOT POSSIBLE IN ALV AT ALL :-((
    You have to use classical report using WRITE stmts for this.
    If your client does not want to lose ALV functionalities, then you can try something like.
    Unrestricted Stock-SAP | Unrestricted Stock-CRM | Unrestricted Stock-Diff. Stock ... and so on !!!
    BR,
    Suhas
    Edited by: Suhas Saha on Jan 21, 2009 3:00 PM

  • Color for negative Values in ALV Report

    I want to change the color for negative values displayed in ALV list diplay report. Eg. -5 in Quantity should be changed to orange. Kindly help me
    Thanks

    Check the below program and bold one are important ( which is similar to MD05 Traffic lights )
    REPORT ZWM_BIN_STOCK_REQ no standard page heading
                        message-id zwave.
    D A T A   D E C L A R A T I O N ****************************
    Tables
    tables :zpwvbap,
             mara,
             marc,
             makt,
             vbap,
             zshift,
             marm,
             lqua.
    TYPE-POOLS: SLIS.
    Internal Table for Sales order
    data : begin of i_vbap occurs 0,
           matnr like zpwvbap-matnr," Material #
           ZZCUTOFF like zpwvbak-ZZCUTOFF," Cutoff Time
           vlpla like zpwvbap-vlpla,
           kwmeng like zpwvbap-kwmeng," Quantity
           vrkme  like zpwvbap-vrkme, " Sales Unit
           meins like zpwvbap-meins, " Unit of measure
           end of i_vbap.
    Internal Table for final Processing
    data : begin of i_final occurs 0,
           date(8) type c,
           matnr like zpwvbap-matnr," Material #
           zzshift like zshift-zzshift, " Wave Drop
           maktx like makt-maktx," Desc
           lgpla like lagp-lgpla, " Pick Bin
           pverme like lqua-verme," Stock at Pick Bin
           prverme like lqua-verme," Stock at Prod Bin
           kwmeng like zpwvbap-kwmeng," Requiremnet from Wave Drop
           vrkme  like zpwvbap-vrkme, " Sales Unit
          meins like zpwvbap-meins," Unit of measure
           end of i_final.
    Internal Table for Output
    data : begin of i_output occurs 0,
         <b>  field type c, " Traffic Lights</b>     
          zzshift like zshift-zzshift, " Wave Drop
           matnr like zpwvbap-matnr," Material #
           maktx like makt-maktx," Desc
           lgpla like lagp-lgpla, " Pick Bin
           pverme like lqua-verme," Stock at Pick Bin
           prverme like lqua-verme," Stock at Prod Bin
           kwmeng like zpwvbap-kwmeng," Requiremnet from Wave Drop
           vrkme like zpwvbap-vrkme," Sales Unit
          meins like zpwvbap-meins," Unit of measure
           diff like zpwvbap-kwmeng, " Diffrence
           end of i_output.
    Work Area for Final Internal Table
    data wa_final like i_final.
    data :  w_zzcutoff(12) TYPE c,
            v_date type sy-datum,
            v_time(4) type c,
            v_fldate(12) type c,
            v_fhdate(12) type c,
            v_pverme like lqua-verme,
            v_prverme like lqua-verme,
            v_diff like zpwvbap-kwmeng.
    Variables for new check box
    data : v_nverme like lqua-verme.
    Internal Table for Pick Bin
    data : begin of i_verme occurs 0,
           verme like lqua-verme,
           end of i_verme.
    Internal table for Prod Bin
    data : begin of i_pverme occurs 0,
           verme like lqua-verme,
           end of i_pverme.
    Variables for ALV
    DATA: FIELDCAT           TYPE SLIS_T_FIELDCAT_ALV,
          FIELDCAT_LN        LIKE LINE OF FIELDCAT,
          SORTCAT            TYPE SLIS_T_SORTINFO_ALV,
          SORTCAT_LN         LIKE LINE OF SORTCAT,
          EVENTCAT           TYPE SLIS_T_EVENT,
          EVENTCAT_LN        LIKE LINE OF EVENTCAT,
          LAYOUT             TYPE SLIS_LAYOUT_ALV,
          C_TOP_OF_PAGE      TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
          g_user_command TYPE slis_formname VALUE 'USER_COMMAND',
          GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
    DATA: COL_POS TYPE I,
          P_LIGNAM TYPE SLIS_FIELDNAME VALUE  'FIELD'.
    DATA : V_REPID LIKE SY-REPID,
           flag type c.
    S E L E C T I O N - S C R E E N *************************
    selection-screen : begin of block blk with frame title text-001.
    parameter : p_plant like marc-werks obligatory default '1000'.
    select-options : s_date for sy-datum obligatory ,
                     s_shift for zshift-zzshift,
                     s_matnr for mara-matnr,
                     s_dept for zpwvbap-zzdept,
                     s_pdept for marc-ZZPRODDEPT.
    selection-screen: end of block blk.
    parameters : p_check as checkbox ."default 'X'.
    ranges r_cutoff for  w_zzcutoff.
    I N I T I A L I Z A T I O N ****************************
    initialization.
      V_REPID = SY-REPID.
      s_date-low = sy-datum + 1.
      append s_date.
    S T A R T - O F - S E L E C T I O N  ***********************
    start-of-selection.
    Get the Shift Data.
      PERFORM GET_SHIFT_DETAILS.
    Get the data from ZPWVBAP Table
      PERFORM GET_DATA_VBAP.
    E N D - O F - S E L E C T I O N **********************
    end-of-selection.
      if not i_output[] is initial.
        sort i_output by field zzshift matnr.
    Reset the all Fiedcatlog.
        PERFORM RESETVALUES.
    Traffic Lights
        PERFORM BUILD_LAYOUT.
    Fill the fieldcatlog values
        PERFORM FILL_FIELDCATLOG.
    Call the List Function module
        PERFORM CALL_lIST.
      endif.
    *&      Form  GET_SHIFT_DETAILS
          Get the Cutoff Time.
    FORM GET_SHIFT_DETAILS.
      clear : v_fldate,
              v_fhdate.
      if not s_shift-low is initial.
        clear: v_time,
               v_date.
        if s_shift-low = '1'.
          v_time = '2000'.
        elseif s_shift-low = '2'.
          v_time = '2300'.
        endif.
        v_date = s_date-low - 1.
        concatenate v_date v_time into v_fldate.
      endif.
      if not s_shift-high is initial.
        clear : v_date,
                v_time.
        if s_shift-high = '1'.
          v_time = '2000'.
        elseif s_shift-high = '2'.
          v_time = '2300'.
        endif.
        if not s_date-high is initial.
          v_date = s_date-high - 1.
        else.
          v_date = s_date-low - 1.
        endif.
        concatenate v_date v_time into v_fhdate.
      endif.
      if not v_fhdate is initial.
        r_cutoff-low = v_fldate.
        r_cutoff-high = v_fhdate.
        r_cutoff-sign = 'I'.
        r_cutoff-option = 'BT'.
        append r_cutoff.
      endif.
    ENDFORM.                    " GET_SHIFT_DETAILS
    *&      Form  GET_DATA_VBAP
          Get the data from ZPWVBAP Table
    FORM GET_DATA_VBAP.
    Get the data from ZPWVBAP and ZPWVBAK Table
      if not v_fhdate is initial.
        select matnr ZZCUTOFF  vlpla sum( kwmeng ) vrkme meins
                     into table i_vbap
                     from zpwvbap as a inner join zpwvbak as b on
                                   a~vbeln = b~vbeln
                                   where a~werks = p_plant
                                   and   a~matnr in s_matnr
                                   and b~vdatu in s_date
                                   and a~zzdept in s_dept
                                   and b~zzcutoff in r_cutoff
                                  group by matnr zzcutoff vlpla vrkme meins.
      elseif not v_fldate is initial.
        select matnr ZZCUTOFF vlpla sum( kwmeng ) vrkme meins
                           into table i_vbap
                           from zpwvbap as a inner join zpwvbak as b on
                                   a~vbeln = b~vbeln
                                   where a~werks = p_plant
                                   and   a~matnr in s_matnr
                                   and b~vdatu in s_date
                                   and a~zzdept in s_dept
                                   and b~zzcutoff = v_fldate
                               group by matnr zzcutoff vlpla vrkme meins.
      else.
        select matnr ZZCUTOFF vlpla sum( kwmeng ) vrkme meins
                              into table i_vbap
           from zpwvbap as a inner join zpwvbak as b on
                                   a~vbeln = b~vbeln
                                   where a~werks = p_plant
                                   and   a~matnr in s_matnr
                                   and b~vdatu in s_date
                                   and a~zzdept in s_dept
                                   and b~zzcutoff in r_cutoff
                                group by matnr zzcutoff vlpla vrkme meins .
      endif.
      if sy-subrc ne 0.
        message i000(zwave) with 'No data found for given selection'.
        stop.
      endif.
      sort i_vbap by zzcutoff matnr.
      loop at i_vbap.
        clear : v_pverme,
                v_prverme.
    Compare the data with pick method
        select single zzpick from marc into marc-zzpick
                             where matnr = i_vbap-matnr
                             and   werks = p_plant
                             and   zzpick = '01'.
        if sy-subrc ne 0.
          continue.
        endif.
    Compare the data from MARC Table with Production Department
        select single zzPRODdept from marc into marc-zzPRODdept
                             where matnr = i_vbap-matnr
                             and werks = p_plant
                             and  zzPRODdept in s_pdept.
        if sy-subrc ne 0.
          continue.
        endif.
    Get the Material Description from MAKT Table
        Select single maktx from makt into makt-maktx
                            where matnr = i_vbap-matnr
                            and   spras = 'E'.
        if sy-subrc eq 0.
          i_final-maktx = makt-maktx.
        endif.
    Get the Pick Bin
        i_final-lgpla = i_vbap-vlpla.
        refresh i_verme.
        clear i_verme.
    Get the stock at Pick bin
        select verme  from lqua into table i_verme
                            where lgpla = i_vbap-vlpla
                            and   matnr = i_vbap-matnr
                            and   LGNUM = '100'.
        if sy-subrc eq 0.
          loop at i_verme.
            v_pverme = v_pverme + i_verme-verme.
          endloop.
          if sy-subrc eq 0.
            i_final-pverme = v_pverme.
          endif.
        endif.
        refresh i_pverme.
        clear i_pverme.
    Get the stock at Production bin
        select  verme from lqua into table i_pverme
                           where matnr = i_vbap-matnr
                           and   LGNUM = '100'
                       and ( lgpla = '9595959595' or
                             lgpla = '2222222222' or
                             lgpla = '5555555555' or
                             lgpla = '3232323232' or
                             lgpla = '8080808080' or
                             lgpla = '4040404040' or
                             lgpla = '9090909090' ).
        if sy-subrc eq 0.
          loop at i_pverme.
            v_prverme = v_prverme + i_pverme-verme.
          endloop.
          if sy-subrc eq 0.
            i_final-prverme = v_prverme.
          endif.
        endif.
    Compare the unit of measure and sales unit
        if i_vbap-vrkme ne i_vbap-meins.
    Get the data from MARM Table ( Unit of measure )
          select single * from marm into marm
                               where matnr = i_vbap-matnr
                               and   meinh = i_vbap-vrkme.
          if sy-subrc eq 0.
            i_final-pverme = ( i_final-pverme * marm-umren ) / marm-umrez.
          endif.
        endif.
    Material #
        i_final-matnr = i_vbap-matnr.
    Quantity from ZPWVBAP
        i_final-kwmeng = i_vbap-kwmeng.
    Unit of Measure
       i_final-meins = i_vbap-meins.
    Sales Unit
        i_final-vrkme = i_vbap-vrkme.
    Wave Drop
        if i_vbap-ZZCUTOFF+8(4) = '2000' .
          i_final-zzshift = '1'.
        endif.
        if i_vbap-zzcutoff+8(4) = '2300'.
          i_final-zzshift = '2'.
        endif.
        i_final-date = i_vbap-zzcutoff+0(8).
        append i_final.
        clear : i_final,
                i_vbap.
    **Difference
       i_output-diff = i_output-pverme - i_vbap-kwmeng.
    Traffic Lights Depends on value
       if i_output-pverme > i_output-kwmeng.
         i_output-field = '3'.
       elseif i_output-pverme < i_output-kwmeng.
         i_output-field = '1'.
       elseif i_output-pverme = i_output-kwmeng.
         i_output-field = '2'.
       endif.
       append i_output.
       clear : i_output,
               i_vbap.
      endloop.
      refresh i_vbap.
      sort i_final by date matnr zzshift.
    Processing the internal table to get same material with pick quantity
    deduction even it for 2nd shift
      loop at i_final.
    Move the data into work area in order remove #
        move i_final to wa_final.
        clear : flag.
        at new matnr.
          move : wa_final-matnr to i_output-matnr," Material #
                 wa_final-maktx to i_output-maktx," Desc
                 wa_final-lgpla to i_output-lgpla," Pick Bin
                 wa_final-kwmeng to i_output-kwmeng," Order qty
                 wa_final-zzshift to i_output-zzshift," Shift
                 wa_final-pverme to i_output-pverme, " Pick bin qty
                 wa_final-vrkme  to i_output-vrkme," Sales Unit
                 wa_final-prverme to i_output-prverme. " Prod Bin Qty
    Difference
          i_output-diff = i_output-pverme - i_output-kwmeng.
    New logic for Only HMR Department
        <b>  if p_check = 'X'.
            if i_output-pverme < i_output-kwmeng.
              v_nverme = i_output-pverme + i_output-prverme.
              if v_nverme > i_output-kwmeng.
               if i_output-pverme < i_output-kwmeng.
               i_output-field = '2'.
                else.
    Traffic Lights Depends on value
                i_output-field = '3'.
                endif.
              elseif v_nverme < i_output-kwmeng.
                i_output-field = '1'.
              elseif v_nverme = i_output-kwmeng.
                i_output-field = '2'.
              endif.
            elseif i_output-pverme > i_output-kwmeng.
              i_output-field = '3'.
            elseif i_output-pverme = i_output-kwmeng.
              i_output-field = '3'.
            endif.
          else.
    Traffic Lights Depends on value
            if i_output-pverme > i_output-kwmeng.
              i_output-field = '3'.
            elseif i_output-pverme < i_output-kwmeng.
              i_output-field = '1'.
            elseif i_output-pverme = i_output-kwmeng.
              i_output-field = '2'.
            endif.
          endif.
          move i_output-diff to v_diff.
          flag = 'X'.
        endat.</b>
        if flag ne 'X'.
          move : wa_final-matnr to i_output-matnr," Material #
                 wa_final-maktx to i_output-maktx," Desc
                 wa_final-lgpla to i_output-lgpla," Pick Bin
                 wa_final-kwmeng to i_output-kwmeng," Order qty
                 wa_final-zzshift to i_output-zzshift," Shift
                 wa_final-vrkme  to i_output-vrkme," Sales Unit
                 wa_final-prverme to i_output-prverme. " Prod Bin Qty
      Move Diffrence value
          move v_diff to i_output-pverme.
          clear: v_diff.
    New logic for Only HMR Department
    New logic for Only HMR Department
          if p_check = 'X'.
            if i_output-pverme < i_output-kwmeng.
              v_nverme = i_output-pverme + i_output-prverme.
              if v_nverme > i_output-kwmeng.
              if i_output-pverme < i_output-kwmeng.
               i_output-field = '2'.
                else.
    Traffic Lights Depends on value
                i_output-field = '3'.
                endif.
    Traffic Lights Depends on value
               i_output-field = '3'.
              elseif v_nverme < i_output-kwmeng.
                i_output-field = '1'.
              elseif v_nverme = i_output-kwmeng.
                i_output-field = '2'.
              endif.
            elseif i_output-pverme > i_output-kwmeng.
              i_output-field = '3'.
            elseif i_output-pverme = i_output-kwmeng.
              i_output-field = '3'.
            endif.
    i_output-diff = i_output-pverme - i_output-kwmeng.
          else.
    Difference
            i_output-diff = i_output-pverme - i_output-kwmeng.
    Traffic Lights Depends on value
            if i_output-pverme > i_output-kwmeng.
              i_output-field = '3'.
            elseif i_output-pverme < i_output-kwmeng.
              i_output-field = '1'.
            elseif i_output-pverme = i_output-kwmeng.
              i_output-field = '2'.
            endif.
          endif.
        endif.
        append i_output.
        clear : i_output,
                wa_final,
                i_final,
                 v_nverme.
      endloop.
      sort i_output by field zzshift matnr.
    ENDFORM.                    " GET_DATA_VBAP
    *&      Form  RESETVALUES
          Reset the all fieldcatlogs
    FORM RESETVALUES.
      FIELDCAT_LN-KEY = SPACE.
      FIELDCAT_LN-DO_SUM = SPACE.
      FIELDCAT_LN-NO_OUT = SPACE.
      FIELDCAT_LN-QFIELDNAME = SPACE.
      FIELDCAT_LN-HOTSPOT = SPACE.
      FIELDCAT_LN-OUTPUTLEN = '0'.
      CLEAR: fieldcat_ln-seltext_l, fieldcat_ln-seltext_m,
             fieldcat_ln-seltext_s, fieldcat_ln-reptext_ddic.
    ENDFORM.                    " RESETVALUES
    *&      Form  FILL_FIELDCATLOG
          Fill the Fieldcatlog values
    FORM FILL_FIELDCATLOG.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
    Trafiic Light
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'FIELD'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 7.
      LS_FIELDCAT-col_pos    = '1'.
      ls_fieldcat-seltext_L = 'Lights'.
      ls_fieldcat-seltext_s = 'Lights'.
      ls_fieldcat-seltext_m = 'Lights'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Wave Drop
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'ZZSHIFT'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 9.
      LS_FIELDCAT-col_pos    = '2'.
      ls_fieldcat-seltext_L = 'Wave Drop'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Material
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'MATNR'.
      LS_FIELDCAT-ref_fieldname = 'MATNR'.
      LS_FIELDCAT-ref_tabname = 'MARA'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 18.
      LS_FIELDCAT-col_pos    = '3'.
      ls_fieldcat-seltext_L = 'Material'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Description
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'MAKTX'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 40.
      LS_FIELDCAT-col_pos    = '4'.
      ls_fieldcat-seltext_L = 'Description'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Pick Bin
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'LGPLA'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 15.
      LS_FIELDCAT-col_pos    = '5'.
      ls_fieldcat-seltext_L = 'Pick Bin'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Trafiic Light
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'PVERME'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 16.
      LS_FIELDCAT-col_pos    = '6'.
      ls_fieldcat-seltext_L = 'Stock at Pick Bin'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Stock at Prod Bin
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'PRVERME'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 16.
      LS_FIELDCAT-col_pos    = '7'.
      ls_fieldcat-seltext_L = 'Stock at Prod Bin'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Req from wave drop
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'KWMENG'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 23.
      LS_FIELDCAT-col_pos    = '8'.
      ls_fieldcat-seltext_L = 'Requirement from Wave Drop'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Sales Unit
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'VRKME'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 12.
      LS_FIELDCAT-col_pos    = '9'.
      ls_fieldcat-seltext_L = 'Sales Unit'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Unit of Measure
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'MEINS'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 9.
      LS_FIELDCAT-col_pos    = '10'.
      ls_fieldcat-seltext_L = 'UNIT'.
      ls_fieldcat-no_out = 'X'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Diffference
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'DIFF'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 12.
      LS_FIELDCAT-col_pos    = '11'.
      ls_fieldcat-seltext_L = 'Difference'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    ENDFORM.                    " FILL_FIELDCATLOG
    *&      Form  CALL_lIST
          Use ALV Function module to display output
    FORM CALL_lIST.
    Top - of - Page
      PERFORM COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                =
      I_BUFFER_ACTIVE                   = ' '
          I_CALLBACK_PROGRAM                = V_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
        I_CALLBACK_USER_COMMAND           = g_user_command
          I_CALLBACK_TOP_OF_PAGE            = C_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                         = LAYOUT
          IT_FIELDCAT                       = FIELDCAT
      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_ADD_FIELDCAT                   =
      IT_HYPERLINK                      =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
      IT_EXCEPT_QINFO                   =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = I_OUTPUT
       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.                    " CALL_lIST
    *&      Form  BUILD_LAYOUT
          text
    FORM BUILD_LAYOUT.
      LAYOUT-GET_SELINFOS = 'X'.
    Now we want a traffic light to say if the Truck is deleted
    the variable p_lignam contains the name in IREPO which stores the
    value for the traffic light
      LAYOUT-LIGHTS_FIELDNAME = P_LIGNAM.
      layout-HEADER_TEXT = 'Lights'.
      LAYOUT-LIGHTS_CONDENSE =  'X'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  COMMENT_BUILD
          text
         -->P_GT_LIST_TOP_OF_PAGE[]  text
    FORM COMMENT_BUILD USING    LT_TOP_OF_PAGE TYPE
                                            SLIS_T_LISTHEADER.
      data : v_day(2) type c,
             v_mon(2) type c,
             v_year(4) type c,
             v_ldate(10) type c,
             v_hdate(10) type c.
      DATA: LS_LINE TYPE SLIS_LISTHEADER.
      data: d_date like sy-datum.
      clear : v_ldate,
              v_hdate.
    Header Information.
    LIST HEADING LINE: TYPE H
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'H'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      LS_LINE-INFO = 'Bin Replenishment report for HMR'.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    STATUS LINE: TYPE S
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = TEXT-003.
    LS_LINE-INFO = TEXT-003.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    STATUS LINE: TYPE S
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
    LS_LINE-KEY  = TEXT-003.
    LS_LINE-INFO = TEXT-003.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    Get the data ( s_date_low) into proper format.
      v_year = s_date-low+0(4).
      v_mon = s_date-low+4(2).
      v_day = s_date-low+6(2).
      concatenate v_mon '/' v_day '/' v_year into v_ldate.
      clear : v_mon,
              v_year,
              v_day.
    Get the data ( s_date_high) into proper format.
      v_year = s_date-high+0(4).
      v_mon  = s_date-high+4(2).
      v_day  = s_date-high+6(2).
      concatenate v_mon '/' v_day '/' v_year into v_hdate.
      clear : v_mon,
              v_year,
              v_day.
    Delivery date
      if not s_date-low is initial .
        if not s_date-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Delivery date From:'.
          LS_LINE-INFO = v_ldate.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Delivery date To :'.
          LS_LINE-INFO =  v_hdate.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
      if not s_date-low is initial.
        if  s_date-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Delivery date :'.
          LS_LINE-INFO = v_ldate.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
    Wave Drop
      if not S_SHIFT-LOW is initial.
        if not S_SHIFT-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Wave Drop From :'.
          LS_LINE-INFO = s_shift-low.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Wave Drop to :'.
          LS_LINE-INFO = s_shift-high.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
      if not S_SHIFT-LOW is initial.
        if S_SHIFT-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Wave Drop :'.
          LS_LINE-INFO = s_shift-low.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
         CLEAR LS_LINE.
         LS_LINE-TYP  = 'S'.
         LS_LINE-KEY  = 'Wave Drop to :'.
         LS_LINE-INFO = s_shift-high.
         APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
    Department
      if not s_dept-low is initial .
        if not s_dept-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Department From :'.
          LS_LINE-INFO = s_dept-low.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Department to :'.
          LS_LINE-INFO = s_dept-high.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
      if not s_dept-low is initial .
        if  s_dept-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Department :'.
          LS_LINE-INFO = s_dept-low.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
    Production Department
      if not S_PDEPT-LOW is initial.
        if not S_PDEPT-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Production Department From :'.
          LS_LINE-INFO = S_PDEPT-LOW.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Production Department to :'.
          LS_LINE-INFO = S_PDEPT-high.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
      if not S_PDEPT-LOW is initial.
        if  S_PDEPT-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Production Department :'.
          LS_LINE-INFO = S_PDEPT-LOW.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
    ENDFORM.                    " COMMENT_BUILD
          FORM TOP_OF_PAGE                                              *
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = GT_LIST_TOP_OF_PAGE
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
    ENDFORM.
          FORM USER_COMMAND                                             *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                rs_selfield TYPE slis_selfield.                 "#EC CALLED
      CASE R_UCOMM.
        WHEN '&IC1'.
          read table i_output index rs_selfield-tabindex.
          SET PARAMETER ID 'MAT' FIELD i_output-matnr.
          SET PARAMETER ID 'WRK' FIELD p_plant.
          if not i_output-matnr is initial.
            call transaction 'MD04' and skip first screen.
          endif.
      ENDCASE.
    ENDFORM.
    the above code i mentioned 1,2 ,3 values  ,1 will have green color,2 will have yellow color,3 will have red color.
    Thanks
    Seshu

  • Calculating Totals for a column in ALV Grid Display

    Hi All,
      I frustrated with the problem of simple calculating total for a column. I wrote the following code:
      LW_CATALOG-TABNAME   = P_GV_STRUCT.
      LW_CATALOG-FIELDNAME = 'ZSUMMS'.
      LW_CATALOG-DO_SUM    = GC_X.
      APPEND LW_CATALOG TO G_FIELDCAT_TAB.
      CLEAR LW_CATALOG.
    It is not working. Could you please suggest the solution?
    It would be great help to me.
    Advanced Thanks,
    Phani Kumar

    Phani,
    Did u try playing around with any of these layout fields ?
    no_sumchoice(1),       " no choice for summing up
    no_totalline(1),       " no total line
    no_subchoice(1),       " no choice for subtotals
    no_subtotals(1),       " no subtotals possible
    no_unit_splitting  " no sep. tot.lines by inh.units
    totals_before_items,   " diplay totals before the items
    totals_only(1),        " show only totals
    totals_text(60) ,      " text for 1st col. in total line
    subtotals_text(60) ,    " text for 1st col. in subtotals
    b. Addtionally... not a solution.. but u know...
    just try the same code iwth reuse_alv_list_display and see if the total gets displayed properly ?

Maybe you are looking for

  • FileInputStream.open deletes file

    We are currently seeing some very strange behavior from FileInputStream. Our sample app creates a FileInputStream, passes it into another function which copies the file to a temp directory and file. That temp file is then opened by a child process, w

  • App user

    Im trying to use app_user within a process but so far with no succsess, below is the code, any help appreciated. SELECT incident_tmp.report_id, incident_tmp.report_type, incident_tmp.report_no, actions_tmp.report_no, actions_tmp.due_date, actions_tmp

  • Echo cancellation in AIR for Android?

    We are developing a videoconference app with versions for android and web. In android we have a lot of problems with echo cancellation, as it is only supported for desktop apps in Air 2.7 and 3.0 We have tested different codecs (speex, nellymoser), a

  • If enter any primary key data if this already in database it shows all data

    I want to make form for e.g i have table "customers" with column nammes like "name,id,address,things_bought,orders" when user enters the data like name which already in the datbase it shows all the table data on the form ? how it possible? for e.g us

  • Function modules INIT and EXEC

    Hi , Can anybody provide me the purpose of two function modules INIT and EXEC? How it works? Thanks sg