Image in ALV

hi,
I want to display images ( own photos) dynamically in ALV WDYnot in a table...
How can i do that?
Kindly help me to come out from this scenariao
Thanks in Advance...
Vimal raj

HI
Store the image in the mime repository of the web dynpro component.
add one more attibute to the mode which is bound to the mapped to the data node of ALV comp.
type string.
then fill the mode again with this attirbute having the URL for the mime image object.
here is the sample code for that.
DATA lt_zdealer TYPE wd_this->Elements_zdealer.
  DATA ls_zdealer LIKE LINE OF lt_zdealer.
  data indx type i.
** @TODO compute values
** e.g. call a data providing FuBa
  data url type string.
  url = '/SAP/BC/WebDynpro/SAP/ZSSG_FEB_EXPL4/'.
  DATA URL1 TYPE STRING.
  loop at lt_zdealer into ls_zdealer.
   indx = sy-tabix mod 3.
   if indx eq 0.
     CONCATENATE URL 'Blue hills.jpg' INTO URL1.
    ls_zdealer-Imageurl = URL1.
    elseif indx eq 1.
       CONCATENATE URL 'Sunset.jpg' INTO URL1.
    ls_zdealer-imageurl  = URL1.
    else.
        CONCATENATE URL 'Winter.jpg' INTO URL1.
      ls_zdealer-imageurl  = URL1.
      endif.
       url1 = ''.
      modify lt_zdealer from ls_zdealer.
    endloop.
** bind all the elements
  node->bind_table(
    new_items            =  lt_zdealer
    set_initial_elements = abap_true ).
then go to the place where you are producing the alv.
if it is opening in the intitial screen itself, then get the model of the ALV and change the editor and set it to image and set the
source of this editor to that attribute.
here is the sample code.
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(
data col type ref to  CL_SALV_WD_COLUMN.
col = lo_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'IMAGEURL' ).
data image type ref to cl_salv_wd_uie_image.
CREATE OBJECT image.
image->SET_SOURCE_FIELDNAME( 'IMAGEURL' ).
COL->SET_CELL_EDITOR( image  ).
thanks
sarbjeet singh

