How to put up the traffic lights icon in the ALV Grid. OO output

Hi all,
I have a requriement that after all the report execution parts are done, i need to display the posted or unposted document using the Traffic light icon in the report output, i am displaying the report in ALV OO form and i already geta  field with a conent X of the document is posted else that field is blank currently.
Regards

Sample code here for this.
*& Report  Z_50657_ALV_EX2                                             *
*& Program Name: Test Program for ALV                                  *
*  Developer Name: ADCDEV (Rahul Kavuri )                              *
*  Description: ALV Report to Display Vendor Details                   *
*& Date:7th April 2006                                                 *
REPORT  Z_50657_ALV_EX2
        NO STANDARD PAGE HEADING
        LINE-COUNT 65(3)
        LINE-SIZE 220
        MESSAGE-ID ZZ.
*                             Type Pools                               *
TYPE-POOLS: SLIS, ICON.
*                              Tables                                  *
TABLES: VBAK. "Sales Document Data
*                         Internal Tables                              *
* TABLE TO HOLD DATA OF SALES DOCUMENT
DATA: BEGIN OF IT_VBAK OCCURS 0,
      VBELN LIKE VBAK-VBELN, "Sales Document
      VBTYP LIKE VBAK-VBTYP, "SD document category
      AUDAT LIKE VBAK-AUDAT, "Document date (date received/sent)
      AUGRU LIKE VBAK-AUGRU, "Order reason (reason for the business)
      AUART LIKE VBAK-AUART, "Sales Document Type
      NETWR LIKE VBAK-NETWR, "Net Sales Order in Doc. Currency
      WAERK LIKE VBAK-WAERK, "SD document currency
      ICON TYPE ICON-ID,     "traffic lights
      END OF IT_VBAK.
*                             Work Areas                               *
*WORK AREAS DEFINED FOR ALV'S
DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,      "field catalog
      IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,     "field catalog ITAB
      WA_SORT TYPE SLIS_SORTINFO_ALV,           "SORT work area
      IT_SORT TYPE SLIS_T_SORTINFO_ALV,         "SORT ITAB
      LAYOUT TYPE SLIS_LAYOUT_ALV,              "LAYOUT
      WA_FCODE TYPE SLIS_EXTAB,                 "FUN CODE
      I_FCODE_EXTAB TYPE SLIS_T_EXTAB,
      WA_EVENTS TYPE SLIS_ALV_EVENT,
      IT_EVENTS TYPE SLIS_T_EVENT.
*                       Selection-Screen                               *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
PARAMETERS: P_VBTYP LIKE VBAK-VBTYP DEFAULT 'C'.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
PARAMETERS: LIST RADIOBUTTON GROUP G1,
            GRID RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF BLOCK B2.
*                     At  Selection-Screen                             *
*VALIDATION
*                       Start of Selection                             *
START-OF-SELECTION.
*POPULATION OF DATA INTO INTERNAL TABLE ITAB
  PERFORM GET_DATA.
*DEFINE USER DEFINED FIELDCATALOG
  PERFORM DEFINE_FIELDCATALOG.
*SUBTOTALS AND TOTALS DISPLAY USING SORT
  PERFORM SORT_LIST.
*CHANGE FCODE OF STATUS
  PERFORM CHANGE_FCODE.
*CHECK RADIOBUTTON OPTION AND ACCORDINGLY FINAL DISPLAY
  PERFORM CHECK_OPTION.
*&      Form  GET_DATA
*       text
FORM GET_DATA.
  SELECT VBELN
         VBTYP
         AUDAT
         AUGRU
         AUART
         NETWR
         WAERK FROM VBAK INTO TABLE IT_VBAK
         WHERE VBELN IN S_VBELN AND VBTYP = P_VBTYP
         AND ERDAT > '01.01.2004' AND NETWR > 0.
  LOOP AT IT_VBAK.
    IF IT_VBAK-NETWR < 10000.
      IT_VBAK-ICON = '@08@'.
    ELSEIF IT_VBAK-NETWR > 100000.
      IT_VBAK-ICON = '@0A@'.
    ELSE.
      IT_VBAK-ICON = '@09@'.
    ENDIF.
    MODIFY IT_VBAK INDEX SY-TABIX.
  ENDLOOP.
ENDFORM.                    "GET_DATA
*&      Form  CHECK_OPTION
*       text
FORM CHECK_OPTION.
  WA_EVENTS-NAME = 'TOP_OF_PAGE'.
  WA_EVENTS-FORM = 'TOP'.
  APPEND WA_EVENTS TO IT_EVENTS.
  CLEAR WA_EVENTS.
  WA_EVENTS-NAME = 'END_OF_LIST'.
  WA_EVENTS-FORM = 'END_LIST'.
  APPEND WA_EVENTS TO IT_EVENTS.
  CLEAR WA_EVENTS.
  IF LIST = 'X'.
    PERFORM LIST_DISP.
  ENDIF.
  IF GRID = 'X'.
    PERFORM GRID_DISP.
  ENDIF.
ENDFORM.                    "CHECK_OPTION
*&      Form  DEFINE_FIELDCATALOG
*       text
FORM DEFINE_FIELDCATALOG.
  WA_FIELDCAT-COL_POS = 1.
  WA_FIELDCAT-FIELDNAME = 'ICON'.
  WA_FIELDCAT-SELTEXT_L = 'ICON'.
  WA_FIELDCAT-ICON = 'X'.
  WA_FIELDCAT-OUTPUTLEN = 8.
  WA_FIELDCAT-TABNAME = 'IT_VBAK'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 2.
  WA_FIELDCAT-FIELDNAME = 'VBELN'.
  WA_FIELDCAT-SELTEXT_L = 'SALES DOC NO.'.
  WA_FIELDCAT-OUTPUTLEN = 10.
  WA_FIELDCAT-TABNAME = 'IT_VBAK'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 3.
  WA_FIELDCAT-FIELDNAME = 'AUDAT'.
  WA_FIELDCAT-SELTEXT_L = 'CREATED ON'.
  WA_FIELDCAT-OUTPUTLEN = 10.
  WA_FIELDCAT-TABNAME = 'IT_VBAK'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 4.
  WA_FIELDCAT-FIELDNAME = 'VBTYP'.
  WA_FIELDCAT-SELTEXT_L = 'CATEGORY'.
  WA_FIELDCAT-OUTPUTLEN = 1.
  WA_FIELDCAT-TABNAME = 'IT_VBAK'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 6.
  WA_FIELDCAT-FIELDNAME = 'AUGRU'.
  WA_FIELDCAT-SELTEXT_L = 'REASON'.
  WA_FIELDCAT-OUTPUTLEN = 3.
  WA_FIELDCAT-TABNAME = 'IT_VBAK'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 5.
  WA_FIELDCAT-FIELDNAME = 'AUART'.
  WA_FIELDCAT-SELTEXT_L = 'DOC TYPE'.
  WA_FIELDCAT-OUTPUTLEN = 4.
  WA_FIELDCAT-TABNAME = 'IT_VBAK'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 7.
  WA_FIELDCAT-FIELDNAME = 'NETWR'.
  WA_FIELDCAT-SELTEXT_L = 'NET VALUE'.
  WA_FIELDCAT-OUTPUTLEN = 17.
  WA_FIELDCAT-DECIMALS_OUT = 2.
