cancel
Showing results for 
Search instead for 
Did you mean: 

Display Images in View

Former Member
0 Kudos

Dear All,

I have a requirement, where i have material, for every material i have one image. User has a option to select material based on material

i want to display image, around 450 images are there. this is my requirement.

My view is i want to create one ztable to store all images along with materials. is it possible to store images in ztable? Please suggest?

And how to fetch image based on user selection and display in webdynpro abap view? Please suggest.

Thanks,

Venkat.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi venkat,

Yea it is possible when u r uploading the material image we need the save material image as a materinal number ex:1234.img,45566.img like that we need to save the images.

SPLIT lv_filename AT ' /.' INTO  matnr var.

    cl_gui_frontend_services=>gui_upload(
       EXPORTING
         filename                = lv_filename    " Name of file
         filetype                = 'BIN'
       IMPORTING
         filelength              lv_length   " File length
       CHANGING
         data_tab                = lt_data    " Transfer table for file contents
       EXCEPTIONS
         OTHERS                  = 19 ).

    CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'

      EXPORTIN

        input_length = lv_length

      IMPORTING

        buffer       = lv_content

      TABLES

        binary_tab   = lt_data

wa_final-matnr = matnr.

wa_final-content = lv_content.

      APPEND wa_final TO it_final.

endloop.


data:

doc_type   TYPE toaom-ar_object,

c_sapobject TYPE saeanwdid VALUE 'PDOTYPE_MATNR'.

CALL FUNCTION 'ARCHIV_CREATE_TABLE'

            EXPORTING

            ar_object                      = doc_type

            object_id                      = matnr

            sap_object                     = c_sapobject

            doc_type                       = 'JPG'

            document                       = wa_final-content

            mandt                          = sy-mandt

if sy-subrc = 0.

endif.

Same first we need to upload the material with images using above function moudle.

If u want retrive the images

ARCHIV_GET_TABLE fm in that u can pass the MATNR an  get the image content

and convert to xstring.and bind to the webdynpro attribute.

Regards,

Murali I.