Similar Messages

  • WD4A : Displaying images in ALV table

    Hi,
    Does anyone know how to display images in ALV tables in Webdynpro?

    Hello,
    You can define an attribute in the context with the type CHAR 30 and define it value like an icon from WDA (like ~Icon/GreenLed). And then you need to create an method to define the attributes of the column that will have the image like follows:
    METHOD display_alv .
      DATA: lr_alv_usage       TYPE REF TO   if_wd_component_usage,
            lr_config          TYPE REF TO   cl_salv_wd_config_table,
            lr_col_header      TYPE REF TO   cl_salv_wd_column_header,
            lr_function_wd     TYPE REF TO   cl_salv_wd_function,
            lr_button          TYPE REF TO   cl_salv_wd_fe_button,
            lr_image           TYPE REF TO   cl_salv_wd_uie_image,
            lr_header          TYPE REF TO   cl_salv_wd_header,
            lr_uie_link        TYPE REF TO   cl_salv_wd_uie_link_to_action,
            lr_if_controller   TYPE REF TO   iwci_salv_wd_table,
            lr_function_set    TYPE REF TO   if_salv_wd_function_settings,
            lr_table_settings  TYPE REF TO   if_salv_wd_table_settings,
            lr_column_settings TYPE REF TO   if_salv_wd_column_settings.
      DATA: lt_columns         TYPE          salv_wd_t_column_ref,
            ls_column          TYPE          salv_wd_s_column_ref,
            lv_text            TYPE          string.
    * Instantiate ALV Component
      lr_alv_usage = wd_this->wd_cpuse_all_alv( ).
      IF lr_alv_usage->has_active_component( ) IS INITIAL.
        lr_alv_usage->create_component( ).
      ENDIF.
    * get reference to model
      lr_if_controller = wd_this->wd_cpifc_all_alv( ).
      lr_config        = lr_if_controller->get_model( ).
    * modify visible rows
      lr_config->if_salv_wd_table_settings~set_visible_row_count( iv_rows ).
      lr_config->if_salv_wd_table_settings~set_selection_mode(
                                           wd_assist->co_alv_selmode ).
    * create function
      lr_function_set ?= lr_config.
      lr_function_wd = lr_function_set->create_function(
                       wd_assist->co_func_det_nfe ).
      CREATE OBJECT lr_button.
    *read text
      lv_text = wd_assist->read_text( iv_key = '002' ).
      lr_button->set_text( lv_text ).
      lv_text = wd_assist->read_text( iv_key = '001' ).
      lr_button->set_tooltip( lv_text ).
      lr_button->set_image_source( wd_assist->co_icon_seldet ).
      lr_function_wd->set_editor( lr_button ).
    * set table header
      lr_table_settings ?= lr_config.
      lr_header = lr_table_settings->get_header( ).
      lv_text = wd_assist->read_text( iv_key = '003' ).
      lr_header->set_text( lv_text ).
      lv_text = wd_assist->read_text( iv_key = '004' ).
      lr_header->set_tooltip( lv_text ).
      lr_header->set_image_source( wd_assist->co_icon_list ).
      lr_column_settings ?= lr_config.
      lt_columns = lr_column_settings->get_columns( ).
      LOOP AT lt_columns INTO ls_column.
        CASE ls_column-id.
          WHEN 'ICON'.
            CREATE OBJECT lr_image.
            lr_image->set_source_fieldname( ls_column-id ).
            lr_image->set_tooltip_fieldname( 'ICON_TOOLTIP' ).
            ls_column-r_column->set_cell_editor( lr_image ).
          WHEN 'ID'.
            CREATE OBJECT lr_uie_link.
            lr_uie_link->set_text_fieldname( ls_column-id ).
            ls_column-r_column->set_cell_editor( lr_uie_link ).
          WHEN 'ICON_TOOLTIP' or 'LOGSYS'.
            ls_column-r_column->set_visible(
                               cl_wd_uielement=>e_visible-none ).
        ENDCASE.
    *set header binding of medium description, otherwise title
        lr_col_header = ls_column-r_column->get_header( ).
        lr_col_header->set_ddic_binding_field(
                            if_salv_wd_c_column_settings=>ddic_bind_medium ).
      ENDLOOP.
    ENDMETHOD.
    Here will be showed an icon (column ICON) and an link (column ID).
    Regards,

  • Show image in ALV

    HI,
    is it possible to show a picture (image) in ALV ?
    Regards,
    Gordon

    hi
    Check this blog to show image in ALV table:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1190424a-0801-0010-84b5-ef03fd2d33d9
    regards
    Satish

  • Display Image in ALV

    Hi Gurus,
      Am developing ALV report using OOPS. In that i have to insert company logo. By using the below code it is coming good
    CREATE OBJECT CONTAINER
         EXPORTING
          CONTAINER_NAME = 'PICTURE'.
       CREATE OBJECT PIC
         EXPORTING
          PARENT = CONTAINER.
       CALL METHOD pic->set_display_mode
         EXPORTING
           display_mode = CL_GUI_PICTURE=>DISPLAY_MODE_FIT_CENTER
        EXCEPTIONS
          ERROR        = 1
          others       = 2
    CALL METHOD pic->load_picture_from_url
      EXPORTING
        url    = 'file://D:\kk.GIF'
    IMPORTING
       RESULT =
    EXCEPTIONS
       ERROR  = 1
       others = 2
    But here am hardcoding the url of the logo. Instead of that upload the image into SAP and how to insert that logo in that screen? Can anyone give me suggestions regarding this.
    Points will be awarded
    Thanks
    Ravi

    Hi
    In the transaction OAOR, you should be able to insert your company Logo.
    GOTO - OAOR (Business Document Navigator)
    Give Class Name - PICTURES Class Type - OT..... then Execute
    It will show you the list, then select ENJOYSAP_LOGO.
    On that list, you will find one control with a "create" tab.
    Click std. doc types.
    Select SCREEN and double-click.
    It will push FILE selection screen.
    Select your company logo (.gif) and press OK.
    It will ask for a description- for instance: "company logo".
    It will let you know your doc has been stored successfully.
    You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
    Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
    FORM TOP-OF-PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = HEADING[]
    I_LOGO = 'ENJOYSAP_LOGO'
    I_END_OF_LIST_GRID ='GT_LIST_TOP_OF_PAGE'.
    ENDFORM. "TOP-OF-PAGE
    Here 'ENJOYSAP_LOGO' will replace by ur created logo.
    Refer this link
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm
    http://www.sap-img.com/abap/alv-logo.htm
    http://www.sap-img.com/fu002.htm
    Re: Logo on Login screen
    Re: To change image into main menu of sap
    Reward points for useful Answers
    Regards
    Anji

  • Bmp image in ALV report

    Hi,
              I upload two bmp images in se78. I maintained the image name  in zreport. Using select qry i fetch the name and i want to diaplay those images  one of the column in my alv report.
    Need Source Code for this.
    plz assist ,
    Thanks.
    Edited by: abap.m on May 1, 2010 12:16 PM

    Hai Kanwardeep Singh,
                Now i have some image in excel sheet i want to upload those images in r/3.
    Because of i'll go to create one alv report to display the images.
    For example:
    in material master they maintained the machine model number,machine name etc.
    Now their req is they need a report
    SeqNo                      Mch_ No                    Mch_Name                Mch_Img
    1                                100                                heat                           image
    2                                 200                              pump                           image
    .(In Mch_Img Column i need a image related to that particular machine how)
    Like that i need a report in alv
    Edited by: abap.m on May 1, 2010 1:26 PM

  • To Display Image in Alv Grid....

    Hello Gurus,
    I want to display an image/icon ( custom icon ) in the ALV grid.
    I know to display standard icons in ALV. But i dont know how to store custom icons in the system.
    I want to display an icon or image depending upon certain conditions. i need to display these images/icons for each row of the ALV grid.
    Please let me know if i can show images or icons ( not standard ) for each row in ALV grid.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 25, 2008 10:20 AM

    check out CL_GUI_PICTURE and the demo programs
    SAP_PICTURE_DEMO
    SAP_PICTURE_DEMO_ICON
    RSDEMO_PICTURE_CONTROL
    you can fit the picture in to the control with the following modes.
    DISPLAY_MODE_FIT
    other options
    DISPLAY_MODE_NORMAL
    DISPLAY_MODE_STRETCH
    DISPLAY_MODE_NORMAL_CENTER
    DISPLAY_MODE_FIT_CENTER
    Regards
    Raja

  • Display legend(as image) for ALV

    Hello experts,
    I have created ALV report in which it displays data in ALV grid. I want to display legend as image which explain output of the ALV grid. ie I want to display image below/under the ALV, which image gives information about outpout. (Legend)
    Any suggestions or helpful solutions ideas are appreciated.
    Thanks in advance...
    Regards,
    Viral Patel
    Edited by: Viral Patel on Jan 5, 2010 6:24 AM

    Hi Sandeep,
    Thanks for Your quick response.
    Could You please elaborate it how can I implement it in my code as I am new to ALV. There is one button in ALV display called 'Information(Ctrl+F12), when I press it will open browswer and display help on ALV. Is there any way to customize that button and get display legend?
    Thanks n Regards,
    Viral Patel
    Edited by: Viral Patel on Jan 5, 2010 6:42 AM

  • Checkbox,dropdown,image in ALV

    Hi Experts,
    I am working ALV table in Webdynpro ABAP.
    My client have a requirement like
    1] He want to display the check box for ist row accept and secon row reject and 4th coloumn link if you click that it will open the editor.7th coloumn inputfield and 8th image if you click that image then add two coloumns in the table below that cell.and 12h coloumn dropdown box the values coming from BAPI.and 18th image. like that........
    2] these above UI elemnts will be based on the record containe in the number.
    Example:1. if that BAPI gives the 3 records only three row will be appear these UI elements other rows are should be
    non- editable.
    2. If the BAPI giving 10 records only ten rows should appear these Ui elements.
    3] Some casess based on the condition also the UI elements should non-editable in ALV.
    Can you please give how to do this.Please help me these screen how to develop.time is very less.

    Hi,
    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 lv_value TYPE REF TO cl_salv_wd_config_table.
      lv_value = lo_interfacecontroller->get_model(
    DATA lt_columns type SALV_WD_T_COLUMN_REF.
    DATA ls_columns type SALV_WD_S_COLUMN_REF.
    lr_column type ref to CL_SALV_WD_COLUMN
      DATA:
        lr_input       TYPE REF TO cl_salv_wd_uie_input_field,
        lr_checkbox type ref to cl_salv_wd_uie_checkbox.
      CALL METHOD lv->if_salv_wd_column_settings~get_columns
        RECEIVING
          value = lt_columns.
       LOOP AT lt_columns INTO lis_columns.
          lv_id = ls_columns-id.
          lr_column = ls_columns-r_column.
    ***Column name
          CASE lv_id.
            WHEN 'CARRID'.
    create object lr_checkbox
    EXPORTING
    checked_fieldname = 'CARRID'.
    lr_checkbox->set_enabled( abap_true ).
    lr_column->set_cell_editor( lr_checkbox ).
            WHEN 'CONNID'.
                CREATE OBJECT lr_input
                  EXPORTING
                    value_fieldname = lv_id.
                CALL METHOD lr_column->set_cell_editor
                  EXPORTING
                    value = lr_input.
            WHEN 'FLDATE'.
           endcase.
        endloop.
    Regards,
    Lekha.

  • IMAGE IN ALV CELL

    Hi Guys,
    I have inserted image element as cell editor in alv column. But image is not coming. Check the below code and let me know where i did mistake.
         DATA: LR_IMG3 TYPE REF TO CL_SALV_WD_UIE_IMAGE.
        DATA: LO_COLUMN3 TYPE REF TO CL_SALV_WD_COLUMN.
        LO_COLUMN3 = LO_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'PINFO' ).
        CREATE OBJECT LR_IMG3.
        LR_IMG3->SET_SOURCE_FIELDNAME( 'PINFO' ).
       LR_IMG3->SET_HEIGHT_FIELDNAME( '20' ).
        LO_COLUMN3->SET_CELL_EDITOR( LR_IMG3 ).
    And what parameter i should pass to set_height_fieldname. ? I tried with 20px also, error saying 20px unknown.
    Regards
    Srinivas

    Hi Srinivas,
    Try this...
    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(    ).
    data col type ref to  CL_SALV_WD_COLUMN.
    col = lo_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'IMAGE' ).
    data image type ref to cl_salv_wd_uie_image.
    CREATE OBJECT image.
    image->SET_SOURCE_FIELDNAME( 'IMAGE' ).
    COL->SET_CELL_EDITOR( image  ).
    Cheers,
    Kris.

  • Images in ALV

    Hi cracks,
    has any one of you any idea if it is possible to insert an image (.pmp or .gif) in an ALV-list?
    The scanned images that I want to insert are stored in the content server.
    Tks in advance

    In the transaction OAOR, you should be able to insert your company Logo.
    GOTO - OAOR (Business Document Navigator)
    Give Class Name - PICTURES Class Type - OT..... then Execute
    It will show you the list, then select ENJOYSAP_LOGO.
    On that list, you will find one control with a "create" tab.
    Click std. doc types.
    Select SCREEN and double-click.
    It will push FILE selection screen.
    Select your company logo (.gif) and press OK.
    It will ask for a description- for instance: "company logo".
    It will let you know your doc has been stored successfully.
    You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
    Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
    FORM TOP-OF-PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = HEADING[]
    I_LOGO = 'ENJOYSAP_LOGO'
    I_END_OF_LIST_GRID ='GT_LIST_TOP_OF_PAGE'.
    ENDFORM. "TOP-OF-PAGE
    Here 'ENJOYSAP_LOGO' will replace by ur created logo.
    Refer this link
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm
    http://www.sap-img.com/abap/alv-logo.htm
    http://www.sap-img.com/fu002.htm
    Re: Logo on Login screen
    Re: To change image into main menu of sap
    Please give me reward point if it is useful.
    Thanks
    Murali Poli

  • Image in ALV table

    Hello All,
    I have a AVL table with some data in it, but one of the columns of the AVL table I want to put an image.
    Is that possible?
    How do I do that?
    Thanks & Regards,
    Chris Bogers

    Hi,
    It is possible to insert image.
    Refer the code below :
    DATA: lr_column TYPE REF TO cl_salv_wd_column,
    lr_image TYPE REF TO cl_salv_wd_uie_image,
    lv_icon TYPE string.
    lr_column = l_value->if_salv_wd_column_settings~get_column( 'STATUS' ).
    CREATE OBJECT lr_image.
    lr_image->SET_SOURCE_FIELDNAME( 'STATUS' ).
    lr_column->set_cell_editor( lr_image ).

  • Refer to MIME image in ALV Table

    Hello All,
    I know now how to refer to an image in the AVL Table.
    But I want to refer to the MIME image.
    The filename is not enough?
    Anyone an idea?
    Thanks & Regards,
    Chris Bogers

    Hi,
    1. Here you have to mention the URL where your mime objects are stored.
    data: mime_repository type ref to if_mr_api,
          content type xstring,
          mime_type type string,
          url type string value 'SAP/BC/WebDynpro/SAP/ZTREE/s.bmp'.
    mime_repository = cl_mime_repository_api=>get_api( ).
    call method mime_repository->get
    exporting i_url = url
    importing e_content = content  e_mime_type = mime_type.
    2. Finally you have the value in an XString which you can bind to the context attribute.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->element_context.
    * get element via lead selection
      lo_el_context = wd_context->get_element( ).
    * set single attribute
      lo_el_context->set_attribute(
        name =  `CONTENT`
        value = content ).
    Note : CONTENT is my context attribute binded to image UI.

  • How to display image on alv display screen

    Hi All,
    I am using "REUSE_ALV_GRID_DISPLAY" function module for display a simple report.
    I want to add a logo also on that output screen. Can anyone tell me how i can do that?
    Thanks and Regards,
    Nidhi Srivastava.

    Yes.
    But you have to paint the image after the native component has painted the text, to avoid the native component from erasing your image. Something like this should work.
    class MyTextField extends TextField implements Runnable
       public void paint(Graphics g)
          super.paint(g);
          new Thread(this).start();
       public void run()
          Thread.yield();
          Graphics g = getGraphics();
          g.drawImage(....)

  • Photos to be displayed in ALV

    Hi,
    I have to display n no. of photos in ALV.
    All photos are there in Archive.
    How to get those photos from Archive link and how to display it in a ALV.
    Plz help me to cameout from this issue.
    Thanks in Advance,
    Vimal

    Hi.
    Whatever content is there Content will be passed to Mime Repository.
    data: mime_repository type ref to if_mr_api,
    content type xstring.
    mime_repository = cl_mime_repository_api=>get_api( ).
    call method mime_repository->put( exporting i_url = 'SAP/BC/BSP/SAP/WEB_UTILITY' i_content = content ).
    To Store image in ALV.. please go through this..
    Image in ALV
    http://forums.sdn.sap.com/click.jspa?searchID=71174650&messageID=7867299
    Please go through this ..about upload photos.. it may helps
    What's the best place in MIME Rep. to store custom images for logon screen?
    Re: Employee Photo Display
    Cheers,
    Kris.
    Edited by: kissnas on Apr 1, 2011 6:29 AM

  • Image/Icon In Web dynpro ABAP

    Hello Experts,
    There is an icon which is shown in one of my ortal standard application. I want to show the same Icon in my Custom Web dynpro application. Is there any method to get the same Icon?
    Regards,
    Hema

    Hello Abhimanyu,
    Sorry forgot to mention earlier... that I have already tried this method..
    some how its not working.. it doesn't show any image in my explorer..
    basically I am showing this image in ALV column.. It was working with another image provided by sap but not the one which I import.
    Please provide more inputs..
    Regards,
    Hema