*  WA_FIELDCAT-DO_SUM = 'X'.
  WA_FIELDCAT-TABNAME = 'IT_VBAK'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 8.
  WA_FIELDCAT-FIELDNAME = 'WAERK'.
  WA_FIELDCAT-SELTEXT_L = 'UNIT'.
  WA_FIELDCAT-OUTPUTLEN = 50.
  WA_FIELDCAT-TABNAME = 'IT_VBAK'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
ENDFORM.                    "DEFINE_FIELDCATALOG
*&      Form  DEFINE_LAYOUT
*       text
FORM DEFINE_LAYOUT.
  LAYOUT-ZEBRA = 'X'.
  LAYOUT-SUBTOTALS_TEXT = 'SUBTOTAL SUM'.
  LAYOUT-WINDOW_TITLEBAR = 'EXERCISE 2'.
  LAYOUT-TOTALS_TEXT  = 'TOTAL'.
ENDFORM.                    "DEFINE_LAYOUT
*&      Form  SORT_LIST
*       text
FORM SORT_LIST.
  WA_SORT-FIELDNAME = 'VBELN'.
  WA_SORT-TABNAME = 'IT_VBAK'.
  WA_SORT-SPOS = 1.
  WA_SORT-UP = 'X'.
  WA_SORT-SUBTOT = 'X'.
  APPEND WA_SORT TO IT_SORT.
  CLEAR WA_SORT.
  WA_SORT-FIELDNAME = 'NETWR'.
  WA_SORT-TABNAME = 'IT_VBAK'.
  WA_SORT-UP = 'X'.
  WA_SORT-SPOS = 2.
  WA_SORT-SUBTOT = 'X'.
  APPEND WA_SORT TO IT_SORT.
  CLEAR WA_SORT.
ENDFORM.                    "SORT_LIST
*&      Form  LIST_DISP
*       text
FORM LIST_DISP.
  PERFORM DEFINE_LAYOUT.
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
   EXPORTING
     I_CALLBACK_PROGRAM             = SY-REPID
     IT_FIELDCAT                    = IT_FIELDCAT
     IS_LAYOUT                      = LAYOUT
     IT_SORT                        = IT_SORT
     I_CALLBACK_PF_STATUS_SET       = 'STATUS'
     IT_EXCLUDING                   = I_FCODE_EXTAB
     I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
     IT_EVENTS                      = IT_EVENTS[]
*   IMPORTING
*     E_EXIT_CAUSED_BY_CALLER        =
*     ES_EXIT_CAUSED_BY_USER         =
    TABLES
     T_OUTTAB                       = IT_VBAK
*   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.                    "LIST_DISP
*&      Form  GRID_DISP
*       text
FORM GRID_DISP.
  PERFORM DEFINE_LAYOUT.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM       = SY-REPID
      IS_LAYOUT                = LAYOUT
      IT_FIELDCAT              = IT_FIELDCAT
      IT_SORT                  = IT_SORT
      I_CALLBACK_PF_STATUS_SET = 'STATUS'
      IT_EXCLUDING             = I_FCODE_EXTAB
      I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
      IT_EVENTS                = IT_EVENTS[]
    TABLES
      T_OUTTAB                 = IT_VBAK.
* 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.                    "GRID_DISP
*&      Form  STATUS
*       text
*      -->P_EXTAB    text
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
  SET PF-STATUS 'STATUS' EXCLUDING P_EXTAB.
ENDFORM.                    "STATUS
*&      Form  USER_COMMAND
*       text
*      -->R_UCOMM      text
*      -->RS_SELFIELD  text
FORM USER_COMMAND USING R_UCOMM     LIKE SY-UCOMM
                               RS_SELFIELD TYPE SLIS_SELFIELD.
  CASE R_UCOMM.
    WHEN 'BACK' OR 'CANC' OR 'EXIT'.
      LEAVE TO SCREEN 0.
    WHEN '&IC1'.
      SET PARAMETER ID 'AUN' FIELD RS_SELFIELD-VALUE.
      CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
  ENDCASE.
ENDFORM.                    "USER_COMMAND
*&      Form  CHANGE_FCODE
*       text
FORM CHANGE_FCODE.
  WA_FCODE = 'PRNT'.
  APPEND WA_FCODE TO I_FCODE_EXTAB.
  WA_FCODE = '&OAD'.
  APPEND WA_FCODE TO I_FCODE_EXTAB.
  WA_FCODE = '&AVE'.
  APPEND WA_FCODE TO I_FCODE_EXTAB.
  WA_FCODE = '&EB9'.
  APPEND WA_FCODE TO I_FCODE_EXTAB.
  WA_FCODE = '&SUM'.
  APPEND WA_FCODE TO I_FCODE_EXTAB.
  WA_FCODE = '&UMC'.
  APPEND WA_FCODE TO I_FCODE_EXTAB.
  WA_FCODE = '&XPA'.
  APPEND WA_FCODE TO I_FCODE_EXTAB.
  WA_FCODE = '&OMP'.
  APPEND WA_FCODE TO I_FCODE_EXTAB.
ENDFORM.                    "CHANGE_FCODE
*&      Form  TOP
*       text
FORM TOP.
  IF LIST = 'X'.
    WRITE:/ SY-ULINE.
    WRITE:/ 'DATE:', SY-DATUM,55 'INTELLIGROUP ASIA PVT LTD'.
    WRITE:/ 'TIME:', SY-UZEIT.
    WRITE:/ 'USER NAME:', SY-UNAME,60 SY-TITLE.
    WRITE:/ 'PAGE', SY-PAGNO.
    WRITE:/ SY-ULINE.
  ENDIF.
  IF GRID = 'X'.
    DATA: LS_LINE TYPE SLIS_LISTHEADER,
          E04_LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
*   Listenüberschrift: Typ H
    CLEAR LS_LINE.
    LS_LINE-TYP  = 'H'.
*   LS_LINE-KEY:  not used for this type
    LS_LINE-INFO = 'Summary'.
    APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
*   Kopfinfo: Typ S
    CLEAR LS_LINE.
    LS_LINE-TYP  = 'S'.
    LS_LINE-KEY  = 'Intelligroup'.
    LS_LINE-INFO = ''.
    APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
    LS_LINE-KEY  = 'ASIA'.
    LS_LINE-INFO = 'PVT LTD'.
    APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
