Image from DMS System

hi experts,
I have material image in my DMS system and i want to show images in my z report .Is there any functional module for that or what should i do ...
i have attached to a particular material i dont how to dispaly in a report
Help me Plz
regards,
karthik
Message was edited by:
        karthikeyan sukumar

Hey this is the solution.....
REPORT  zind_mat_disp_img.
Tables
TABLES : mara, makt, drad.
internal table
DATA : BEGIN OF w_material,
       matnr TYPE mara-matnr,
       prdha TYPE mara-prdha,
       maktx TYPE makt-maktx,
       img(18) TYPE c,
       END OF w_material.
DATA : i_material LIKE STANDARD TABLE OF w_material WITH HEADER LINE.
DATA : tabix TYPE i.
TYPE-POOLS AND FIELD CATALOG DECLARATION
TYPE-POOLS: slis.
To pass name of the report in function module for ALV
DATA: v_repid LIKE sy-repid .
Internal table to display top of page and build eventcat
DATA : logoevent TYPE slis_t_event, "FOR LOGO
       t_event TYPE slis_alv_event,
       i_listheader TYPE slis_t_listheader,
       test TYPE slis_listheader.
Table for catalog of the fields to be displayed
DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
DATA : x_fieldcat TYPE slis_fieldcat_alv.
*&     Document declaration for DMS
Document key
DATA: lf_doctype    LIKE bapi_doc_draw-documenttype,
       lf_docnumber  LIKE bapi_doc_draw-documentnumber,
       lf_docpart    LIKE bapi_doc_draw-documenttype,
       lf_docversion LIKE bapi_doc_draw-documentversion.
Bapi-Return structure
DATA : ls_return LIKE bapiret2.
Originals Document hierarchy
DATA: lt_files LIKE bapi_doc_files2 OCCURS 0 WITH HEADER LINE,
       ls_document LIKE bapi_doc_draw2.
*&      SELECTION-SCREEN
SELECTION-SCREEN : BEGIN OF BLOCK 001.
SELECT-OPTIONS : c_matnr FOR mara-matnr.
SELECTION-SCREEN : END OF BLOCK 001.
*&      INITIALIZATION
INITIALIZATION.
  v_repid = sy-repid.
*&      START-OF-SELECTION
START-OF-SELECTION.
  PERFORM 100_fetch_from_table.
  IF NOT i_material IS INITIAL.
    PERFORM 200_build_event USING logoevent.
    PERFORM 300_build_fieldcatalog.
    PERFORM 400_alv_grid_display.
  ENDIF.
*&      Form  100_fetch_from_table
    Fetch datas from table into internal table
FORM 100_fetch_from_table .
  SELECT amatnr aprdha b~maktx FROM mara AS a
            INNER JOIN makt AS b
        ON amatnr = bmatnr INTO CORRESPONDING FIELDS OF TABLE i_material
        WHERE a~matnr IN c_matnr.
  IF sy-subrc = 0.
    SORT i_material BY matnr.
    LOOP AT i_material.
      i_material-img = 'Display_Image'.
      MODIFY i_material TRANSPORTING img.
    ENDLOOP.
  ENDIF.
ENDFORM.                    " 100_fetch_from_table
*&      Form  200_build_event
Build Event
FORM 200_build_event USING p_logoevent TYPE slis_t_event.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
   IMPORTING
     et_events             = p_logoevent
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  READ TABLE p_logoevent WITH KEY name = slis_ev_top_of_page INTO t_event.
  IF sy-subrc = 0.
    MOVE 'TOP_OF_PAGE' TO t_event-form.
    MODIFY p_logoevent FROM t_event INDEX sy-tabix TRANSPORTING form.
  ENDIF.
ENDFORM.                    " 150_build_event
*&      Form  300_build_fieldcatalog
      Building field catalog for ALV display