Maybe you are looking for

  • How can i control gif animations?

    I have a project in which i need some animations. The animations all have been created in After Effects. Now I can use the png sequences, but these are very big and i need a lot animations running on the same time. So i would rather use the gif anima

  • File Adapter using NFS

    Hi all I am using the NFS option in File adapter.The file is being placed in C:\TEMP folder and in the directory path i have specified ipaddress\TEMP but when i watch it in Adapter Monitoring it shows me a error C:\TEMP does not exist. Please suggest

  • PPT Presentation error when importing

    We have been getting an error "Could not open PPT file" for several PPT files when importing into Captivate 2. These files import into Captivate 1.0 perfectly. Also, for the few files we can get to import, all of the slides don't import. It usually i

  • Using Bootcamp: Windows 7 won't launch, goes to black screen.

    21.5-inch, Mid-2010 iMac, running OSX Mountain Lion, v. 10.8.2 I currently have Bootcamp running Windows 7, for some windows specific programs. Last night, while using windows, I was prompted to install some updates. One of which required a system re

  • Can't download Mountain Lion OS X from App Store Canada

    Wanting to upgrade from my stale Snow Leopard OS X 10.6.8, I purchased Mountain Lion online and received the email redeption code redeemed the purchase in Mac App Store - and nothing happened. No download, no resume download option, NOTHING. What is