*   Aktionsinfo: Typ A
    CLEAR LS_LINE.
    LS_LINE-TYP  = 'A'.
*   LS_LINE-KEY:  not used for this type
    LS_LINE-INFO = 'truman'.
    APPEND LS_LINE TO  E04_LT_TOP_OF_PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY = E04_LT_TOP_OF_PAGE
        I_LOGO             = 'ENJOY_SAP_LOGO'.
  ENDIF.
ENDFORM.                    "TOP
*&      Form  END_LIST
*       text
FORM END_LIST.
  IF LIST = 'X'.
    SKIP 2.
    WRITE:/60 'END OF PAGE'.
  ENDIF.
  IF GRID = 'X'.
      DATA: LS_LINE TYPE SLIS_LISTHEADER,
          E04_LT_END_OF_LIST TYPE SLIS_T_LISTHEADER.
*   Listenüberschrift: Typ H
    CLEAR LS_LINE.
    LS_LINE-TYP  = 'H'.
*   LS_LINE-KEY:  not used for this type
    LS_LINE-INFO = 'Summary'.
    APPEND LS_LINE TO E04_LT_END_OF_LIST.
*   Kopfinfo: Typ S
    CLEAR LS_LINE.
    LS_LINE-TYP  = 'S'.
    LS_LINE-KEY  = 'Intelligroup'.
    LS_LINE-INFO = ''.
    APPEND LS_LINE TO E04_LT_END_OF_LIST.
    LS_LINE-KEY  = 'ASIA'.
    LS_LINE-INFO = 'PVT LTD'.
    APPEND LS_LINE TO E04_LT_END_OF_LIST.
*   Aktionsinfo: Typ A
    CLEAR LS_LINE.
    LS_LINE-TYP  = 'A'.
*   LS_LINE-KEY:  not used for this type
    LS_LINE-INFO = TEXT-105.
    APPEND LS_LINE TO  E04_LT_END_OF_LIST.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY = E04_LT_END_OF_LIST.
  ENDIF.
ENDFORM.                    "END_LIST