FORM 300_build_fieldcatalog .
  x_fieldcat-col_pos = 1.
  x_fieldcat-outputlen = '18'.
  x_fieldcat-fieldname = 'MATNR'.
  x_fieldcat-tabname = 'I_MATERIAL'.
  x_fieldcat-seltext_m = 'Material'.
  x_fieldcat-key = 'X'.
  x_fieldcat-key_sel = 'X'.
  x_fieldcat-hotspot = space.
  x_fieldcat-fix_column = 'X'.
  APPEND x_fieldcat TO i_fieldcat.
  CLEAR x_fieldcat.
  x_fieldcat-col_pos = 2.
  x_fieldcat-outputlen = '40'.
  x_fieldcat-fieldname = 'MAKTX'.
  x_fieldcat-tabname = 'I_MATERIAL'.
  x_fieldcat-seltext_m = 'Material_Description'.
  x_fieldcat-hotspot = space.
  APPEND x_fieldcat TO i_fieldcat.
  CLEAR x_fieldcat.
  x_fieldcat-col_pos = 3.
  x_fieldcat-outputlen = '18'.
  x_fieldcat-fieldname = 'PRDHA'.
  x_fieldcat-tabname = 'I_MATERIAL'.
  x_fieldcat-seltext_m = 'Product Hierarchy'.
  x_fieldcat-hotspot = space.
  APPEND x_fieldcat TO i_fieldcat.
  CLEAR x_fieldcat.
  x_fieldcat-col_pos = 4.
  x_fieldcat-outputlen = '18'.
  x_fieldcat-fieldname = 'IMG'.
  x_fieldcat-tabname = 'I_MATERIAL'.
  x_fieldcat-seltext_m = 'Link to Disp Image'.
  x_fieldcat-hotspot = 'X'.
  x_fieldcat-key = 'X'.
  APPEND x_fieldcat TO i_fieldcat.
  CLEAR x_fieldcat.
ENDFORM.                    " 200_build_fieldcatalog
*&      Form  400_alv_list_display
    ALV List Display
FORM 400_alv_grid_display .
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
     i_callback_program                = v_repid
     i_callback_pf_status_set          = 'SET_PF_STATUS'
     i_callback_user_command           = 'USER_COMMAND'
     i_callback_top_of_page            = 'TOP_OF_PAGE'
     i_structure_name                  = 'I_MATERIAL'
    IS_LAYOUT                         = struct_layout
     it_fieldcat                       = i_fieldcat
     it_events                         = logoevent
   TABLES
      t_outtab                          = i_material
   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.                    " 300_alv_grid_display
      FORM TOP_OF_PAGE                                              *
FORM top_of_page.
  REFRESH i_listheader.
  DATA: t_header TYPE slis_listheader.
  DATA: v_text(50).
  WRITE sy-datum TO v_text.
  CLEAR t_header.
  t_header-typ = 'S'.
  t_header-key = 'Date'.
  t_header-info = v_text.
  APPEND t_header TO i_listheader.
  WRITE sy-repid TO v_text.
  CLEAR t_header.
  t_header-typ = 'S'.
  t_header-key = 'Program_Name'.
  t_header-info = v_text.
  APPEND t_header TO i_listheader.
  WRITE sy-uname TO v_text.
  CLEAR t_header.
  t_header-typ = 'S'.
  t_header-key = 'User'.
  t_header-info = v_text.
  APPEND t_header TO i_listheader.
  WRITE 'Materials_Display' TO v_text.
  CLEAR t_header.
  t_header-typ = 'S'.
  t_header-key = 'Details'.
  t_header-info = v_text.
  APPEND t_header TO i_listheader.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = i_listheader
      i_logo             = 'ENJOYSAP_LOGO'.
ENDFORM.                    "TOP_OF_PAGE
*& Form set_pf_status
Form used to set the Custom pf-status of the List Display
FORM set_pf_status USING i_rt_extab TYPE slis_t_extab.
  DATA : x_extab TYPE slis_extab.
  x_extab-fcode = '&LFO'.
  APPEND x_extab TO i_rt_extab.
  SET PF-STATUS 'ZSTANDARD' EXCLUDING i_rt_extab .
ENDFORM. "set_pf_status
*& Form user_command
Form used to handle USER_COMMAND events
FORM user_command USING rf_ucomm LIKE sy-ucomm
rs TYPE slis_selfield.
  tabix = rs-tabindex.
  CASE rf_ucomm.
  Ok code for double click is &IC1 for ALV report
    WHEN '&IC1'.
      PERFORM sub_disp_img.
  ENDCASE.
ENDFORM. "user_command
*&      Form  sub_disp_img
FORM sub_disp_img .
  PERFORM get_document.
  IF sy-subrc = 0.
    PERFORM wa_exeute.
  ENDIF.
ENDFORM.                    " sub_disp_img
*&      Form  get_document
      text
FORM get_document.
  IF tabix NE space.
    READ TABLE i_material INDEX tabix.
    IF sy-subrc = 0.
      SELECT SINGLE * INTO drad FROM drad
               WHERE objky = i_material-matnr.
      IF sy-subrc = 0.
     * Allocate document data
        lf_doctype    = drad-dokar.
        lf_docnumber  = drad-doknr.
        lf_docversion = drad-dokvr.
        lf_docpart    = drad-doktl.
        REFRESH lt_files.
        CLEAR lt_files.
    Set detail information for the document
        CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
