3 Replies Latest reply: Jun 19, 2004 1:23 AM by Serdar Simsekler RSS

BLOB Data types

Suresh Velupally
Currently Being Moderated

Oracle stores images,picture and drawings as BLOB data type in its database. Now I have to bring this BLOB data type into SAP using ABAP. But SAP does not handles BLOB data types.

 

How do you handle BLOB data types in SAP?

 

Thanks

Suresh

  • Re: BLOB Data types
    Serdar Simsekler
    Currently Being Moderated

    Hi!

    I have something(s) in my mind, check these out. I hope it would be clear.

     

    A: You can store your binary data in cluster tables for which you can use EXPORT and IMPORT operations (refer to SAP Help for these statements: Importing from/Exporting to cluster tables) to load and save data. Using WS_UPLOAD and WS_DOWNLOAD function modules, you can contact with the presentation layer for temporary usage. Since you have a path you can use that as an URL for the method "load_picture_from_url" of cl_gui_picture.

     

    B: I think this will be a confusing one.

    First you can upload your pic using tcode 'SMW0' to the WWW repository.

     

    If you want to use the picture you've uploaded,

    1. Create a picture control (class: "cl_gui_picture") instance on your screen.

    2. To obtain a link to your picture;

    a. Use the FM 'WWW_GET_MIME_OBJECT' to get the size and mime properties.

    b. Use the FM 'DP_CREATE_URL' to get the link, give the changing parameter "content_length" and tables parameter "mime" output of the FM in 2.a. to the exporting parameter "size" and the tables parameter "data" respectively.

    3. Now use the method "load_picture_from_url" of cl_gui_picture instance giving the URL you obtained in step 2.b.

    Yeah here you are the victorious!

     

    C: There is another transaction "OAER" to upload pictures, but I haven't tried before.

     

    Being clear was just a real hope. Now hoping all these help...

     

    Serdar

    • Re: BLOB Data types
      Suresh Velupally
      Currently Being Moderated

      Hi Serder,

       

              Thanks for giving me some idea. Here is our requirement. We are running SAP on Oracle database. But we have another external Oracle database where the designs are stored on it. Designs are stored as BLOB data type.

       

      Now we have to bring this design from external database into our ABAP program and display on SAP screen.

       

      If you have any idea, let me know. Or email me at velupally@hotmail.com

       

      Your help is greatly appreciated.

       

      Thanks

      Suresh

  • Re: BLOB Data types
    Serdar Simsekler
    Currently Being Moderated

    Hi again,

     

    I wonder whether you still insist on storing your designs in their current location or not. Let's consider both cases:

     

    A. If relocation is possible;

    -


    1. Get your files to somewhere addressable by an URL using Oracle utilities

    2. After, you have some storing options I mentioned in my former message.

    a. Storing in cluster tables in SAP repository

        - refer to SAPhelp about 'EXPORT' and 'IMPORT' keywords

        - needs usage of FMs 'GUI_UPLOAD' or 'GUI_DOWNLOAD' (or using similar static methods of the class 'CL_GUI_FRONTEND_SERVICES') to handle temporary file while loading and saving

        - a customer class may be implemented to handle those

    b. Storing in WWW repository

        - using tcode SMW0

        - during the program execution, needs a link to be generated by use of 'WWW_GET_MIME_OBJECT' and 'DP_CREATE_URL'

    c. Leaving files in their place which can be reached by a valid URL (e.g. FILE://d:\.. or
    ournet..) (This may be equal nothing to do after step A.1)

     

    3. Now, we have an independently addressable target with tha address <address> . Follow these to construct a simple picture container:

    a. Create a custom container instance (CC) of class 'CL_GUI_CUSTOM_CONTAINER' who is linked with a custom control area in your screen

    b. Create a picture control (PC) instance of class 'CL_GUI_PICTURE' whose parent is (CC).

    c. Use 'load_picture_from_url' method for instance of (PC) passing <address> to the parameter 'url'

     

    --> Further is your screen programming

     

    B. If relocation is not possible

    -


    1. Then you must find some way to read your BLOB-type data directly from your Oracle-system. We can use Native SQL within our ABAP programs but I don't know what happens for BLOB kind data. This may be searched but I've no hope in fact.

    Ignoring the way above, again I do not know whether it's possible but if there is some way to trigger some function in your Oracle-system to temporarily output your data into a file on the presentation layer.

    2. After achieving the first step, you can apply steps A.2.a or A.2.c and then A.3 for the rest.

     

    Hope this time I have been more clear...

     

     

    *--Serdar

Actions