Applet, JFrame: Display icons in toolbar

Hello,
I've a class called Designer which extends Applet. In the init method two JFrames are opened: DesignerFrame and DrawPanel. In the DesignerFrame I have a toolbar with icons. When I run the Applet in Eclipse (on my local computer) he shows the icons. When I put the application on my webserver, and I open it with my browser on my local computer, he doesn't show the icons. The icons are in a folder called pwdImages.
Does anyone know how to solve this problem?
Thanks a lot!!!
Koen.

Hello,
Thanks for the answers. Here's some code of the DesignerFrame class:
// Handles color menu items
     class ColorAction extends AbstractAction {
          public ColorAction(String name, Color color) {
               super(name);
               this.color = color;
               String iconFileName = "pwdImages/" + name + ".gif";
               if (new File(iconFileName).exists())
                    putValue(SMALL_ICON, new ImageIcon(iconFileName));
          public ColorAction(String name, Color color, String tooltip) {
               this(name, color);
               if (tooltip != null) // If there is a tooltip
                    putValue(SHORT_DESCRIPTION, tooltip); // ...squirrel it away
          public void actionPerformed(ActionEvent e) {
               elementColor = color;
               statusBar.setColorPane(color);
          private Color color;
addMenuItem(
               colorMenu,
               redAction = new ColorAction("Red", Color.RED, "Draw in red"));
// Element color actions
     private ColorAction redAction, yellowAction, greenAction, blueAction;
...

Similar Messages

  • Method add_function does not display icon in toolbar

    Hi,
    as described in the subject of this post I have a problem with the method add_function of class cl_salv_functions_list. My intend was to add several buttons in the toolbar of the ALV grid. Adding of these buttons is functional but there is no icon display although I defined the right value. Maybe there is a mistake in calling the method. Please see the attached code.
    Prerequisites:
    <b>eg. l_icon1 = "ICON_REFRESH" --> or should I use another value???</b>
    data: lr_columns type ref to cl_salv_columns_table,
            lr_column type ref to cl_salv_column_table,
            lr_functions type ref to cl_salv_functions_list,
            lr_layout type ref to cl_salv_layout,
            ls_key type salv_s_layout_key,
            selection type ref to cl_salv_selections,
            l_icon1 type string,
            l_icon2 type string,
            l_icon3 type string,
            l_icon4 type string,
            e_text type string,
            l_oref   type ref to cx_root.
      try.
          l_icon1 = text-ic1.
          l_icon2 = text-ic2.
          l_icon3 = text-ic3.
          ls_key-report = sy-cprog.
          lr_columns = r_process_alv->get_columns( ).
          lr_functions = r_process_alv->get_functions( ).
          lr_layout = r_process_alv->get_layout( ).
          lr_functions->set_all( value = if_salv_c_bool_sap=>true ).
          try.
              lr_functions->add_function(
                            name = 'SAPDET'
                            icon = l_icon1
                            text = 'Details'
                            tooltip =' Details'
                            position = if_salv_c_function_position=>left_of_salv_functions
              lr_functions->add_function(
                                  name = 'APPEND'
                                  icon = l_icon2
                                  tooltip = 'ADD'
                                  position = if_salv_c_function_position=>left_of_salv_functions
              lr_functions->add_function(
                                  name = 'DELETE'
                                  icon = l_icon3
                                  text = 'Del'
                                  tooltip = 'Session löschen'
                                  position = if_salv_c_function_position=>left_of_salv_functions
              lr_functions->add_function(
                                  name = 'REFRESH'
                                  icon = l_icon4
                                  text = 'Refresh'
                                  tooltip = 'Refresh'
                                  position = if_salv_c_function_position=>left_of_salv_functions
            catch cx_salv_wrong_call cx_salv_existing into l_oref.
              e_text = l_oref->get_text( ).
              message e_text type 'E'.
          endtry.
    Thanks in advance.
    Regards
    Maik.

    Hello Maik
    Rich is right. Since release 6.20 we should use
      TYPE-POOLS: icon.   " instead of include <icon>.
    In sample report <b>SALV_DEMO_TREE_FUNCTIONS</b> they use the "cryptic" version of the icons which is not preferable.
        try.
          l_text1 = text-b01.
          l_text2 = text-b02.
          lr_functions->add_function(
            name     = 'MYFUNCTION'
            icon     = '@DF@'
            text     = l_text1
            tooltip  = l_text2
            position = if_salv_c_function_position=>right_of_salv_functions ).
          catch cx_salv_wrong_call cx_salv_existing.
        endtry.
    Regards
      Uwe

  • Display icons in Network ui element

    Hello everybody!
    Im trying to display some hierarchies in a Network ui element. Generally, this works fine, but I'm not able to display icons with the elements inside the applet. The examples in the JNet/JGantt Developer Documentation use <icon/>-tags with the path to a gif file in the Type Repository section like this
    <type name="SomeTypeName" inherits="SomeBaseTypeName">
         <icon space="5">apps/orgchart/chief.gif</icon>
    </type>
    and the Type Repository documentation tells me to
    Specify the relative address of the URL in relation to the code base of JNet.jar
    (a file in your own JAR. file: apps/slm/icon.gif, for example). If
    the relative path starts with apps, JNet automatically adds the
    missing com/sap/jnet. We recommend that you use the relative path
    wherever possible, because you can store the icon graphics in the same directory
    in Perforce as the type repository.
    But how would I determine the relative address of my icon files stored in my web dynpros src/mimes/components/<component name>-folder inside my WebDynpro jar/ear/whatever in relation to the code base of the JNet.jar which - I guess - would reside inside the WebDynpro runtime or somewhere else on the server, but not inside my own jar ? Or am I wrong about this ?
    Thanks a lot
    Michael

    Hi Christian!
    That's what I tried in the first place. The result is something like
    /usr/sap/XXX/J02/j2ee/cluster/apps/myCompany.com/my~webdynproapp/servlet_jsp/webdynpro/resources/myCompany.com/my~webdynproapp/root/Components/package.path.to.my.component/imagename.gif
    but the applet does not find the image files. Since the JNet documentation says to specify the relative path from the JNet.jar code base, I'd have to find out where that is and calculate the relative path, but possibly this will only work inside a single jar (which I don't have since the JNet.jar is somewhere among the portal WebDynpro runtime components, I guess).
    Preferrably, I'd like to have a look at a working example using the Network ui component with external icons inside a java WebDynpro. Propably someone has done that before...
    Thanks
    Michael

  • Displaying icons in forms 9i

    I am new to forms 9i. I want to display icons in my menu toolbar.
    Please send me the solution to display icons.
    Thanks for ur help.

    We tried to follow the instructions on the webicons.pdf file but we still can't see our icon in the forms builder or on our local machine webserver. We created a jar file but now we don't know how to reference the jpg in the properties of the button on our form. What we are trying to do is create a down arrow button to envoke a LOV. Is there an easier way?

  • Displaying icons in JMenuBar

    Is it possible to display icons instead of text in the JMenuBar? I know you can make menu items with icons/text, but the menu itself I'd like to use an icon.
    The only possible workaround I can think of is to use a toolbar (with icon buttons) and attach action events to load a JPopupMenu... however, I have to add code to figure out the dynamic positioning and to hide/show the menus appropriately.
    Is there a simplier way?

    I do not remember making changes to the CLASSPATH, either way it would be good that you double check your steps against the metalink note 232413.1 - How to Deploy Iconic Images via a JAR File in Forms 9i/10g.
    As a reference, you can also take a look at this thread icons not displaying in oracle forms.

  • How do I add the Displays icon to the Menu Bar?

    In prior OS on my iMac, I was able to add the Display icon to the Menu Bar, making it a quick fix to adjust the resolution.  That option no longer appears in the Display section of System Preferences.  I am using multiple displays.  Could that make any difference?  Any suggestions?

    http://displaymenu.milchimgemuesefach.de/about.html

  • How to display ICONS in normal report without using icons table

    Hi Friends,
    I have to display icons(traffic lights) in a normal report.
    Can we do that without using icons table?
    If yes, please let me know how?
    Thanks,

    Hi Pagidala,
    Go to txcode - ABAPDOCU and in that expand BC-ABAP Programming->ABAP User Dialog->Screens->complex screen elements->status icons on Screens.
    In this you can see sample code which may help you.
    Cheers!!

  • To display icon in ALV report

    How to display icon (like green or red circle similar to signal light) in ALV Report

    Hi,
    just create a separate col in alv and in the field catalog assign the property lights .
    and refer to the wiki link
    [http://wiki.sdn.sap.com/wiki/display/Snippets/ALVGriddisplaywithLights]
    Hope this resolves the issue !
    Best of Luck !!
    Regards,
    Ravi Aswani

  • I want to display icons in ALV

    Hi friends,
    I want to display icon indicators in ALV ???
    can anybody tell me ??/
    Thanks...

    Hi sturdy,
    this code will help u...copy paste and run...
    *& Report  ZFI_TEST                                                    *
    REPORT ZFI_ICON_TEST MESSAGE-ID zz .
    *& TABLES DECLARATION *
    TABLES: vbak.
    *& TYPE POOLS DECLARATION *
    TYPE-POOLS: slis.
    *& INTERNAL TABLE DECLARATION *
    DATA: BEGIN OF itab OCCURS 0,
    icon TYPE icon-id,                 "itab-icon = '@08@' -> Green ;     '@09@' -> Yellow ;     '@0A@' -> Red
    vbeln LIKE vbak-vbeln,
    audat LIKE vbak-audat,
    vbtyp LIKE vbak-vbtyp,
    auart LIKE vbak-auart,
    augru LIKE vbak-augru,
    netwr LIKE vbak-netwr,
    waerk LIKE vbak-waerk,
    END OF itab.
    *INTERNAL TABLE FOR FIELD CATALOG
    DATA: wa_fieldcat TYPE slis_fieldcat_alv,
    it_fieldcat TYPE slis_t_fieldcat_alv.
    IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV
    WITH HEADER LINE,
    *INTERNAL TABLE FOR EVENTS
    DATA: it_event TYPE slis_t_event,
    wa_event TYPE slis_alv_event,
    *INTERNAL TABLE FOR SORTING
    it_sort TYPE slis_t_sortinfo_alv,
    wa_sort TYPE slis_sortinfo_alv,
    *INTERNAL TABLE FOR LAYOUT
    wa_layout TYPE slis_layout_alv.
    *& VARIABLE DECLARATION *
    DATA : v_repid TYPE sy-repid,
    v_pagno(4) TYPE n,
    v_date(8) TYPE c.
    *& CONSTANTS *
    CONSTANTS: c_x TYPE c VALUE 'X'.
    *& SELECTION SCREEN *
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,
    s_vbtyp FOR vbak-vbtyp DEFAULT 'C'.
    SELECTION-SCREEN: END OF BLOCK b1.
    SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    SELECTION-SCREEN : BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(20) text-003.
    PARAMETERS: p_list RADIOBUTTON GROUP rad1 DEFAULT 'X'.
    SELECTION-SCREEN : END OF LINE.
    SELECTION-SCREEN : BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(20) text-004.
    PARAMETERS: p_grid RADIOBUTTON GROUP rad1.
    SELECTION-SCREEN : END OF LINE.
    SELECTION-SCREEN: END OF BLOCK b2.
    AT SELECTION-SCREEN.
      PERFORM validate_screen.
    *& START OF SELECTION *
    START-OF-SELECTION.
      CLEAR: itab, itab[].
    V_REPID = SY-REPID.
      PERFORM get_data.
      PERFORM display_data.
    *& END OF SELECTION *
    END-OF-SELECTION.
    *--DO ALV Process
      v_repid = sy-repid.
    *--Sort the Output Fields
      PERFORM sort_fields.
    *--Build Field catalog for the Output fields
    PERFORM BUILD_FIELDCAT.
    *--Set the Layout for ALV
      PERFORM set_layout.
    *& Form GET_DATA
    text
    TO GET THE DATA FROM TABLES INTO ITAB
    FORM get_data .
      SELECT vbeln
      audat
      vbtyp
      auart
      augru
      netwr
      waerk
      INTO CORRESPONDING FIELDS OF TABLE itab
      FROM vbak
      WHERE vbeln IN s_vbeln AND
      audat > '04.04.2005'
      AND netwr > 0.
      LOOP AT itab.
        IF itab-netwr < 10000.
          itab-icon = '@08@'.
        ELSEIF itab-netwr > 10000 AND itab-netwr < 100000.
          itab-icon = '@09@'.
        ELSEIF itab-netwr > 100000.
          itab-icon = '@0A@'.
        ENDIF.
        MODIFY itab INDEX sy-tabix.
      ENDLOOP.
    ENDFORM. " GET_DATA
    *& Form sort_fields
    FORM sort_fields .
      CLEAR wa_sort.
      wa_sort-fieldname = 'VBTYP'.
      wa_sort-spos = '1'.
      wa_sort-up = 'X'.
      APPEND wa_sort TO it_sort.
      CLEAR wa_sort.
      wa_sort-fieldname = 'NETWR'.
      wa_sort-spos = '2'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO it_sort.
    ENDFORM. " sort_fields
    *& Form set_layout
    FORM set_layout .
      IF p_list = c_x .
        wa_layout-window_titlebar = 'LIST DISPLAY'(016).
        wa_layout-zebra = 'X'.
    *-- ALV LIST DISPLAY
        PERFORM list_display TABLES itab.
    *-- ALV GRID DISPLAY
      ELSEIF p_grid = c_x.
        wa_layout-window_titlebar = 'GRID DISPLAY'(017).
        wa_layout-zebra = 'X'.
        PERFORM grid_display TABLES itab.
      ENDIF.
    ENDFORM. " set_layout
    *& Form list_display
    FORM list_display TABLES p_itab .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = v_repid
          is_layout          = wa_layout
          it_fieldcat        = it_fieldcat[]
          it_sort            = it_sort[]
          i_save             = 'U'
        TABLES
          t_outtab           = itab
        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_display
    *& Form GRID_DISPLAY
    FORM grid_display TABLES p_itab .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = v_repid
          is_layout          = wa_layout
          it_fieldcat        = it_fieldcat[]
          it_sort            = it_sort[]
          it_events          = it_event
        TABLES
          t_outtab           = itab
        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_DISPLAY
    *& Form VALIDATE_SCREEN
    text
    --> p1 text
    <-- p2 text
    FORM validate_screen .
      DATA: lv_vbeln LIKE vbak-vbeln.
      IF NOT s_vbeln IS INITIAL.
        SELECT vbeln
        INTO lv_vbeln
        UP TO 1 ROWS
        FROM vbak
        WHERE vbeln IN s_vbeln.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e000 WITH 'INVALID SALES DOC'.
        ENDIF.
      ENDIF.
    ENDFORM. " VALIDATE_SCREEN
    *& Form display_data
    text
    --> p1 text
    <-- p2 text
    FORM display_data .
      DEFINE m_fieldcat.
        add 1 to wa_fieldcat-col_pos.
        wa_fieldcat-fieldname = &1.
        wa_fieldcat-ref_tabname = 'VBAK'.
        wa_fieldcat-do_sum = &2.
        wa_fieldcat-cfieldname = &3.
        append wa_fieldcat to it_fieldcat.
      END-OF-DEFINITION.
      DATA:
      ls_fieldcat TYPE slis_fieldcat_alv,
      lt_fieldcat TYPE slis_t_fieldcat_alv.
      m_fieldcat 'ICON' '' ''.
      m_fieldcat 'VBELN' '' ''.
      m_fieldcat 'AUDAT' '' ''.
      m_fieldcat 'VBTYP' '' ''.
      m_fieldcat 'AUART' '' ''.
      m_fieldcat 'AUGRU' '' ''.
      m_fieldcat 'NETWR' 'C' 'WAERK'.
      m_fieldcat 'WAERK' '' ''.
    ENDFORM. " display_data[/code]

  • Can we display ICONS in ALV list?

    Hi,
       Is it possible to display icons (ICON_GREEN_LIGHT) in the ALV list using the function module REUSE_ALV_LIST_DISPLAY.
       Is there any possibility of displaying a list using object oriented ALV?
    Thanks and Regards,
    Lakshmi.

    Hi Lakshmi,
    Just check this once.
    REPORT  Zxxx  MESSAGE-ID ZZ                       .
    *& TABLES DECLARATION                                                  *
    TABLES: VBAK.
    *& TYPE POOLS DECLARATION                                              *
    TYPE-POOLS: SLIS.
    *& INTERNAL TABLE DECLARATION                                          *
    DATA: BEGIN OF ITAB OCCURS 0,
           ICON TYPE ICON-ID,
           VBELN LIKE VBAK-VBELN,
           AUDAT LIKE VBAK-AUDAT,
           VBTYP LIKE VBAK-VBTYP,
           AUART LIKE VBAK-AUART,
           AUGRU LIKE VBAK-AUGRU,
           NETWR LIKE VBAK-NETWR,
           WAERK LIKE VBAK-WAERK,
        END OF ITAB.
    *INTERNAL TABLE FOR FIELD CATALOG
    DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
        IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV
               WITH HEADER LINE,
    *INTERNAL TABLE FOR EVENTS
    DATA:    IT_EVENT TYPE SLIS_T_EVENT,
          WA_EVENT TYPE SLIS_ALV_EVENT,
    *INTERNAL TABLE FOR SORTING
          IT_SORT TYPE SLIS_T_SORTINFO_ALV,
          WA_SORT TYPE SLIS_SORTINFO_ALV,
    *INTERNAL TABLE FOR LAYOUT
          WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    *& VARIABLE DECLARATION                                                *
    DATA : V_REPID TYPE SY-REPID,
           V_PAGNO(4) TYPE N,
           V_DATE(8)  TYPE C.
    *& CONSTANTS                                                           *
    CONSTANTS: C_X TYPE C VALUE 'X'.
    *& SELECTION SCREEN                                                    *
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN,
                    S_VBTYP FOR VBAK-VBTYP DEFAULT 'C'.
    SELECTION-SCREEN: END OF BLOCK B1.
    SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    SELECTION-SCREEN : BEGIN OF LINE.
    SELECTION-SCREEN  COMMENT 1(20) TEXT-003.
    PARAMETERS: P_LIST RADIOBUTTON GROUP RAD1 DEFAULT 'X'.
    SELECTION-SCREEN : END OF LINE.
    SELECTION-SCREEN : BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(20) TEXT-004.
    PARAMETERS: P_GRID RADIOBUTTON GROUP RAD1.
    SELECTION-SCREEN : END OF LINE.
    SELECTION-SCREEN: END OF BLOCK B2.
    AT SELECTION-SCREEN.
      PERFORM VALIDATE_SCREEN.
    *& START OF SELECTION                                               *
    START-OF-SELECTION.
      CLEAR: ITAB, ITAB[].
    V_REPID = SY-REPID.
      PERFORM GET_DATA.
      PERFORM DISPLAY_DATA.
    *& END OF SELECTION                                                    *
    END-OF-SELECTION.
    *--DO ALV Process
      V_REPID = SY-REPID.
    *--Sort the Output Fields
      PERFORM SORT_FIELDS.
    *--Build Field catalog for the Output fields
    PERFORM BUILD_FIELDCAT.
    *--Set the Layout for ALV
      PERFORM SET_LAYOUT.
    *&      Form  GET_DATA
          text
    TO GET THE DATA FROM TABLES INTO ITAB
    FORM GET_DATA .
      SELECT VBELN
             AUDAT
             VBTYP
             AUART
             AUGRU
             NETWR
             WAERK
             INTO CORRESPONDING FIELDS OF TABLE ITAB
             FROM VBAK
             WHERE VBELN IN S_VBELN AND
             AUDAT > '04.04.2005'
             AND NETWR > 0.
      LOOP AT ITAB.
        IF ITAB-NETWR < 10000.
          ITAB-ICON = '@08@'.
        ELSEIF ITAB-NETWR > 10000 AND ITAB-NETWR < 100000.
          ITAB-ICON = '@09@'.
        ELSEIF ITAB-NETWR > 100000.
          ITAB-ICON = '@0A@'.
        ENDIF.
        MODIFY ITAB INDEX SY-TABIX.
      ENDLOOP.
    ENDFORM.                    " GET_DATA
    *&      Form  sort_fields
    FORM SORT_FIELDS .
      CLEAR WA_SORT.
      WA_SORT-FIELDNAME = 'VBTYP'.
      WA_SORT-SPOS = '1'.
      WA_SORT-UP = 'X'.
      APPEND WA_SORT TO IT_SORT.
      CLEAR WA_SORT.
      WA_SORT-FIELDNAME = 'NETWR'.
      WA_SORT-SPOS = '2'.
      WA_SORT-UP = 'X'.
      WA_SORT-SUBTOT = 'X'.
      APPEND WA_SORT TO IT_SORT.
    ENDFORM.                    " sort_fields
    *&      Form  build_fieldcat
    *FORM BUILD_FIELDCAT .
    IT_FIELDCAT-COL_POS    = '1'.
    IT_FIELDCAT-FIELDNAME  = 'ICON'.
    IT_FIELDCAT-KEY        = 'X'.
    IT_FIELDCAT-OUTPUTLEN  = '10'.
    IT_FIELDCAT-SELTEXT_L  = 'LIGHT'.
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '2'.
    IT_FIELDCAT-FIELDNAME  = 'VBELN'.
    IT_FIELDCAT-KEY        = 'X'.
    IT_FIELDCAT-OUTPUTLEN  = '10'.
    IT_FIELDCAT-SELTEXT_L  = 'SALES DOC NUMBER'(009).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '3'.
    IT_FIELDCAT-FIELDNAME  = 'AUDAT'.
    IT_FIELDCAT-KEY        = 'X'.
    IT_FIELDCAT-OUTPUTLEN  = '4'.
    IT_FIELDCAT-SELTEXT_L  = 'DOCUMENT DATE'(010).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '4'.
    IT_FIELDCAT-FIELDNAME  = 'VBTYP'.
    IT_FIELDCAT-KEY        = 'X'.
    IT_FIELDCAT-OUTPUTLEN  = '4'.
    IT_FIELDCAT-SELTEXT_L  = 'CATEGORY'(011).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '5'.
    IT_FIELDCAT-FIELDNAME  = 'AUART'.
    IT_FIELDCAT-OUTPUTLEN  = '4'.
    IT_FIELDCAT-SELTEXT_L  = 'DOCUMENT TYPE'(012).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '6'.
    IT_FIELDCAT-FIELDNAME  = 'AUGRU'.
    IT_FIELDCAT-OUTPUTLEN  = '12'.
    IT_FIELDCAT-SELTEXT_L  = 'Order reason'(013).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '7'.
    IT_FIELDCAT-FIELDNAME  = 'NETWR'.
    IT_FIELDCAT-OUTPUTLEN  = '12'.
    IT_FIELDCAT-SELTEXT_L  = 'NET VALUE'(014).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    IT_FIELDCAT-COL_POS    = '8'.
    IT_FIELDCAT-FIELDNAME  = 'WAERK'.
    IT_FIELDCAT-OUTPUTLEN  = '12'.
    IT_FIELDCAT-SELTEXT_L  = 'SD DOC CURR'(015).
    APPEND IT_FIELDCAT.
    CLEAR  IT_FIELDCAT.
    *ENDFORM.                    " build_fieldcat
    *&      Form  set_layout
    FORM SET_LAYOUT .
      IF P_LIST = C_X .
        WA_LAYOUT-WINDOW_TITLEBAR = 'LIST DISPLAY'(016).
        WA_LAYOUT-ZEBRA = 'X'.
    *-- ALV LIST DISPLAY
        PERFORM LIST_DISPLAY TABLES ITAB.
    *-- ALV GRID DISPLAY
      ELSEIF P_GRID = C_X.
        WA_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'(017).
        WA_LAYOUT-ZEBRA = 'X'.
        PERFORM GRID_DISPLAY TABLES ITAB.
      ENDIF.
    ENDFORM.                    " set_layout
    *&      Form  list_display
    FORM LIST_DISPLAY  TABLES   P_ITAB .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM = V_REPID
          IS_LAYOUT          = WA_LAYOUT
          IT_FIELDCAT        = IT_FIELDCAT[]
          IT_SORT            = IT_SORT[]
          I_SAVE             = 'U'
        TABLES
          T_OUTTAB           = ITAB
        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_display
    *&      Form  GRID_DISPLAY
    FORM GRID_DISPLAY  TABLES   P_ITAB .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM = V_REPID
          IS_LAYOUT          = WA_LAYOUT
          IT_FIELDCAT        = IT_FIELDCAT[]
          IT_SORT            = IT_SORT[]
          IT_EVENTS          = IT_EVENT
        TABLES
          T_OUTTAB           = ITAB
        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_DISPLAY
    *&      Form  VALIDATE_SCREEN
          text
    -->  p1        text
    <--  p2        text
    FORM VALIDATE_SCREEN .
      DATA: LV_VBELN LIKE VBAK-VBELN.
      IF NOT S_VBELN IS INITIAL.
        SELECT VBELN
        INTO LV_VBELN
        UP TO 1 ROWS
        FROM VBAK
        WHERE VBELN IN S_VBELN.
        ENDSELECT.
        IF SY-SUBRC <> 0.
          MESSAGE E000 WITH 'INVALID SALES DOC'.
        ENDIF.
      ENDIF.
    ENDFORM.                    " VALIDATE_SCREEN
    *&      Form  display_data
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_DATA .
      DEFINE M_FIELDCAT.
        ADD 1 TO WA_FIELDCAT-COL_POS.
        WA_FIELDCAT-FIELDNAME   = &1.
        WA_FIELDCAT-REF_TABNAME = 'VBAK'.
        WA_FIELDCAT-DO_SUM      = &2.
        WA_FIELDCAT-CFIELDNAME  = &3.
        APPEND WA_FIELDCAT TO IT_FIELDCAT.
      END-OF-DEFINITION.
    DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
      m_fieldcat 'ICON' ''  ''.
      m_fieldcat 'VBELN' ''  ''.
      m_fieldcat 'AUDAT' ''  ''.
      m_fieldcat 'VBTYP' ''  ''.
      m_fieldcat 'AUART' ''  ''.
      m_fieldcat 'AUGRU' ''  ''.
      m_fieldcat 'NETWR' 'C' 'WAERK'.
      m_fieldcat 'WAERK' ''  ''.
    ENDFORM.                    " display_data
    hope it helps u
    regards
    laxmi

  • Display icons in ALV LVC grid

    Hi experts,
    Iam trying to display icons in one of the columns in my ALV grid.
    I have created ITAB like this.
    type-pools : icon,slis.
    data: begin of gt_dtl occurs 0,
          range(4).
            include structure zbitrdtl.
    data: field_style type lvc_t_styl.
    data: end of gt_dtl.
    And iam trying to pass ICON like this.
      loop at gt_dtl.
        gt_dtl-range = icon_green_light.
        modify gt_dtl.
      endloop.
    And passing into fieldcat.
      ls_fcat-fieldname = 'Range'.
      ls_fcat-tabname   = 'GT_DTL'.
      ls_fcat-scrtext_l  = 'Range'.
      ls_fcat-outputlen = '10'.
      ls_fcat-col_pos   = 8.
      ls_fcat-icon      = 'X'.
      append ls_fcat to gt_fieldcat.
      clear ls_fcat.
      call function 'LVC_FIELDCATALOG_MERGE'
        exporting
          i_buffer_active        = 'X'
          i_structure_name       = 'ZBITRDTL'
          i_client_never_display = 'X'
          i_internal_tabname     = 'GT_DTL'
        changing
          ct_fieldcat            = gt_fieldcat
        exceptions
          inconsistent_interface = 1
          program_error          = 2
          others                 = 3.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    <b>Iam able to see the ICON in the ITAB in debugging mode.</b>
    But iam not getting ICON in my output of ALV.
    where iam doing wrong?
    Rewared guaranteed,
    thanks
    kaki

    Hi...
    copy paste the following code. And check out hte variation.
    Hope this will be helpful
    Thank-You.
    vinsee
    REPORT  zrwty_wty_errors                        .
    TYPE
    TYPE-POOLS: slis, icon.
    Tables
    Tables : pnwtyh,
             balhdr.
    Data Decleration
    DATA: text(1000), lv_clmno(40).
    Internal table for messages ( Datewise )
    DATA: BEGIN OF it_balhdr OCCURS 0,
          lognumber TYPE balhdr-lognumber,
          log_handle TYPE  balhdr-log_handle,
          END OF it_balhdr.
    Internal table for PNWTYH
    DATA: BEGIN OF it_pnwtyh OCCURS 0,
          clmno TYPE pnwtyh-clmno,
          log_message TYPE pnwtyh-log_message,
          END OF it_pnwtyh.
    Internal table to fetch the actual text messages
    DATA: it_message LIKE balm OCCURS 0 WITH HEADER LINE.
    Internal Table to handle the ALV o/p
    DATA: BEGIN OF it_grid OCCURS 0,
          clmno TYPE pnwtyh-clmno,
          chgdat TYPE dats,
          icon TYPE icon-id," BALIMSGTY
          text(1000),
          END OF it_grid.
    Field Catelog and layout Decleration
    DATA: it_fieldcat  TYPE lvc_t_fcat,
          wa_fieldcat TYPE lvc_s_fcat OCCURS 0 WITH HEADER LINE,
          x_fieldcat TYPE lvc_s_fcat OCCURS 0 WITH HEADER LINE.
    DATA: x_layout TYPE lvc_s_layo.
    DATA: lv_repid LIKE sy-repid.
    have hotspot for a PO.
    DATA: s_fieldcat LIKE LINE OF it_fieldcat.
    s_fieldcat-hotspot = 'X'.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
    SELECT-OPTIONS:
      s_aldate FOR balhdr-aldate.
        SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
    PARAMETERS : r1 RADIOBUTTON GROUP rg DEFAULT 'X'.
    PARAMETERS : r2 RADIOBUTTON GROUP rg .
      SELECTION-SCREEN END OF BLOCK b2.
      if s_aldate-high = '00000000'.
      s_aldate-high = s_aldate-low.
      endif.
    FM to fetcht he messg no. based on date
    CALL FUNCTION 'APPL_LOG_READ_DB'
    EXPORTING
       object                   = 'WTY'
       subobject                = 'CLAIMMSG'
        EXTERNAL_NUMBER          = ' '
       date_from                = s_aldate-low
       date_to                  = s_aldate-high
         TIME_FROM                = '000000'
         TIME_TO                  = '240000'
         log_class                = '1'
        PROGRAM_NAME             = '*'
        TRANSACTION_CODE         = '*'
        USER_ID                  = ' '
        MODE                     = '+'
        PUT_INTO_MEMORY          = ' '
      IMPORTING
        NUMBER_OF_LOGS           =
    TABLES
        HEADER_DATA              =
        HEADER_PARAMETERS        =
       messages                 = it_message
        MESSAGE_PARAMETERS       =
        CONTEXTS                 =
    data: zlines type i.
    describe table it_message lines zlines.
    if it_message[] is initial.
    message S398(00) with 'No data found.'.
    exit.
    endif.
    IF radio button ERROR only is selected, Delete others
    IF r2 = 'X'          .
      DELETE it_message WHERE msgty <> 'E'.
    ENDIF.
    fetch log_handle from BALHDR
    SELECT lognumber log_handle FROM balhdr INTO TABLE it_balhdr FOR ALL
    ENTRIES IN
    it_message WHERE lognumber = it_message-lognumber.
    Based on log _handle fetch claim no from PNWTYH
    SELECT DISTINCT clmno log_message FROM pnwtyh INTO TABLE it_pnwtyh FOR
    ALL ENTRIES IN it_balhdr WHERE log_message = it_balhdr-log_handle.
    LOOP AT it_message.
      READ TABLE it_balhdr WITH KEY lognumber = it_message-lognumber.
      IF sy-subrc = 0.
        READ TABLE it_pnwtyh WITH KEY log_message = it_balhdr-log_handle.
        IF sy-subrc = 0.
          lv_clmno = it_pnwtyh-clmno.
        ENDIF.
    FM to fetch the actual text message
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = it_message-msgid
            lang      = 'EN'
            no        = it_message-msgno
            v1        = it_message-msgv1
            v2        = it_message-msgv2
            v3        = it_message-msgv3
            v4        = it_message-msgv4
          IMPORTING
            msg       = text
          EXCEPTIONS
            not_found = 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.
        it_grid-clmno = lv_clmno.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            input  = it_grid-clmno
          IMPORTING
            output = it_grid-clmno.
    Local Variable to handle Date Data
        DATA: l_tmstp(30) TYPE c,
        l_date TYPE sydatum.
        WRITE it_message-time_stmp TO l_tmstp LEFT-JUSTIFIED DECIMALS 0
        NO-GROUPING.
        l_date = l_tmstp(8).
        it_grid-chgdat = l_date.
        it_grid-text = text.
        IF  it_message-msgty = 'E'.
          it_grid-icon = '@0A@'.
        ELSEIF it_message-msgty <> 'E' AND it_message-msgty <> 'S'.
          it_grid-icon = '@09@'.
        ENDIF.
        APPEND it_grid.
        CLEAR it_grid.
        CLEAR: lv_clmno, it_message, text.
      ENDIF.
    ENDLOOP.
    PERFORM display_alv.
    *&      Form  display_alv
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv .
      PERFORM build_field_catalog.
      PERFORM build_layout.
    Assign program name to variable
      lv_repid = sy-repid.
    Call the ALV Grid FM for Display
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
          EXPORTING
            i_callback_program       = lv_repid
            i_grid_title             = 'Wty Errors'
            is_layout_lvc            = x_layout
            it_fieldcat_lvc          = it_fieldcat
            I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
          TABLES
            t_outtab                 = it_grid[]
          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
    *&      Form  build_field_catalog
          text
    -->  p1        text
    <--  p2        text
    FORM build_field_catalog .
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'ZWTY_ERR'
          i_bypassing_buffer     = 'X'
        CHANGING
          ct_fieldcat            = it_fieldcat[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    wa_fieldcat-col_pos = 1.
    wa_fieldcat-fieldname = 'ICON'.
    wa_fieldcat-seltext_l = 'Mssg Type'.
      wa_fieldcat-seltext = 'Mssg Type'.
      wa_fieldcat-icon = 'X'.
      wa_fieldcat-SCRTEXT_L = 'Mssg Type'.
    wa_fieldcat-outputlen = 8.
    wa_fieldcat-tabname = 'IT_GRID'.
    APPEND wa_fieldcat TO it_fieldcat.
    MODIFY it_fieldcat FROM wa_fieldcat TRANSPORTING seltext_l WHERE
    fieldname = 'ICON' .
    CLEAR wa_fieldcat.
      MODIFY it_fieldcat FROM wa_fieldcat TRANSPORTING seltext icon
    SCRTEXT_L
    WHERE
      fieldname = 'ICON' .
      CLEAR wa_fieldcat.
    wa_fieldcat-col_pos = 2.
    wa_fieldcat-fieldname = 'CHGDAT'.
    wa_fieldcat-seltext_l = 'Chg Date'.
      wa_fieldcat-seltext = 'Chg Date'.
        wa_fieldcat-SCRTEXT_L = 'Chg Date'.
    wa_fieldcat-outputlen = 10.
    wa_fieldcat-tabname = 'IT_GRID'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    MODIFY it_fieldcat FROM wa_fieldcat TRANSPORTING seltext_l WHERE
    fieldname = 'CHGDAT' .
    CLEAR wa_fieldcat.
    MODIFY it_fieldcat FROM wa_fieldcat TRANSPORTING seltext SCRTEXT_L
    WHERE
      fieldname = 'CHGDAT' .
      CLEAR wa_fieldcat.
    wa_fieldcat-col_pos = 4.
    wa_fieldcat-fieldname = 'TEXT'.
    wa_fieldcat-seltext_l = 'Message Text'.
      wa_fieldcat-seltext = 'Message Text'.
          wa_fieldcat-SCRTEXT_L = 'Chg Date'.
    wa_fieldcat-outputlen = 100.
    wa_fieldcat-tabname = 'IT_GRID'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    *MODIFY it_fieldcat FROM wa_fieldcat TRANSPORTING seltext_l WHERE
    fieldname = 'TEXT'.
    CLEAR wa_fieldcat.
    MODIFY it_fieldcat FROM wa_fieldcat TRANSPORTING seltext SCRTEXT_L WHERE
      fieldname = 'TEXT'.
      CLEAR wa_fieldcat.
      MODIFY it_fieldcat FROM s_fieldcat TRANSPORTING hotspot
      WHERE fieldname = 'CLMNO'.
    ENDFORM.                    " build_field_catalog
    *&      Form  Build_layout
          text
    -->  p1        text
    <--  p2        text
    FORM build_layout .
      CLEAR x_layout.
    x_layout-colwidth_optimize = 'X'.
    x_layout-zebra = 'X'.
    ENDFORM.                    " Build_layout
    FORM display_detail *
    --> UCOMM *
    --> SELFIELD *
    FORM user_command USING ucomm LIKE sy-ucomm
    selfield TYPE slis_selfield.
      IF ucomm = '&IC1'.
        READ TABLE it_grid INDEX selfield-tabindex.
        IF sy-subrc EQ 0.
    CALL 'WTY' FOR SELECTED CLAIM
          CALL FUNCTION 'ZWTY_CLAIM_DISPLAY'
            EXPORTING
              i_clmno          = it_grid-clmno
              iv_from_doc      = 'J'
            EXCEPTIONS
              not_found        = 1
              authority_failed = 2
              no_claimtype     = 3
              OTHERS           = 4.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    "user_command

  • Problems with applet for displaying desktop app's output

    I inherited a desktop C++ (VC6) application that uses the user's web browser for output. When the system first wants to display output it writes a temporary html file, fires up the web browser with an html page with an applet that opens a socket that listens for messages on a particular port. The C++ app then sends the temp file name through the socket for the applet to display. When new output comes along the new file name gets sent through the socket and the applet updates the web page (so all of this work is just so that you don't get a new web page for each output). It uses a similar mechanism to display help (sending the relevant section number through the socket). The relevant Java looks something like this:
         m_serverSocket = new ServerSocket(m_theApp.m_port);
    and then later
         clientSocket = m_serverSocket.accept();
    Recently the Sun decided that connecting to localhost is a security risk (see http://sunsolve.sun.com/search/document.do?assetkey=1-66-246387-1), so that this accept() now throws a security exception. I'm trying to fix this but I'm not getting anywhere. Here are the things I've tried and decided doesn't work (feel free to point out mistakes or misunderstandings on my side, I'm a noob at java):
    1) I changed the C:\Program Files\Java\jre6\lib\security\java.policy file to add "accpet" for localhost:
              permission java.net.SocketPermission "localhost:1024-", "listen,accept";
    this works, but I can't use this because a) it isn't safe, b) we don't want users to have to change their java.policy files and obviously the installer can't do it
    for them.
    2) I don't want to sign the applet because this will be really confusing to users (why should they be asked to trust anything from a desktop app that doesn't even do
    anything over the net?)
    3) I've tried passing a command line parameter to the applet in order for it to use an "application" specific policy file, but it seems that an applet can't take
    the -Djava.security.policy command line parameter.
    4) I've read that unsigned applets can (only) open sockets back to the server from which it was loaded, but I'm not using a webserver so there is no server URL (and
    localhost doesn't work).
    I'm out of ideas but would love to hear some!
    Paul

    Pay $150 or so to get your certificate signed by one of the major Certification Authorities. Signing your Jar will then stop the user being asked if he trusts the signer.

  • During update my ATV2 displayed icon to connect to iTunes. Now I have nothing -- can't even get to menu to do restart and ATV2 doesn't show up in iTunes menu to do restart from there. Help!

    During update my ATV2 displayed icon to connect to iTunes. Now I have nothing -- can't even get to menu to do restart and ATV2 doesn't show up in iTunes menu to do restart from there. Help!

    The update didn't apply correctly.
    Did you follow the steps exactly in order to restore? disconnect all cables, open iTunes, then connect micro usb
    Apple TV (2nd and 3rd generation): Restoring your Apple TV
    Make sure to connect directly to computer, not a keyboard port or USB hub. Try a different cable.

  • Display Icon/Image instead of Role name in top level navigation

    Hi,
    I want to display a image / icon instead of role name for a particular role. Can you please tell me how to achieve this ?
    Thanks,
    VP

    Hi,
    the thread is just for the background image (for all elements).
    if you want to display icons instead of role names, you have to create your custom top level navigation using the
    navigation taglib from SAP. There are lots of examples. make a blog search for Mr "Kannengiesser" from SAP.
    In case you are using already an EHPx in your EP 7.0 the AJAX framework might have this feature.
    Regards,
    Kai

  • Itunes on Windows 7 only displaying icons and pics? Text has disappeared?

    Itunes on Windows 7 only displaying icons and pics? Text has disappeared? Library content is still there but all text details now missing

    Same problem here!  Driving me nuts that it is somehow "running" as shown in the task bar, but it is not accessible in any way.

Maybe you are looking for