EXPORTING: documenttype      = lf_doctype
            documentnumber    = lf_docnumber
            documentpart      = lf_docpart
            documentversion   = lf_docversion
            getobjectlinks    = 'X'
            getstatuslog      = 'X'
            getlongtexts      = 'X'
            getactivefiles    = 'X'
   IMPORTING:
            documentdata      = ls_document
            return            = ls_return
   TABLES:     documentfiles     = lt_files.
        IF ls_return-type CA 'EA'.
        MESSAGE ID '26' TYPE 'I' NUMBER '000'
                  WITH ls_return-message.
        ENDIF.
      ELSE.
        MESSAGE 'No Image Found' TYPE 'I'.
      ENDIF.
    ENDIF.
  ENDIF.
ENDFORM.                    " get_document
*&      Form  wa_exeute
      To display image from the path.
FORM wa_exeute .
  CALL FUNCTION 'WS_EXECUTE'
   EXPORTING
     inform                   = 'X'
     program                  = lt_files-docfile
   EXCEPTIONS
     frontend_error           = 1
     no_batch                 = 2
     prog_not_found           = 3
     illegal_option           = 4
     gui_refuse_execute       = 5
     OTHERS                   = 6
  IF sy-subrc <> 0.
    MESSAGE 'Image Path Invalid' TYPE 'W'.
  ENDIF.
ENDFORM.                    " wa_exeute