Similar Messages

  • Hide/Remove Subtotal Icon in ALV Grid report output.

    Hi,
            Is ther a way to remove or hide the Subtotal icon in the ALV Grid report output?
    Thanks & Regards,
    Praveen.

    Hi,
    You can add names of the buttons(which you want to hide) to internal table and pass this internal table for tool bar excluding parameter while calling ALV.
    Here as shown in below code, 'Sorting, Ascending,Descending' buttons are removed from the tool bar list. 
    data : lt_exclude TYPE ui_functions.
    ls_exclude = cl_gui_alv_grid=>MC_FC_SORT.
      APPEND ls_exclude TO lt_exclude .
      ls_exclude = cl_gui_alv_grid=>MC_FC_SORT_ASC.
      APPEND ls_exclude TO lt_exclude .
      ls_exclude = cl_gui_alv_grid=>MC_FC_SORT_DSC.
      APPEND ls_exclude TO lt_exclude .
        CALL METHOD alvgd->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
         IT_TOOLBAR_EXCLUDING          = lt_exclude
    Regards,
    Maharshi Vyas

  • Allow to erase values under the input-check of the ALV Grid Control

    Hi,<br />
    in my ALV Grid I do have a cell which automatically checks the values entered by the user. When the user does not enter the values belonging to the DDIC Domain Value Range of the data element, the cell is rendered with a red border and an ALV error message comes up telling the user to enter the correct values from the F4 help.
    In general, this is really great, but in case the user needs to erase the value, this automatical ALV Grid error message keeps popping up asking him to enter at least one value from the value range.
    (I assume this is due to the fact that the Domain value range does not contain the value 'empty'.)
    <br />
    I would like to keep the functionality of checking the entered value but want to switch off the error message in case nothing was entered. How can I achive this?
    <br /> <br />
    This is what I did so far: <br />
    1. Upon initializing ALV Grid, I define the field catalog like this: <br />
    ls_fieldcat-fieldname = 'REACTION'.                       "#EC NOTEXT <br />
      ls_fieldcat-edit       = abap_true. <br />
      ls_fieldcat-coltext   = 'Reaction'.                       "#EC NOTEXT <br />
      ls_fieldcat-outputlen = '8'.                              "#EC NOTEXT  <br />
    <br />
    * This forces the user to set at least one value; not allowing him to delete it!! <br />
      ls_fieldcat-ref_table = 'CRMS_ES_FOREIGN_ATTRIBUTE'.      "#EC NOTEXT <br />
      ls_fieldcat-ref_field =  'REACTION'. <br />
      ls_fieldcat-key = abap_true. <br />
    <br />
      ls_fieldcat-checktable = '!'. <br />
      ls_fieldcat-f4availabl  = 'X'. "shows the handle for F4 help <br />
      ls_fieldcat-col_id = 7.
    <br />
    (I would assume here that the ls_fieldcat - structure would allow an additional field which allows empty values, but I could not find one!) <br />
    <br />
    2. For my ALV Grid instance, I am registering the F4 during initialization:<br />
    call method gr_fkt_grid->register_f4_for_fields <br />
            exporting <br />
              it_f4 = lt_f4. <br />
    <br />
          ls_f4-fieldname  = 'REACTION'.   "EC SYNTCHAR <br />
          ls_f4-register   = abap_true. <br />
          insert ls_f4 into table lt_f4. <br />
          call method gr_fkt_grid->register_f4_for_fields <br />
            exporting <br />
              it_f4 = lt_f4. <br />
    <br /> <br />
    3. Then I am setting the handler while initializing: <br />
          set handler lr_grid_event_receiver->handle_f4 <br />
          for all instances. <br />
    <br /> <br />
    4. I also have checking methods in PAI for the ALV cells, but they do not apply in this case, <br />
        since ALV itself performs this check described above. I cannot see a chance for <br />
        interfering myself in PAI. <br />
    <br />
    Does anyone have an idea how I could prevent the ALV Grid of bringing up the message "Enter a valid value" and <br />
    allowing to delete the cell content while keeping its checks in case the user enters a wrong value? <br />
    <br />
    Thank you very much,<br />
    regards,<br />
    Konrad<br />

    Hi Konrad,
    Inside the handler method for event DATA_CHANGED,  always suppress the error log by calling method activate_display_protocol with dialog = ''.
    Whenever u need error log call  method display_protocol based on ok_code(sy-ucomm).
    Ex:
    method data_changed.  " Handler method for event 'DATA_CHANGED'
    *Suppressing error log
        call method g_o_grid->activate_display_protocol        "  Always suppress error log when grid is changed
          exporting
            i_dialog = ''.
        if er_data_changed->mt_protocol[] is not initial.
          if ok_code = 'BACK' or ok_code = 'SAVE'.      "  Based  on  ok_code display error log
    *Display error log
            call method er_data_changed->display_protocol.
          endif.
        endif.
      endmethod.                    "data_changed
    Might solve ur problem
    Thanks,
    Edited by: Sap Fan on Oct 14, 2009 5:35 AM

  • Fit the ALV grid to the monitor size

    Hi all,
    Please let me know how i can fit the ALV grid to the monitor size of the user. That is The grids should be layered and expanded to the full width of the users monitor.
    Thanks in advance
    Jey Sabith Ebron

    Hi Jey,
    You can fit ALV grid to monitor size by defining the container as docking container.
    In this case, you neednot create a custom container .
    You can use the following code:
      CONSTANTS: lc_height TYPE i VALUE 1200.
    DATA: go_container       TYPE REF TO cl_gui_docking_container,
          go_alv_tree        TYPE REF TO cl_gui_alv_tree.
        CREATE OBJECT go_container
          EXPORTING
            repid                       = sy-repid
            dynnr                       = sy-dynnr
            side                        = 2                        " Top
            extension                   = lc_height
            metric                      = 1                        " Pixel
          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.
          MESSAGE x398(00) WITH 'ERROR'(100).
        ENDIF.
      CREATE OBJECT go_alv_tree
        EXPORTING
          parent                      = go_container
          node_selection_mode         = cl_gui_column_tree=>node_sel_mode_single
          item_selection              = c_x
          no_toolbar                  = ''
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          illegal_node_selection_mode = 5
          failed                      = 6
          illegal_column_name         = 7.
      IF sy-subrc <> 0.
        MESSAGE x398(00) WITH 'ERROR'.
      ENDIF.
    Code above is for ALV tree.
    You can define any ALV grid object using docking container.
    This will solve your problem.
    Let me know if you face any issues.
    Thanks,
    Nisha Vengal.

  • How to insert Traffic light icon in Table UI column

    Hi Expert,
    I am not able to put traffic light icon to table UI's column.
    Can any one help me.
    Thanks and Regards,
    Anil

    Hi,
    For that column of the TABLE, while create BInding option, give the UI element as Image type.
    In the Layout tab of the view, for that column, cell editor give the Image source as the
    ICON......
    Clarify this -
    Do you want to show this icon on any condition basis or ?
    Out of 6 oclumns for which column you want the traffic light icon...
    Hope you got this.
    Regards,
    Lekha.

  • Traffic light icon (start/stop preconfigured OC4J) in JDeveloper 10.1.3.3

    Searched the forums and couldn't find this previously posted. I installed the base J2EE Edition of JDeveloper 10.1.3.3 on Solaris and had the start/stop preconfigured OC4J (Traffic light) icons on the menu. When I installed the Windows Install J2EE Edition of JDeveloper 10.1.3.3 on a Windows 2000 machine and started up JDeveloper, the icons are not displayed in the icon menu. Does anyone know the reason for this?
    thanks,
    rick

    Don't know how to delete this post, so I will just reply to it. You can disregard this post. I inadvertently downloaded the J2EE version vice the Studio version. Sorry and thanks! rick

  • Traffic Light Icons

    traffic light icons are working but are greyed out, does anyone have the same problem or know of a fix?

    traffic light icons are working but are greyed out, does anyone have the same problem or know of a fix?

  • Traffic light icon

    Hi All,
    How can I display traffic light icon in classic report?
    if possible send me sample code please...
    Thanks in advance..

    use this link,
    http://www1.sapdesignguild.org/resources/ma_guidelines_2/interaction/status_icons.html
    if useful reward me with points.
    Thanks
    Sanket.

  • HT1533 how to put down the volume during the imac startup

    how to put down the volume of startup sound of imac

    Google mute startup sound mac and peruse the results.

  • Urgent :  how to select the rows in the ALV Grid Control

    How to select the rows in the ALV Grid control,
    I am facing the situation where i need to select the row/rows in the Grid control and then to lock the entries,
    If anyone have the solution please help me out
    <b>Its very Urgent</b>

    Hi Bharath,
    Go through this hope u can understand.
    SEL_MODE. Selection mode, determines how rows can be selected. Can have the following values:
    A Multiple columns, multiple rows with selection buttons.
    B Simple selection, listbox, Single row/column
    C Multiple rows without buttons
    D Multiple rows with buttons and select all ICON
    Setting and getting selected rows (Columns) and read line contents
    You can read which rows of the grid that has been selected, and dynamic select rows of the grid using methods get_selected_rows and set_selected_rows. There are similar methods for columns.
    Note that the grid table always has the rows in the same sequence as displayed in the grid, thus you can use the index of the selected row(s) to read the information in the rows from the table. In the examples below the grid table is named gi_sflight.
    Data declaration:
    DATA:
    Internal table for indexes of selected rows
    gi_index_rows TYPE lvc_t_row,
    Information about 1 row
    g_selected_row LIKE lvc_s_row.
    Example 1: Reading index of selected row(s) and using it to read the grid table
      CALL METHOD go_grid->get_selected_rows
        IMPORTING
          et_index_rows = gi_index_rows.
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines = 0.
        CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
             EXPORTING
                  textline1 = 'You must choose a valid line'.
        EXIT.
      ENDIF.
      LOOP AT gi_index_rows INTO g_selected_row.
         READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
        ENDIF.
      ENDLOOP.
    Example 2: Set selected row(s).
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines > 0.
        CALL METHOD go_grid->set_selected_rows
            exporting
              it_index_rows = gi_index_rows.
      ENDIF.
    Reward points if helpful.
    Thanks
    Naveen khan

  • How to get the alv grid report in another screen when double click on basic

    Hi.
    I have created an alv report using class cl_gui_alv_grid.I got another report in the same screen,when double clicked on basic list(using double_click event).I want to get this report in another screen.What i have to do?(In classical reports i worked with sy-lsind = 1 ,but how to do here?)
    How to set color to the selected rows in the alv grid report?I worked with change_data_from_inside method of cl_gui_alv_grid.But it didn't work out..
    With Regards,
    Ramana.

    On double click event . you will have to call another screen say 9000.
    now within screen 900 PBO.. you will have to prepare the fieldcatalog/layout.. and the table to be displayed there.
    in PAI of screen 9000, you can return to the original ALV.
    method double_click.
    call screen 9000.
    endmethod.
    " now in PBO create a module display_alv2
    module display_alv2.
    'prepare the fieldcat/layout info for new alv
    'add the data to the new ALV table
    'instantiate the grid call.. etc
    'call the ALV
    endmodule
    "in PAI
    module exit.
    case sy-ucomm.
    when 'ENT1'.
      leave to screen 0.
    endcase.
    endmodule
    while preparing the field catalog you can mention the EMPHASIZE field, whish will give color to tht column
    E.g
    *--Service Order
        ls_fieldcat-tabname   = 'IT_FINAL_VALID'.
        ls_fieldcat-fieldname = 'AUFNR'.
        ls_fieldcat-scrtext_m = 'Service Order'.
        ls_fieldcat-ref_table = 'AUFK'.
        ls_fieldcat-ref_field = 'AUFNR'.
        ls_fieldcat-col_pos   = 1.
        ls_fieldcat-outputlen = 12.
        ls_fieldcat-emphasize = 'C400'.  "This will add color to the cell
        APPEND ls_fieldcat TO fcat_valid.
    Hope this helps.

  • How to send the ALV GRID output to spool by using the print button in std t

    How to send the ALV GRID output to spool by using the print button in standard tool bar.
    We have created a button in the va02 transaction.  If user click on the button the new screen will be display on that screen we are populating the alv grid output using the oops concept.  But i am unable to send the output to spool using the print button in the standard tool bar.
    I am able to display the Print parameter dialog box but i am not able to send it to spool.
    Kindly help.
    Thanks In Advance.
    G.V.Ramana

    Hi Shaik,
    There is not properties button in my print screen.
    MODULE user_command_0900 INPUT.
        WHEN 'EXCEL'.
          PERFORM excel_download.                              
        WHEN 'PRI'.
          PERFORM print_output.
    form Print_output.
    CALL FUNCTION 'RSPO_LIST_LAYOUT_FITS'
               EXPORTING
                    columns        = 80
                    device         = 'ANY '
                    lines          = 65
                    maxpenality    = 1999
               TABLES
                    layouts        = lt_layouts1
               EXCEPTIONS
                    unknown_device = 1
                    OTHERS         = 2.
          IF sy-subrc = 0.
            LOOP AT lt_layouts1.
              IF lt_layouts1-penality < 1000        AND
                 lt_layouts1-penality < l_min_penality.
                l_layout       = lt_layouts1-layout.
                l_min_penality = lt_layouts1-penality.
              ENDIF.
            ENDLOOP.
            IF NOT l_layout IS INITIAL.
              CALL FUNCTION 'GET_PRINT_PARAMETERS'
                   EXPORTING
                        mode                   = 'CURRENT'
                        line_size              = 80             "#EC *
                new_list_id            = l_new_list_id
                        no_dialog              = l_no_dialog
                        layout                 = l_layout
                   IMPORTING
                        out_archive_parameters = rs_arc_params
                        out_parameters         = rs_pri_params
                        valid                  = l_valid
                   EXCEPTIONS
                        archive_info_not_found = 1
                        invalid_print_params   = 2
                        invalid_archive_params = 3
                        OTHERS                 = 4.
              IF sy-subrc NE 0.                                 " INS SLIN
              ENDIF.                                            " INS SLIN
              IF rs_pri_params-linsz LT 80 OR
                 rs_pri_params-linsz LT gt_stack-s_lprint-width.
                gt_stack-print_line_break = 'X'.
              ELSE.
                CLEAR gt_stack-print_line_break.
              ENDIF.
              IF l_valid NE 'X'.
                rs_pri_params = ls_pri_params_sav.
                rs_arc_params = ls_arc_params_sav.
              ENDIF.
            ENDIF.
          ENDIF.
    endform.                    " Print_output
        CALL METHOD gv_cost_tot_alv_grand->set_table_for_first_display
                EXPORTING
                   is_layout         = gs_layout_cost_tot_grand
                CHANGING
                   it_fieldcatalog   = gt_fcat_cost_tot_grand[]
                   it_outtab         = gt_cost_tot_grand[].
    Please check my code

  • How can I get the name of a output module template

    Hey guys,
         SDK newbie here.
         How can I get the name of every output module template?
         Thanks
    Zhiqiang Li

    Ok. Bravo
    Please mark this as 'Answered' - it will help others on the forum -

  • How to implement functionkeys on the ALV GRID tool bar

    Hello All,
    I need to implement functionkeys(Ex.given below) to the standard buttons like Ascending order etc. on the ALVGRID Tool Bar . I have implementedObject orient concept( Methods) to display the out put.I tried by using set pf-status but it is not comming.
    Ex:
    ALV Grid Toll Bar Buttons                ( Func.Keys )      
    Print Preview                       ( CtrlShiftF10)
    Sort in Ascending order        ( Ctrl+F6 )
    Thanks in Advance.
    Vijay
    Edited by: Vijay Reddy on Aug 19, 2008 10:12 AM
    Edited by: Vijay Reddy on Aug 19, 2008 10:13 AM

    Hi,
    check this code,
    REPORT  zcl_timesheet_approval MESSAGE-ID zcl_msg.
    *  CLASS L_CL_EVENTS DEFINITION                                        *
    *  Class for inserting buttons on the toolbar                          *
    CLASS l_cl_events DEFINITION.
      PUBLIC SECTION.
        METHODS:
          toolbar FOR EVENT toolbar
                  OF cl_gui_alv_grid
                  IMPORTING e_object
                            e_interactive,
          user_command FOR EVENT user_command
                       OF cl_gui_alv_grid
                       IMPORTING e_ucomm .
    ENDCLASS.                              " L_CL_EVENTS DEFINITION
    *  CLASS L_CL_EVENTS IMPLEMENTATION                                    *
    *  Implementation of class L_CL_EVENTS                                 *
    CLASS l_cl_events IMPLEMENTATION.
      METHOD toolbar.
        PERFORM event_toolbar USING e_object.
      ENDMETHOD.                           " TOOLBAR
      METHOD user_command.
        PERFORM event_ucomm USING e_ucomm.
      ENDMETHOD.                           " USER_COMMAND
    ENDCLASS.                              " L_CL_EVENTS IMPLEMENTATION
    CONSTANTS:
       c_boolean_yes(1)     TYPE c         " Boolean - yes
                           VALUE 'X',
       c_approve_status(1)  TYPE c         " Approval status
                           VALUE 'A',
       c_rej_status(1)      TYPE c         " Rejected status
                           VALUE 'R',
       c_save_status(1)     TYPE c         " Save status
                           VALUE 'S',
       c_fcode_approve(7)   TYPE c         " Function code - APPROVE
                           VALUE 'APPROVE',
       c_fcode_rej(6)       TYPE c         " Function code - REJECT
                           VALUE 'REJECT',
       c_fcode_back(4)      TYPE c         " Function code - BACK
                           VALUE 'BACK',
       c_fcode_onli(4)      TYPE c         " Function code - EXECUTE
                           VALUE 'ONLI',
       c_fcode_exit(4)      TYPE c         " Function code - EXIT
                           VALUE 'EXIT',
       c_fcode_cancel(6)    TYPE c         " Function code - CANCEL
                           VALUE 'CANCEL',
       c_zero(1)            TYPE c         " Constant value 0
                           VALUE '0',
       c_alv_scr(7)         TYPE c         " GUI status : ALV screen
                           VALUE 'ALV_SCR'.
    * Field-string declarations...........................................
    DATA:
    * Field-string to build fieldcat.
       fs_fcat TYPE lvc_s_fcat,
    * Field-string for t_temp
       fs_temp TYPE type_s_temp.
    * Working variables...................................................
    * Internal table declarations........................................
    DATA:
    * Internal table to build fieldcat.
       t_fcat      TYPE lvc_t_fcat,
    * For ALV ...........................................................
    DATA:
    * To create instance for cl_gui_custom_container
      g_grid      TYPE REF TO cl_gui_custom_container,
    * To create instance for cl_gui_alv_grid
      g_alv       TYPE REF TO cl_gui_alv_grid,
    * To create instance for l_cl_events
      g_events    TYPE REF TO l_cl_events,
    * To assign name for custom container
      g_container TYPE scrfname VALUE 'CONTAINER',
    * To assign layout
      g_fcatlayo  TYPE lvc_s_layo.
    *            AT SELECTION-SCREEN EVENT                                 *
    AT SELECTION-SCREEN.
    * To perform user actions on the selection screen
      PERFORM user_command.
    *  MODULE  STATUS_0100  OUTPUT                                         *
    *  This module will create the objects for the instance and display    *
    *  the records                                                         *
    MODULE status_0100 OUTPUT.
      SET PF-STATUS c_alv_scr.
      PERFORM set_titlebar USING w_display.
    * If program executed in foreground.
      IF sy-batch IS INITIAL.
    * If g_grid is empty.
        IF g_grid IS INITIAL.
    * To create object for instance grid
          CREATE OBJECT g_grid
            EXPORTING
              container_name = g_container.
    * To create object for object grid
          CREATE OBJECT g_alv
            EXPORTING
              i_parent = g_grid.
        ELSE.
    *     IF W_SUBMIT EQ
          CALL METHOD g_alv->refresh_table_display.
        ENDIF.                             " IF G_GRID IS INITIAL
      ENDIF.                               " IF SY-BATCH IS INITIAL
      REFRESH t_fcat.
    * If w_display eq 'X' .
      IF w_display EQ c_boolean_yes.
    * To display all records except saved data
        PERFORM display_allrecords.
      ENDIF.                               " IF W_FLAG EQ C_BOOLEAN_YES
      IF w_submit EQ c_boolean_yes.
    * To display submitted records
        PERFORM submitted_records.
      ENDIF.                               " IF W_SUBMIT EQ C_BOOLEAN_YES
    ENDMODULE.                             " STATUS_0100  OUTPUT
    *  MODULE USER_COMMAND_0100  INPUT                                     *
    *  To perform user actions in the screen 100                           *
    MODULE user_command_0100 INPUT.
    * To update the data in the ALV grid
      PERFORM check_changed_data.
      w_okcode = ok_code.
      CLEAR ok_code.
      CASE w_okcode.
        WHEN c_fcode_back.
          LEAVE TO SCREEN 0.
        WHEN c_fcode_exit OR c_fcode_cancel.
          LEAVE PROGRAM.
      ENDCASE.                             " CASE W_OKCODE
    ENDMODULE.                             " USER_COMMAND_0100
    *  FORM BUILD_FCAT                                                     *
    *  To build the field catalog giving managers comment in editable mode *
    *  -->PR_Tabname   type lvc_tname                                      *
    *  -->PR_Fieldname type lvc_fname                                      *
    *  -->PR_Coltext   type lvc_txtcol                                     *
    *  -->PR_Colpos    type lvc_colpos                                     *
    FORM build_fcat USING pr_tabname   TYPE lvc_tname
                          pr_fieldname TYPE lvc_fname
                          pr_coltext   TYPE lvc_txtcol
                          pr_colpos    TYPE lvc_colpos.
      CLEAR fs_fcat.
      fs_fcat-tabname   = pr_tabname.
      fs_fcat-fieldname = pr_fieldname.
      fs_fcat-coltext   = pr_coltext.
      fs_fcat-col_pos   = pr_colpos.
      IF fs_fcat-fieldname EQ 'MNGCOMMENT'.
        fs_fcat-edit      = c_boolean_yes.
        fs_fcat-lowercase = c_boolean_yes.
        fs_fcat-dd_outlen = 60.
      ELSE.
        fs_fcat-edit      = space.
      ENDIF.                               " IF FS_FCAT-FIELDNAME...
      APPEND fs_fcat TO t_fcat.
    ENDFORM.                               " BUILD_FCAT
    *   FORM BUILD_FCATD                                                   *
    *  To build fieldcatalog in the display mode                           *
    *  -->pr_Tabname   type lvc_tname                                      *
    *  -->pr_Fieldname type lvc_fname                                      *
    *  -->pr_Coltext   type lvc_txtcol                                     *
    *  -->pr_Colpos    type lvc_colpos                                     *
    FORM build_fcatd USING pr_tabname   TYPE lvc_tname
                           pr_fieldname TYPE lvc_fname
                           pr_coltext   TYPE lvc_txtcol
                           pr_colpos    TYPE lvc_colpos .
      CLEAR fs_fcat.
      fs_fcat-tabname   = pr_tabname.
      fs_fcat-fieldname = pr_fieldname.
      fs_fcat-coltext   = pr_coltext.
      fs_fcat-col_pos   = pr_colpos.
      fs_fcat-edit      = space.
      APPEND fs_fcat TO t_fcat.
    ENDFORM.                               " BUILD_FCATD
    *  FORM ALV_DISPLAY                                                    *
    *  To display data in ALV                                              *
    *  --> pr_table type standard table                                    *
    *  --> pr_fcat  type lvc_t_fcat                                        *
    FORM alv_display USING pr_table TYPE STANDARD TABLE
                           pr_fcat  TYPE lvc_t_fcat .
    * Local data declaration....
      DATA: lt_exclude TYPE ui_functions.
    * To exclude buttons on the ALV grid
      PERFORM exclude_tb_functions CHANGING lt_exclude.
    * To display ALV
      CALL METHOD g_alv->set_table_for_first_display
        EXPORTING
          i_default            = space
          is_layout            = g_fcatlayo
          it_toolbar_excluding = lt_exclude
        CHANGING
          it_outtab            = pr_table[]
          it_fieldcatalog      = pr_fcat[].
    ENDFORM.                               " ALV_DISPLAY
    *  FORM EVENT_TOOLBAR                                                  *
    *  Setting toolbar in the alv grid                                     *
    *  -->E_OBJECT TYPE REF TO CL_ALV_EVENT_TOOLBAR_SET                    *
    FORM event_toolbar USING e_object
                             TYPE REF TO cl_alv_event_toolbar_set.
    * Local declaration for the button.
      DATA: ls_toolbar TYPE stb_button.
    * To add Approve button
      ls_toolbar-function  = c_fcode_approve.
      ls_toolbar-butn_type = c_zero.
      ls_toolbar-text      = text-001.
      APPEND ls_toolbar TO e_object->mt_toolbar.
    * To add Reject button
      CLEAR ls_toolbar.
      ls_toolbar-function  = c_fcode_rej.
      ls_toolbar-butn_type = c_zero.
      ls_toolbar-text      = text-013.
      APPEND ls_toolbar TO e_object->mt_toolbar.
    ENDFORM.                               " EVENT_TOOLBAR
    *  FORM EXCLUDE_TB_FUNCTIONS                                           *
    *  To exclude buttons from ALV grid                                    *
    *  <--> PR_EXCLUDE TYPE UI_FUNCTIONS                                   *
    FORM exclude_tb_functions  CHANGING pr_exclude TYPE ui_functions.
    * Local data declaration...
      DATA ls_exclude TYPE ui_func.
    * To remove the buttons on the ALV grid.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
      APPEND ls_exclude TO pr_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
      APPEND ls_exclude TO pr_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
      APPEND ls_exclude TO pr_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
      APPEND ls_exclude TO pr_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
      APPEND ls_exclude TO pr_exclude.
    ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
    *  FORM EVENT_UCOMM                                                    *
    *  After Input in the ALV grid,if user select record and press         *
    *  approve or reject then the record will get updated                  *
    *  --> PR_ucomm type sy-ucomm                                          *
    FORM event_ucomm USING pr_ucomm LIKE sy-ucomm.
      CASE pr_ucomm.
    * If e_ucomm contains 'APP' i.e.function code for Approve button
        WHEN c_fcode_approve.              " To approve selected record
          PERFORM app_timesheet USING c_approve_status.
    * If e_ucomm contains 'REJ' i.e. function code for Reject
        WHEN c_fcode_rej.                  " To reject selected record
          PERFORM app_timesheet USING c_rej_status.
      ENDCASE.                             " CASE E_UCOMM
    ENDFORM.                               " EVENT_UCOMM
    *  FORM APP_TIMESHEET                                                  *
    *  To get the selected records and update the records in database      *
    *   --> pr_status type char01                                          *
    FORM app_timesheet USING pr_status TYPE char01 .
    * Local data declaration......
      DATA:
       lt_marked_rows TYPE lvc_t_roid,     " Table to get rowid
       l_fs_marked_row LIKE LINE OF lt_marked_rows.
                                           " Field-string for lt_marked_rows
    * To get all the selected rows in the table lt_marked_rows
      CALL METHOD g_alv->get_selected_rows
        IMPORTING
          et_row_no = lt_marked_rows.
    * Reading each row id and updating the database.
      LOOP AT lt_marked_rows INTO l_fs_marked_row.
    * Reading the table t_timesheet with rowid
        READ TABLE t_timesheet INTO fs_timesheet INDEX
                                                 l_fs_marked_row-row_id.
    * If record is there in the table.
        IF sy-subrc EQ 0.
          CLEAR fs_timesheet-appstatus.
          GET PARAMETER ID 'ZEMPID' FIELD w_empid.
    * Changing the appstatus.
          fs_timesheet-appstatus = pr_status.
          fs_timesheet-approvedby = w_empid.
    * Updating the database table.
          UPDATE zcl_timesheet FROM fs_timesheet.
          IF sy-subrc EQ 0.
           fs_temp-empid = fs_timesheet-empid.
           fs_temp-workdate = fs_timesheet-workdate.
           fs_temp-linenum  = fs_timesheet-linenum.
           append fs_temp to t_temp.
          ENDIF.                           " IF SY-SUBRC EQ 0.
        ENDIF.                             " IF SY-SUBRC EQ 0
      ENDLOOP.                             " LOOP AT LT_MARKED_ROWS...
      perform delete_data .
      PERFORM refresh_table USING pr_status.
    ENDFORM.                               " APP_TIMESHEET
    *  FORM CHECK_CHANGED_DATA                                             *
    *  To change the data                                                  *
    *  No parameters are passsed to this subroutine                        *
    FORM check_changed_data .
    * To change the data.
      CALL METHOD g_alv->check_changed_data.
    ENDFORM.                               " CHECK_CHANGED_DATA
    *  FORM REFFRESH_TABLE                                                 *
    *  To refresh output table and  issue message according p_status       *
    *  -->PR_STATUS TYPE CHAR01                                            *
    FORM refresh_table  USING pr_status TYPE char01.
    * To refresh output table.
      CALL METHOD g_alv->refresh_table_display.
    * Depending upon pr_status message is given.
      IF pr_status EQ c_approve_status.
        MESSAGE s001.
      ELSE.
        MESSAGE s002.
      ENDIF.                               " IF P_STATUS EQ C_APPROVE_STATUS
    ENDFORM.                               " REFRESH_TABLE
    *  FORM SET_TITLEBAR                                                   *
    *  To set titlebar on the screen 100.                                  *
    *  -->PR_STATUS TYPE CHAR01                                            *
    FORM set_titlebar USING pr_status TYPE char01.
    * If pr_status eq 'X'.
      IF pr_status EQ c_boolean_yes.
        SET TITLEBAR c_alv_scr WITH text-017.
      ELSE.
        SET TITLEBAR c_alv_scr WITH text-018.
      ENDIF.                               " IF P_STATUS EQ C_BOOLEAN_YES
    ENDFORM.                               " SET_TITLEBAR
    *  FORM USER_COMMAND                                                   *
    *  According to sy-ucomm the action is performed in the screen 100     *
    *  No parameters are passsed to this subroutine                        *
    FORM user_command .
      CASE sy-ucomm.
    * If p_app is selected, submitted data will be displayed for approval
        WHEN c_fcode_onli OR c_fcode_approve.
          CLEAR sy-ucomm.
    * To display the submitted records.
          IF p_app EQ c_boolean_yes.
            w_submit = c_boolean_yes.
    * To get submitted records
            PERFORM get_data.
          ENDIF.                           " IF P_APP EQ C_BOOLEAN_YES
    * To display all records according to selection.
          IF p_disp EQ c_boolean_yes.
            w_display = c_boolean_yes.
    * To display
            PERFORM display_all.
            CLEAR w_display.
          ENDIF.                           " IF P_DISP EQ C_BOOLEAN_YES
         IF p_sdn EQ c_boolean_yes.
           PERFORM GET_GRAPH.
         ENDIF.
      ENDCASE.                             " CASE SY-UCOMM
    ENDFORM.                               " USER_COMMAND
    *  FORM  DISPLAY_ALLRECORDS                                            *
    *  To display all the records in the display mode                      *
    *  No parameters are passsed to this subroutine                        *
    FORM display_allrecords .
      CLEAR w_display.
      PERFORM build_fcatd USING 'T_TIME' 'WORKDATE'     text-002 '1'.
      PERFORM build_fcatd USING 'T_TIME' 'EMPID'        text-009 '2'.
      PERFORM build_fcatd USING 'T_TIME' 'PROJECTID'    text-003 '3'.
      PERFORM build_fcatd USING 'T_TIME' 'PROJECTNAME'  text-004 '4'.
      PERFORM build_fcatd USING 'T_TIME' 'OBJECTID'     text-005 '5'.
      PERFORM build_fcatd USING 'T_TIME' 'OBJECTNAME'   text-006 '6'.
      PERFORM build_fcatd USING 'T_TIME' 'ACTIVITYID'   text-007 '7'.
      PERFORM build_fcatd USING 'T_TIME' 'ACTIVITYNAME' text-008 '8'.
      PERFORM build_fcatd USING 'T_TIME' 'TIMEWORKED'   text-010 '9'.
      PERFORM build_fcatd USING 'T_TIME' 'DESCRIPTION'  text-011 '10'.
      PERFORM build_fcatd USING 'T_TIME' 'APPSTATUS'    text-012 '11'.
      PERFORM build_fcatd USING 'T_TIME' 'BILLSTATUS'   text-016 '12'.
      PERFORM build_fcatd USING 'T_TIME' 'SDNSTATUS'    text-019 '13'.
      PERFORM build_fcatd USING 'T_TIME' 'MNGCOMMENT'   text-014 '14'.
      PERFORM alv_display USING t_time t_fcat.
    ENDFORM.                               " DISPLAY_ALLRECORDS
    *  FORM SUBMITTED_RECORDS                                              *
    *  To display submitted records for the manager to approve             *
    *  No parameters are passsed to this subroutine                        *
    FORM submitted_records .
      CLEAR w_submit.
    * To create object for instance g_events
      CREATE OBJECT g_events.
    * If w_first equal to space
      IF w_first IS INITIAL.
        SET HANDLER g_events->toolbar
                FOR g_alv.
        w_first = c_boolean_yes.
      ENDIF.                               " IF W_FIRST IS INITIAL..
      SET HANDLER g_events->user_command
              FOR g_alv.
      g_fcatlayo-sel_mode = c_approve_status.
      REFRESH t_fcat.
      * to fill ur field cat table.
    ENDFORM.                               " SUBMITTED_RECORDS
    * FORM DELETE_DATA                                                     *
    * This form is used to delete thedata from output table after updating *
    * the database                                                         *
    * No parameters are passsed to this subroutine                         *
    form delete_data .
       loop at t_temp into fs_temp.
         loop at t_timesheet into fs_timesheet where
                             empid = fs_temp-empid
                         and workdate = fs_temp-workdate
                         and linenum = fs_temp-linenum.
          delete  t_timesheet index sy-tabix.
          endloop.                         " LOOP AT T_TEMP INTO FS_TEMP
       endloop .                           " LOOP AT T_TIMESHEET INTO FS_T..
    endform.                               " DELETE_DATA
    Hope it helps you.
    Regards
    Manjari.

  • How to increase the alv grid size dynamically

    Hi all,
    I have to develop the report with the following requirement:
    I have to take bwkey from t001k on basis of bukrs and bwkey. this bukrs and bwkey are entered in selection-screen.
    I have to select matnr, lbkum, salk3 from mbew on basis of bwkey in selection-screen.(this is select options)
    now the ouput should be as follows:
    for example :
                        ef01                efo2               ef03
    matnr     lbkum  salk3  lbkum    salk3      lbkum  salk3         total
    700001     3       4            0        0            0            0                    7
    700010     0       0            2       1             0            0                    3
    The output should be as mentioned above.
    In the above output,
    in the first record for 700001, the total of 3 and 4 is displayed as total 7 and
    for 700010 , it is displayed as 3.
    the get the output as above in the alv grid,
    I have taken bwkeys in t001k and remaining fields from mbew and joined them in final internal table.
    now in the final table ifinal, i have the following fields,
    matnr lbkum salk3 bwkey total.
    now when i want to display the output, it is displaying as normal output like
    mantr bwkey lbkum salk3 total
    700001 etap   3         4      7
    700002 etap   1        2       3
    but i want to display in the first mentioned format.
    so i tried to attach the bwkey values in it001k(this is internal table for t001k) for the final field catalog so that this bwkeys are displayed as column headings in the final output. but it is not displaying.
    Please suggest me the solution to display the output in the above first mentioned
    format as soon as possible
    points will be awarded.
    thanking u in advance.
    A.Srinivas

    hi ,
    u can set the row count to any number , here I am setting it to 5 using the method set_visible_row_count
    1 Change the visible row count to u20185u2019
      DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
      lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
      DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
      lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
        DATA lo_value TYPE REF TO cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(
        lo_value->if_salv_wd_table_settings~set_visible_row_count( '5' ).
    u can also go thru this useful links for CONFIGUIRING ALV :
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40794172-b95a-2910-fb98-b86d8a0918b4;jsessionid=(J2EE3417400)ID0488867050DB10849380333905377829End
    SAP List Viewer (ALV) [original link is broken]
    Configuring ALV
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1190424a-0801-0010-84b5-ef03fd2d33d9?overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/db22242d-0701-0010-28a2-aeaa1fefd706;jsessionid=(J2EE3414800)ID0133346050DB00727847586176044227End?overridelayout=true&bcsi_scan_06B6B0A4B65849C2=0
    I hope it shud solve ur query.
    regards,
    amit

Maybe you are looking for

  • BKI0008E: The environment variable BI_CALLER is not set correctely. The cur

    Hi All, I have configured backint for backup of maxdb for content server 640. I configured it as per the documents available, created the configuration fiale and the parameter file. Created the backup medium in dbmgui. Now when i try to run the backu

  • Problem with JFileChooser and ImageIcon

    I'm trying to create an ImageIcon object from file selected in JFileChooser. The problem is that jfc.getSelectedFile().getAbsolutePath() returns a string with backslashes and the constructor of ImageIcon requires the string to have slashes. I`ve trie

  • What adapter needed to connect to S-video or composite video on TV

    My MacBook Pro has a mini-display port and I can't seem to find an adapter that will allow output to S-video and composite video. I have the adapter that worked with the Powerbook G4 12". Thanks

  • Driver Program and Script

    Hi, I have a script and corresponding driver program. How do I check at what point a window in a script is getting printed. Because, I can see values in the driver program which are not getting printed in the script ( in an address window in this cas

  • MOVED: how to make a good flow in the case?

    This topic has been moved to Off Topic Technical. how to make a good flow in the case?