Similar Messages

  • How to read some images from file system with webdynpro for abap?

    Hi,experts,
    I want to finish webdynpro for abap program to read some photos from file system. I may make MIMES in the webdynpro component and create photos in the MIMES, but my boss doesn't agree with me using this way. He wish me read these photos from file system.
    How to read some images from file system with webdynpro for abap?
    Thanks a lot!

    Hello Tao,
    The parameter
       icm/HTTP/file_access_<xx>
    may help you to access the pictures without any db-access.
    The following two links may help you to understand the other possibilities as well.
    The threads are covering BSP, but it should be useful for WebDynpro as well.
    /people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    http://help.sap.com/saphelp_sm40/helpdata/de/c4/87153a1a5b4c2de10000000a114084/content.htm
    Best regards
    Christian

  • Problem in Image Display from DMS System

    Dear All ,
                         I have an issue . I am saving the Image from CV01N and i am attaching the same to the Material through Material Master and i have a path SAPR3://SAPR3CMS/get/200/DMS_5FC1/DE75271A542EB8F1AC8100215E54283E/FKSN101375RUN155XX.bmp which is stored in SAP Server . Can anybody help me out that how can i display the same path in Smartforms . Please help me out with the same if the Possible in Smartforms .
    Regards
    S.B.Shankar
    Edited by: Shankar  SB on Jul 21, 2009 4:41 AM

    Dear Shankar , check out the links .
    https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-ALVtodisplayimageusingDocumentManagement+System
    https://wiki.sdn.sap.com/wiki/display/ABAP/AssigningImageusingDocumentManagement+System
    regards,
    chinnaiya P
    Edited by: chinnaiya pandiyan on Jul 21, 2009 2:40 PM

  • Import data to Purchase Order Item Level Text from DMS system

    Hi,
    I have the material PO Text maintained against the Material in the DMS system.
    In R/3, when I am creating the Purchase Order, I want the system to retreive the PO Text maintained in DMS against the material in the Purchase Order and paste it in the Purchase Order Item details - Material PO Texts.
    Could anyone suggest me which User Exit or BAPI and the Function Module to fetch this data from DMS.
    Thanks in advance.
    Regards,
    Jeetendra

    Dear Gurus,
    We are able to populate the "Import Data" in the backend PO in our backend system 4.6C, thorugh user exit
    EXIT_SAPMM06E_004   &   EXIT_SAPLV50E_004.
    Now when we create PO from SRM , the import related foreign trade data gets filled up from the master data.
    Problem: In Header and Line item condition: We are not getting the condition type GRWR automatically, if the PO is comming from SRM. Because of this the statistical value is 0.
    ( If we create manual PO, the condition GRWR appears in PO - and the Statistical value gets filled in automatically )
    How can we put the condition type GRWR into the PO using user exit ?
    Thanks and regards,
    Anil Rajpal
    Edited by: ANIL on Aug 12, 2010 6:18 PM

  • How to load images from file system and save in database

    Hello Fellows!
    I have a problem and try to explain:
    Plateform:
    Operating System: Windows 98, Form 6i and Oracle 8
    Table in the database
    Table:Emp_pic with columns i.e. (empno and pic type long raw)
    In forms, I have a data block which contain the columns of the emp_pic table and a control block which have a push button contains the trigger as follow, also attach PL/SQL library i.e. D2kWUTIL.PLL
    When-Button-Pressed (Trigger)
    Declare
    temp varchar2(400);
    Begin
    temp := win_api_dialog.open_file('Open File','d:\pic','*.tif',true,win_api.ofn_flag_default,false);
    read_image_file(temp,'tif','emp_pic.pic');
    end;
    The problem when I pressed the button it does not display open dialog box what is the wrong with the code or else.
    Thanks in advance
    (BASIT)

    What do you mean "it did not work"? You need to post more information, such as what errors you got.
    My guess is that it did work, but it ran on the middle tier, which is where Forms is running. Commands like that need more work to execute on the client.
    Go to the Forms area on OTN and download the Oracle9i Forms Samples. They have demos and source code to move files from the client to the server.
    Coming soon will be a utility called WebUtil which will make this even easier.
    Regards,
    Robin Zimmermann
    Forms Product Management

  • Loading an external image (from file system) to fla library as MovieClip symbol.

    Hi everyone,
    I am new to actionscript and Flash.
    I have been working on code updation project wherein initially we had an image and text as movieclips in fla library. The image and the text are read by the actionscript program which then creates an animation.
    For Example:
    // Picture
    // _imageMC: Name of the Movie Clip in the libary which
    // contains the picture.
    var _imageMC:String = "polaroid";
    This is later on used by another actionscript class as follows to finally create the animation.
    var _mcPolaroid:MovieClip = this._mcBg.attachMovie(this._polaroid, "polaroid_mc", this._mcBg.getNextHighestDepth());
    Now the problem here is when one needs to update the image or text, one needs to go and open the fla file andmanually change the image attached to the movieClip (polaroid).
    I want to ease the updation process by giving the url of the image in an XML file. Read the image url from the xml and load this image in the library of the fla as movieclip. This, i think, will result in less code change and improve the updation of the final animation image.
    The problem i am facing is not been able to figure out how can i change the image (after fetching its URL) to a movieclip and then load it in the library?
    Thank you kindly in advance,
    Varun

    This is the AS3 forum and you are posting with regards to AS2 code.  Try posting in the AS2 forum...
    http://forums.adobe.com/community/flash/flash_actionscript
    As for the solution you seem to want.  You cannot dynamically add something to the library during runtime.  To add an image during runtime you would need to use the MovieClip.loadMovie() or MovieClipLoader.loadClip() methods.  You could have the movieclip pre-arranged in the library, but to add the image dynamically via xml information you need to load it into a movieclip, not the library.

  • Loading an external image (from file system) to fla library as MovieClip symbol using ActionScript.

    Hi everyone,
    I am new to actionscript and Flash.
    I have been working on code updation project wherein initially we had an image and text as movieclips in fla library. The image and the text are read by the actionscript program which then creates an animation.
    For Example:
    // Picture
    // _imageMC: Name of the Movie Clip in the libary which
    // contains the picture.
    var _imageMC:String = "polaroid";
    This is later on used by another actionscript class as follows to finally create the animation.
    var _mcPolaroid:MovieClip = this._mcBg.attachMovie(this._polaroid, "polaroid_mc", this._mcBg.getNextHighestDepth());
    Now the problem here is when one needs to update the image or text, one needs to go and open the fla file andmanually change the image attached to the movieClip (polaroid).
    I want to ease the updation process by giving the url of the image in an XML file. Read the image url from the xml and load this image in the library of the fla as movieclip. This, i think, will result in less code change and improve the updation of the final animation image.
    The problem i am facing is not been able to figure out how can i change the image (after fetching its URL) to a movieclip and then load it in the library?
    Thank you kindly in advance,
    Varun

    The following was my attempt: (i created a new MovieClip)
    this.createEmptyMovieClip("polaroidTest", this.getNextHighestDepth());
    loadMovie("imagefile.jpg", polaroidTest)
    var _imageMC:String = "polaroidTest";
    This mentioned variable _imageMC is read by a MovieClip class(self created as follows)
    /////////////////////////////// CODE STARTS //////////////////////////////////////
    class as.MovieClip.MovieClipPolaroid {
    private var _mcTarget:MovieClip;
    private var _polaroid:String;
    private var _mcBg:MovieClip;
    private var _rmcBg:MovieClip;
    private var _w:Number;
    private var _h:Number;
    private var _xPosition:Number;
    private var _yPosition:Number;
    private var _border:Number;
    * Constructor
        function MovieClipPolaroid(mcTarget:MovieClip, polaroid:String) {
    this._mcTarget = mcTarget;
    this._polaroid = polaroid;
    init();
    * initialise the polaroid movieclip and reflecting it
        private function init():Void {
    this._border = 10;
    this.initSize();
    this.setPosition(48,35);
    this.createBackground();
    var _mcPolaroid:MovieClip = this._mcBg.attachMovie(this._polaroid, "polaroid_mc", this._mcBg.getNextHighestDepth());
    _mcPolaroid._x = _border;
    _mcPolaroid._y = _border;
    var _rmcPolaroid:MovieClip=this._rmcBg.attachMovie(this._polaroid,"rpolaroid_mc", this._rmcBg.getNextHighestDepth());
    _rmcPolaroid._yscale *=-1;
    _rmcPolaroid._y = _rmcPolaroid._y + _h + _border ;
    _rmcPolaroid._x =_border;
    * create the background for the polaroid
    private function createBackground():Void {
    this._mcBg = _mcTarget.createEmptyMovieClip("target_mc",_mcTarget.getNextHighestDepth());
    this._rmcBg = _mcTarget.createEmptyMovieClip("rTarget_mc", _mcTarget.getNextHighestDepth());
    fill(_mcBg,_w+2*_border,_h+2*_border,100);
    fill(_rmcBg,_w+2*_border,_h+2*_border,10);
    placeBg(_mcBg,_w+2*_border,_yPosition);
    placeBg(_rmcBg,_w+2*_border,_h+2*_border+_yPosition);
    * position the background
    private function placeBg(mc:MovieClip,w:Number,h:Number) : Void {  
        mc._x = Stage.width - w - _xPosition;
    mc._y = h;
    * paint the backgound
    private function fill(mc:MovieClip,w:Number,h:Number, a:Number): Void {
    mc.beginFill(0xFFFFFF);
    mc.moveTo(0, 0);
    mc.lineTo(w, 0);
    mc.lineTo(w, h);
    mc.lineTo(0, h);
    mc.lineTo(0, 0);
    mc.endFill();
    mc._alpha=a;
    * init the size of the polaroid
    private function initSize():Void {
    var mc:MovieClip =_mcTarget.createEmptyMovieClip("mc",_mcTarget.getNextHighestDepth());
    mc.attachMovie(this._polaroid,"polaroid_mc", _mcTarget.getNextHighestDepth());
    this._h = mc._height;
    this._w = mc._width;
    removeMovieClip(mc);
    mc = null;
    * sets the position of the polaroid
    public function setPosition(xPos:Number,yPos:Number):Void {
    this._xPosition = xPos;
    this._yPosition = yPos;
    * moving in
    public function moveIn():Tween {
    var mc:MovieClip = this._mcTarget;
    mc._visible=true;
    var tween:Tween = new Tween(mc, "_x", Strong.easeOut, 0, 0, 1, true);
    var tween:Tween = new Tween(mc, "_y", Strong.easeOut, 200, 0, 1, true);
    var tween:Tween = new Tween(mc, "_xscale", Strong.easeOut, 30, 100, 1, true);
    var tween:Tween = new Tween(mc, "_yscale", Strong.easeOut, 30, 100, 1, true);
    var tween:Tween = new Tween(mc, "_alpha", Strong.easeOut, 0, 100, 1, true);
    return tween;
    * moving in
    public function moveOut():Tween {
    var mc:MovieClip = this._mcTarget;
    var tween:Tween = new Tween(mc, "_alpha", Strong.easeIn, 99, 0, 1, true);
    var tween:Tween = new Tween(mc, "_x", Strong.easeIn,0, 1000, 1, true);
    var tween:Tween = new Tween(mc, "_y", Strong.easeIn, 0, -50, 1, true);
    var tween:Tween = new Tween(mc, "_xscale", Strong.easeIn, 100, 50, 1, true);
    var tween:Tween = new Tween(mc, "_yscale", Strong.easeIn, 100, 50, 1, true);
    return tween;
    /////////////////////////////// CODE ENDS ///////////////////////////////////////
    As in the current case, the name of the movieclip which has the image (originally polaroid) is being read through the variable _imageMC which we hadd given the value "polaroidTest".
    The animation shows no image even when i have inserted the correct url (i m sure this step isn't wrong).
    Any clues?

  • To send image to a VC model from Backend system

    hi Experts,
    Is it possible to send images from backend system to the VC model ?????
    If yes then how?
    Regards,
    Sanjyoti.

    Yes, it's possible.
    In our employee search model we've programmed a BAPI to return a picturelink to a picture of the employee as a simple text string. This is then mapped to an ordinary HTML view which only has one field: url.
    In this case all the "hard" work has been done in the back end. I can't tell you exactly how the BAPI is programmed, but the pictures are administrated in transaction PREL and are stored in SAPs content server.
    The links look like this: http://host:port/sap/bc/contentserver/300?get&pVersion=0046&contRep=Z2&docId=45C1AECE313D60D9E1000000C1A19044&compId=DATA
    If you look at BAPI BAPI_EMPLOYEE_GETDATA (which we have based our new z-bapi on) you will see the docID field values returned from port ARCHIVELINK (field: ARC_DOC_ID).
    Henning

  • Without using webutil how to read an image from client or own system

    Hi,
    I am trying to read image from my own system.
    (if I click on button (browse) then it should open an dialog box then i can select image from it. then I press another button(save) it should be store in the database.)
    So, i want read image without using webutil package how to do it.
    If i want read image from client system please tell me how to do it.
    I am getting with webutil package but there is any other chance to get the image.

    Please keep in mind that Forms 10g is a release not a version.  Also, since you are running on Windows 7 64 bit - you should be using Forms 10g Release 2 (version 10.1.2.0.2) and a patchset to upgrade this to version 10.1.2.3.0.
    Now, to answer your question - I happen to agree with MarkReichman, WebUtil would be my preferred method, but since you don't want to use WebUtil then the only other way would be to use a 3rd party Java Bean.  I prefer WebUtil because it is supported by Oracle and I can contact them with any issues.
    Craig...

  • Pasting Image  from Mac clipboard to Java Based Application.

    Hi,
    I am working on "iMac 10.2.7". I need to paste an image from other
    application using "Java version 1.4.1". I am trying to retrieve the image
    from the system clipboard after it is copied from some other application. I
    am pasting the code which illustrates my requirement. It works fine on
    windows. But does not work on Mac.
    On Mac it does not cross the supported data flavor check
    (clipData.isDataFlavorSupported(DataFlavor.imageFlavor) where clipData is
    the Transferable object). It seems Mac has some InputStream instead of Image
    in the clipboard when some image is copied. I tried to read that InputStream
    using ImageIO.read(java.io.InputStream). But that is also returning null.
    Thanks
    Santanu
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import java.awt.datatransfer.*;
    import javax.swing.*;
    public class ClipboardTest extends JFrame implements KeyListener{
         JLabel label;
         static Toolkit kit = null;
         static Clipboard clipboard = null;
         public static void main (String arg[]) {
              kit = Toolkit.getDefaultToolkit();
              clipboard = kit.getSystemClipboard();
              JLabel l = new JLabel();
              JButton button = new JButton("Paste from clipboard");
              final ClipboardTest ct = new ClipboardTest(l);
              ct.getContentPane().add(l,BorderLayout.CENTER);
              ct.getContentPane().add(button,BorderLayout.SOUTH);
              ct.setVisible(true);
         button.addActionListener(
              new ActionListener() {
                   public void actionPerformed(ActionEvent ae) {
                        pasteImage(ct.label);
         button.addKeyListener(ct);
         public ClipboardTest (JLabel l) {
              label = l;
         public static void pasteImage(JComponent jComp) {
                   jComp.setTransferHandler(new ImageSelection());
                   TransferHandler handler = jComp.getTransferHandler();
                   Transferable clipData = clipboard.getContents(null);
              if (clipData != null) {
              if (clipData.isDataFlavorSupported(DataFlavor.imageFlavor)) {
                   handler.importData(jComp, clipData);
         //Key listener methods
         public void keyPressed(KeyEvent e) {
         int c = e.getKeyCode();
         if (c == 86) {
              if (e.isControlDown()) {
                   pasteImage(label);
         public void keyReleased(KeyEvent e) {}
         public void keyTyped(KeyEvent e) {}
    class ImageSelection extends TransferHandler implements Transferable {
         /* DataFlavor instance that holds imageflavor value*/
         private static final DataFlavor flavors[] = {DataFlavor.imageFlavor};
         private Image image;
         public boolean importData(JComponent comp, Transferable transferable) {
         try {
         if (transferable.isDataFlavorSupported(flavors[0])) {
         image = (Image)transferable.getTransferData(flavors[0]);
                   if (comp instanceof JLabel) {
                   ((JLabel)comp).setIcon(new ImageIcon(image));
                   comp.repaint();
                   return true;
         } catch (Exception ignored) {
              ignored.printStackTrace();
         return false;
         // Transferable Interface methods
         public Object getTransferData(DataFlavor flavor) {
         if (isDataFlavorSupported(flavor)) {
         return image;
         return null;
         public DataFlavor[] getTransferDataFlavors() {
         return flavors;
         public boolean isDataFlavorSupported(DataFlavor flavor) {
         return flavor.equals(flavors[0]);

    Here are two commercial options:
    JTwain + JSane
    http://asprise.com/product/jtwain/index.php
    Morena
    http://www.gnome.sk/Twain/jtp.html
    Haven't tested them, so don't no how good they are, nor how easy they are to use on multiple platforms.

  • Download Image from Local PC

    Hi,
    I have a jpg image which is stored in the local system(not on the server).I have written an application from which I am not able to download the image from the local system.
    I am using the following code but this code works only if the image is present on the server.
            String file = "C:\Folder_Name\image.jpg";
            final byte[] content = this.getByteArrayFromResourcePath(file);     
         final IWDCachedWebResource resource = WDWebResource.getWebResource(content, WDWebResourceType.UNKNOWN);
                    try
         final IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(resource.getURL(), "WD_Filedownload", true);
         window.open();
         catch(Exception e)     {
         wdComponentAPI.getMessageManager().reportException(new WDNonFatalException(e), false);
             private byte[] getByteArrayFromResourcePath(String resourcePath)throws FileNotFoundException, IOException
               FileInputStream in = new FileInputStream(new File(resourcePath));
               ByteArrayOutputStream out = new ByteArrayOutputStream();
               int length;
               byte[] part = new byte[10 * 1024];
               while ((length = in.read(part)) != -1) {
                 out.write(part, 0, length);
               in.close();
               return out.toByteArray();
    And for downloading the file or image from local system I need to put the file in \src\mimes\Components folder; Where as I want the file to be downloadable anywhere from the local file system. Is that possible?
    Thanks
    Pravin

    Pravin,
    If you want to display an image existing elsewhere on the local machine, you need to upload it first (use FileUpload UI component), store it in a byte array and then continue with your code below of creating a cached web resource.
    And you place resources in src/mimes/component so that they will be available to the application (meaning for all users). This doesnt mean you are displaying the image from the local file system. When you deploy, these images go and live in the server and accessed from there.
    In any case, the hardcoded image location in your code is valid only for YOU but not necessarily other user running the same application.
    As such, you cannot access the client's file system explicitly (i.e local machine) due to security reasons. I know of no other way to do it with WebDynpro. Any resources must be present on the server side at some point of time. Either at application start or ask the user to provide it (like FileUpload).
    No web technology allows that other than signed applets or trusted activex controls, as far as i know.
    Hope that clears the confusion.
    Thanks,
    Rajit
    Message was edited by:
            Rajit Srinivas

  • System Image Utility 10.6.3 - fails when creating NetBoot image from DVD

    System Image Utility 10.6.3, trying to create a NetBoot image from a bundled installer disc that came with a 27" Late 2009 iMac (iMac11,1). Image creation fails consistently, since the image that System Image Utility creates is only 901M.
    Anyone see this before?
    Don
    --------- System Image Utility log ----------
    Workflow Started (2010-06-16 14:03:02 -0700)
    Starting action: Define Image Source
    Finished running action: Define Image Source
    Starting action: Create Image
    Starting image creation process...
    Create NetBoot Image
    Initiating NetBoot from Install Media.
    Creating working path at /Library/NetBoot/NetBootSP0/NetBoot of Mac OS X Install DVD
    Creating disk image (Size: 901 MB)
    Finalizing disk image.
    created: /Library/NetBoot/NetBootSP0/NetBoot of Mac OS X Install DVD/NetBoot.dmg
    Attaching disk image
    Installing to destination volume
    2010-06-16 14:03:38.126 installer[2365:6f03] Looking for system packages
    2010-06-16 14:03:38.129 installer[2365:6f03] no system packages found
    2010-06-16 14:03:38.130 installer[2365:6f03] No or Invalid system receipts found on /private/tmp/mnt.LjFArn
    2010-06-16 14:03:38.130 installer[2365:6f03] Attempting fallback using: /System/Library/PrivateFrameworks/SystemMigration.framework/Resources/FallbackS ystemFiles.plist
    2010-06-16 14:03:38.175 installer[2365:6f03] Finding system files...
    2010-06-16 14:03:38.619 installer[2365:6f03] Writing system path cache.
    2010-06-16 14:03:38.623 installer[2365:6f03] Error writing cache to /private/tmp/mnt.LjFArn/Library/Caches/com.apple.FindSystemFiles.plist
    2010-06-16 14:03:38.625 installer[2365:6f03] Failed to enumerate /tmp/mnt.LjFArn/Library/Caches, cannot prune (
    "com.apple.userpictureCache"
    installer: Package name is Mac OS X
    installer: Installing at base path /private/tmp/mnt.LjFArn
    installer: The install failed (There is not enough space on this disk to install the selected items. Deselect at least 6.46 GB and try again.)
    Script is done.
    NetBoot creation failed.
    Image creation process finished...
    Stopping image creation.
    Image creation failed.

    Brian Nesse wrote:
    Hi Don, here's my guess...
    The 901 number is additional space added in the scripts. This indicates that the source image size was 0.
    Since you are making a NetBoot from Install media, under the covers the installer process is being run to create a NetBoot volume. The media shipped with the 27" iMac is most likely CPU specific and thus the installation fails because you are trying to create the image (i.e. install the system) on an unsupported CPU.
    In order to produce a NetBoot from the install media, you'll have to create it on the 27" iMac.
    Hi Brian,
    Thanks for the response. This makes perfect sense. I'll give this a try and shout back!
    Thanks,
    Don

  • Using flash to display images from sql server or file system

    hello,
    what methods and parameters of the urlloader class we have to use to display images in a flash player if possible..
    also movie should update everytime a new image is added to a database or file
    the images can either be in a file system or in a sql database (if possible)
    does flash comes with an object of this type or we have to create it.
    regards,

    i responded to your duplicate message 4 days ago:
    is it possible to insert and retrieve images from sql server using actionscript.
    you'll need server-side script to query your database and you can use the flash urlloader class to call your script.
    also  is it possible to create a flash scrolling gallery based on images  stored in a database and everytime an image is added it is displayed in  the gallery.
    load the data using the urlloader class and  then load the images.  periodically query the database for new images if  there's no direct way for flash to know a new image was added.

  • How do I reorganize my photos on iPad 2?  I need to move (not copy) photos from one album to another.  When I use the copy function to another album, and then try to delete an image from the original album, the system wants to delete the photos from all a

    How do I reorganize my photos on iPad 2?  I need to move (not copy) photos from one album to another.  When I use the copy function to another album, and then try to delete an image from the original album, the system wants to delete the photos from all albums.  Please help.

    You can't do it directly on the iPad - the new album functionality basically only allows you to copy photos into those new albums, you can't move them. The way that I think of it as working is that you are just creating pointers to the photos in those new albums, so if you then delete the original photo on the iPad you therefore automatically delete all the pointers to it.
    If you want to re-organise your albums then you will need to do it on your computer and then sync those albums over to the iPad

  • 2nd drive unformatted and not restored after attempting restore from a system image

    I created a system image, which included drive C (where Windows is installed) and drive G (where some installed Windows programs are located).  I then ran into a situation where I wanted to restore from the system image.  With my first attempt,
    this process took several days.  When I returned home from work, my computer had booted up into Windows -- drive C had successfully been restored.  I soon found out though that drive G was in an unformatted state.
    Now, given the time it took for each drive to restore and the sizes of data for each drive (160gb for C and 1000gb for G), it seemed odd to me that the entire process had completed already, given the time that had passed and the progress indicated for drive
    G in the status bar, in the morning before I went to work.  It is entirely possible that one of my cats may have jumped on my desk and somehow cancelled the operation.
    My questions are:
    1. if the restore is cancelled while the 2nd disk is being restored, will the 1st disk (C) still be successfully restored?
    2. why does this process take so long?
    3. if there is some other error, is it displayed?  Does system restore automatically reboot after completion/cancellation?  Is there an error file created somewhere if there was an error, or perhaps something mentioned in a log file?  If so,
    where?
    4. has anyone encountered a similar issue before and can provide any insight?
    5. anything else I'm missing?
    I'm attempting to restore a second time, and it is not even halfway through drive C, so it might not be until the end of the week before the entire process completes.  To be safe, especially from nosey cats, I disabled the mouse and keyboard so no input
    can interrupt and accidentally cancel the process.
    thanks,
    Chris

    Hi Chris,
    For the first problem, if the restore is cancelled while the 2nd disk is being restored, the 1st disk (C) can be successfully restored.
    For the second problem, I think it is normal to take a long time to finish the process, it is depend on the size of the date.
    For the third problem, you may check the setup log files to find the clue of the cause.
    For you convenience: Windows Setup Log Files and Event Logs
    http://technet.microsoft.com/en-us/library/hh824819.aspx
    You may try the methods listed in the following article step by step.
    How to Do a System Image Recovery in Windows 7
    http://www.sevenforums.com/tutorials/675-system-image-recovery.html
    Please note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.
    Hope it helps.
    Regards,
    Blair Deng
    Blair Deng
    TechNet Community Support

Maybe you are looking for

  • FM or method to print PDF document

    Hi, We have created a program that downloads a pdf document from CV03n transaction. The filename and filepath of the file are known in the program.We immediately need to print this PDF document on execution of the program without opening the file at

  • Autofocus and touch focus on 3G 2megapixel camera update needed badly

    Well after seeing the new specs of the 3GS, tho the camera is better. i would have still liked to have seen something good for the camera on the 3G model of which i recently brought, only to find the new iphones sudden release. Tho i love my 3G i was

  • Iphone 5 cdma/gsm from sprint

    Good day! I live in colombia but here iphone 5 is not available yet. All bands here work with gsm sim card. I was wondering if i buy a sprint cdma/gsm versiona can i then make it work with my carrier here? Does sprint cdma/gsm work with sim card and

  • Is there anyway to change the font used in the Notes app?

    I noticed Notes's font has changed on my iPhone 3Gs (which I don't like). Is there a way to change it back? Thanks, Paul

  • Release Strategy for reservation created from PM and PS

    Dear All, How to configure the release strategy for reservation generated  from PM and PS. Regards, Atanu