How to upload image to the progrogram...

I am trying to upload the image to the function module but it says the "sunset.jpg" is feild unkonwn it is not defined by the data...
and when i am passing this image stuff at the runtime... it gives me the memory dum.. would you like to help me... i am creating a splash screen with this code....
i am giving you the code below...
Regards
Naim
Code listing for function: ZJNC_START_SPLASH
Description: Show Splash at Start
FUNCTION zjnc_start_splash.
""Local interface:
*"  IMPORTING
*"     REFERENCE(IMAGEFILE) TYPE  C DEFAULT 'THANKS.JPG'
*"     REFERENCE(WIDTH) TYPE  I DEFAULT 415
*"     REFERENCE(HEIGHT) TYPE  I DEFAULT 274
*"     REFERENCE(TIMEOUT) TYPE  I DEFAULT 3
*"     REFERENCE(CALLBACK) TYPE  C
      Global data declarations
  MOVE imagefile TO g_name.
  MOVE width TO picwidth.
  MOVE height TO picheight.
  MOVE timeout TO pictimeout.
  MOVE callback TO piccallback.
  TRANSLATE piccallback TO UPPER CASE.
  PERFORM getpicurl.
  CALL SCREEN 0806.
ENDFUNCTION.
Code listing for function: ZJNC_END_SPLASH
Description: Show Splash at End
FUNCTION ZJNC_END_SPLASH.
""Local interface:
*"  IMPORTING
*"     REFERENCE(IMAGEFILE) TYPE  C DEFAULT 'THANKS.JPG'
*"     REFERENCE(WIDTH) TYPE  I DEFAULT 415
*"     REFERENCE(HEIGHT) TYPE  I DEFAULT 274
*"     REFERENCE(TIMEOUT) TYPE  I DEFAULT 3
      Global data declarations
  MOVE imagefile TO g_name.
  MOVE width TO picwidth.
  MOVE height TO picheight.
  MOVE timeout TO pictimeout.
  PERFORM getpicurl.
  CALL SCREEN 2009.
ENDFUNCTION.
Code listing for: LZUTILTOP
TOP level Include of Function Group ZUTIL
Author Jayanta Narayan Choudhuri
        Flat 302
        395 Jodhpur Park
        Kolkata 700 068
      Email [email protected]
      URL:  http://www.geocities.com/ojnc
FUNCTION-POOL zutil.                        "MESSAGE-ID ..
TYPE-POOLS: abap.
DATA: graphic_url(255),
      g_result   TYPE i,
      g_linesz   TYPE i,
      g_filesz   TYPE i,
      g_name(100).
TYPES: t_graphic_line(256) TYPE x.
DATA: graphic_line TYPE t_graphic_line,
      graphic_table TYPE TABLE OF t_graphic_line.
DATA: picwidth        TYPE i,
      picheight       TYPE i,
      pictimeout      TYPE i,
      piccallback(60) TYPE c,
      first           TYPE boolean.
      CLASS ZCL_ES_SPLASH_SCREEN  DEFINITION
CLASS zcl_es_splash_screen DEFINITION.
  PUBLIC SECTION.
    EVENTS on_close.
    METHODS constructor
      IMPORTING
        !i_num_secs  TYPE i DEFAULT 5
        !i_url       TYPE c
        !i_width     TYPE i
        !i_height    TYPE i.
  PROTECTED SECTION.
    METHODS handle_end_of_timer
      FOR EVENT finished OF cl_gui_timer.
  PRIVATE SECTION.
    DATA container TYPE REF TO cl_gui_dialogbox_container.
    DATA image     TYPE REF TO cl_gui_picture.
    DATA timer     TYPE REF TO cl_gui_timer.
ENDCLASS.                    "ZCL_ES_SPLASH_SCREEN  DEFINITION
CLASS ZCL_ES_SPLASH_SCREEN IMPLEMENTATION
CLASS zcl_es_splash_screen IMPLEMENTATION.
  METHOD constructor.
    DATA: image_width     TYPE i,
          image_height    TYPE i.
    COMPUTE image_width  = i_width + 30.
    COMPUTE image_height = i_height + 50.
    CREATE OBJECT container
       EXPORTING
         width                       = 10
         height                      = 10
         top                         = 10
         left                        = 10
         name                        = 'DialogSplash'.
    CALL METHOD container->set_caption
      EXPORTING
        caption = g_name.
    CREATE OBJECT image
      EXPORTING
        parent = container.
    CALL METHOD image->load_picture_from_url
      EXPORTING
        url = i_url.
    image->set_display_mode( image->display_mode_normal_center ).
    cl_gui_cfw=>flush( ).
    container->set_metric( EXPORTING metric = image->metric_pixel ).
    DATA: myleft TYPE i,
          mytop  TYPE i.
    COMPUTE myleft = ( 800 - image_width ) / 2.
    COMPUTE mytop  = ( 600 - image_height ) / 2.
    IF myleft < 0.
      MOVE 0 TO myleft.
    ENDIF.
    IF mytop < 0.
      MOVE 0 TO mytop.
    ENDIF.
    container->set_position(
      EXPORTING
        height            = image_height
        left              = myleft
        top               = mytop
        width             = image_width ).
    cl_gui_cfw=>update_view( ).
    CREATE OBJECT timer.
    timer->interval = i_num_secs.
    SET HANDLER me->handle_end_of_timer FOR timer.
    timer->run( ).
    cl_gui_cfw=>flush( ).
  ENDMETHOD.                    "constructor
  METHOD handle_end_of_timer.
I wanted NAMASTE to remain until JOB was complete.
   IF container IS NOT INITIAL.
     container->free( ).
     CLEAR container.
     FREE  container.
   ENDIF.
   IF timer IS NOT INITIAL.
     timer->free( ).
     CLEAR timer.
     FREE  timer.
   ENDIF.
   cl_gui_cfw=>flush( ).
    RAISE EVENT on_close.
  ENDMETHOD.                    "handle_end_of_timer
ENDCLASS.                    "ZCL_ES_SPLASH_SCREEN  IMPLEMENTATION
      CLASS lcl_event_handler DEFINITION
CLASS lcl_event_handler DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS: on_close FOR EVENT on_close OF zcl_es_splash_screen.
ENDCLASS. "lcl_event_handler DEFINITION
CLASS lcl_event_handler IMPLEMENTATION
CLASS lcl_event_handler IMPLEMENTATION.
  METHOD on_close.
    IF sy-dynnr = 2009.
      LEAVE PROGRAM.
    ELSE.
      MOVE abap_false TO first.
      PERFORM (piccallback) IN PROGRAM (sy-cprog).
    ENDIF.
  ENDMETHOD. "on_close
ENDCLASS. "lcl_event_handler IMPLEMENTATION
DATA: splash TYPE REF TO zcl_es_splash_screen.
*&      Module  STATUS_0806  OUTPUT
MODULE status_0806 OUTPUT.
  IF first IS INITIAL.
    first = abap_true.
    SET TITLEBAR 'TITLE0806'.
    CREATE OBJECT splash
        EXPORTING
          i_num_secs = pictimeout
          i_url      = graphic_url
          i_width    = picwidth
          i_height   = picheight.
    SET HANDLER lcl_event_handler=>on_close FOR splash.
  ENDIF.
ENDMODULE.                " STATUS_0806  OUTPUT
*&      Module  STATUS_2009  OUTPUT
MODULE status_2009 OUTPUT.
  IF first IS INITIAL.
    first = abap_true.
    SET TITLEBAR 'TITLE2009'.
    CREATE OBJECT splash
        EXPORTING
          i_num_secs = pictimeout
          i_url      = graphic_url
          i_width    = picwidth
          i_height   = picheight.
    SET HANDLER lcl_event_handler=>on_close FOR splash.
  ENDIF.
ENDMODULE.                " STATUS_2009  OUTPUT
*&      Form  getpicurl
FORM getpicurl.
  OPEN DATASET g_name FOR INPUT IN BINARY MODE.
  REFRESH graphic_table.
  CLEAR   g_filesz.
  DO.
    CLEAR graphic_line.
    READ DATASET g_name INTO graphic_line ACTUAL LENGTH g_linesz.
    ADD g_linesz TO g_filesz.
    APPEND graphic_line TO graphic_table.
    IF sy-subrc <> 0.
      EXIT.
    ENDIF.
  ENDDO.
  CLOSE DATASET g_name.
  CLEAR graphic_url.
  CALL FUNCTION 'DP_CREATE_URL'
    EXPORTING
      type                 = 'IMAGE'
      subtype              = 'GIF'
    TABLES
      data                 = graphic_table
    CHANGING
      url                  = graphic_url
    EXCEPTIONS
      dp_invalid_parameter = 1
      dp_error_put_table   = 2
      dp_error_general     = 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.
    EXIT.
  ENDIF.
ENDFORM.                    "getpicurl

Use this program..
create object cust_container
  exporting
    container_name              = 'MYCONTAINER1'
CREATE OBJECT split_container
  EXPORTING
   LINK_DYNNR        =
   LINK_REPID        =
   SHELLSTYLE        =
   LEFT              =
   TOP               =
    WIDTH             = 10
    HEIGHT            = 40
   METRIC            = cntl_metric_dynpro
   ALIGN             = 15
    PARENT            = cust_container
    ROWS              = 2
    COLUMNS           = 2
   NO_AUTODEF_PROGID_DYNNR =
   NAME              =
EXCEPTIONS
   CNTL_ERROR        = 1
   CNTL_SYSTEM_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.
CALL METHOD split_container->get_container
  EXPORTING
    row       = 1
    column    = 1
  receiving
    container = cus_cont.
create object picture
  exporting
    parent = cus_cont
clear url.
path = 'ZNAVEEN'.
perform get_url using path.
CALL METHOD picture->set_display_mode
    EXPORTING
      display_mode = cl_gui_picture=>display_mode_fit
EXCEPTIONS
   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.
Use this Perform to load Picture
form get_url using  p_path.
DATA query_table LIKE w3query OCCURS 1 WITH HEADER LINE.
  DATA html_table LIKE w3html OCCURS 1.
  DATA return_code LIKE  w3param-ret_code.
  DATA content_type LIKE  w3param-cont_type.
  DATA content_length LIKE  w3param-cont_len.
  DATA pic_data LIKE w3mime OCCURS 0.
  DATA pic_size TYPE i.
  REFRESH query_table.
  query_table-name = '_OBJECT_ID'.
  query_table-value = p_path.
  APPEND query_table.
  CALL FUNCTION 'WWW_GET_MIME_OBJECT'
       TABLES
            query_string        = query_table
            html                = html_table
            mime                = pic_data
       CHANGING
            return_code         = return_code
            content_type        = content_type
            content_length      = content_length
       EXCEPTIONS
            object_not_found    = 1
            parameter_not_found = 2
            OTHERS              = 3.
  IF sy-subrc = 0.
    pic_size = content_length.
  ENDIF.
  CALL FUNCTION 'DP_CREATE_URL'
       EXPORTING
            type     = 'image'
            subtype  = cndp_sap_tab_unknown
            size     = pic_size
            lifetime = cndp_lifetime_transaction
       TABLES
            data     = pic_data
       CHANGING
            url      = url
       EXCEPTIONS
            OTHERS   = 1.

Similar Messages

  • How to upload Images in Forms 6i

    Dear all,
    How to upload images in Forms 6i and save it in database. Please anyone help me with example.
    Thanking you
    Shekhar

    why do you need an active/X for this?
    Can't you just create 2 default blocks on dept and on emp.
    Use the relationship wizard to define the relation. and set the number of records displayed for the emp block to 10?
    This will give you all you need with no hussle.

  • How to upload images on hard drive to iPad?

    how to upload images on hard drive to iPad?

    You can import them into iTunes then use that to get them onto your iPad.
    You can download the iCloud control panel and use photo stream to get the photos onto your iPad
    You can e-mail them to yourself and them save them from that e-mail
    You can upload them to something like dropbox and then download them onto your pad from there.

  • How to upload images

    Hi,
    In our portal service (SE80--> Internet Services) program how can I upload the image for our portal?
    Saurabh Garg

    Hi Saurabh,
    if you are trying to upload images from the web dyn pro side,
    create a Java webdyn pro application with the images.
    to place the picture in the application goto docs and settings->
    <i>C:\Documents and Settings\arun.jacob\Documents\SAP\workspace\"yourapplication name"</i>
    and once this is done. Upload the pAR file.
    and on the iView side.
    webdyn pro iView
    select J2EE->IView from pAR
    and once this is done. you can see the picture you included in the program.
    Cheers

  • How to upload image files in sqlserver from jsp

    hi friends,
    i want to upload images to sqlserver how will i store url of the image or dorectly store the file in binary format, if we store in related path,plese give some ideas on store that paths in data base and how we store that image files in user directories.
    bye

    hi jay , I know that concept , but i dont know how to upload image files to server Please help me
    here i am giving my problem
    If any user register with site, he has the option to upload his image to the site, so i am using in html file upload option, But i dont know how to store that iamge into the server
    please give me suggestion
    regards
    sudhakar

  • How to upload image using JSP

    hi,
    i am confronting a problem how to upload image from local PC to web server . I am using Tomcat 4.0
    please help me by sending code
    thanks

    Hi,
    Here is the solution for uploading images and displaying images. I am using struts with JSP, so this code has a Action and ActionForm class. You can put the same code in Java Beans or Servlet class to run it. This code has two JSP files - one for Upload (upload.jsp)and other for Image(image.jsp) display. It has a Servlet also to display the image. Here is the code file wise.
    Upload.jsp **********************************************************
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html>
    <head>
    <title>New Page 1</title>
    </head>
    <body>
    <html:form action="uploadAction.do" enctype="multipart/form-data" method="POST">
    <p>File to upload   
    <html:file property="fileUpload" size="20"/></p>
    <p><html:submit value="Upload" property="upload"/></p>
    <p> </p>
    <p><html:img src="image.jsp"/></p>
    <p> </p>
    </html:form>
    </body>
    </html:html>
    Image.jsp*****************************************************************
    <jsp:useBean id="upload" class="uploadtest.uploadActionForm" scope="session">
    </jsp:useBean>
    <%
         byte[] rgb=(byte[])session.getAttribute("byte");
         request.setAttribute("byArr", rgb);
    %>
    <!--
    The image data is now on the request object.
    Forward the user to the showImage servlet.
    That servlet will process and display the image data contained on the request object.
    -->
    Image is<p>
    <jsp:forward page="/showimage" />
    Struts Action Class - UploadAction.java **************************************************
    import javax.servlet.http.*;
    import java.io.*;
    import org.apache.struts.upload.FormFile;
    import org.apache.struts.action.*;
    public class uploadAction extends Action {
    public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
    uploadActionForm upload = (uploadActionForm) actionForm;
    try {
    int size=upload.getFileUpload().getFileSize();
    //if (image != null) {
    byte[] byteArr = new byte[size];
    //Create an input stream to read the uploaded file.
    ByteArrayInputStream bytein = new ByteArrayInputStream(upload.getFileUpload().getFileData());
    // Load the input stream into the byte Array.
    bytein.read(byteArr);
    // Close the input stream.
    bytein.close();
    // Load the byte[] into the content field.
    upload.setContent(byteArr);
    HttpSession ses=httpServletRequest.getSession();
    ses.setAttribute("byte",byteArr);
    return actionMapping.findForward("success");
    } catch (Exception ex) {
    ex.printStackTrace();
    return actionMapping.findForward("success");
    Struts ActionForm class ---uploadActionForm.java***************************************************
    package uploadtest;
    import org.apache.struts.action.*;
    import org.apache.struts.upload.*;
    import javax.servlet.http.*;
    public class uploadActionForm extends ActionForm {
    private FormFile fileUpload;
    private byte[] content;
    public FormFile getFileUpload() {
    return fileUpload;
    public void setFileUpload(FormFile fileUpload) {
    this.fileUpload = fileUpload;
    public byte[] getContent()
    return content;
    public void setContent(byte[] theFile)
    this.content = theFile;
    public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
    /**@todo: finish this method, this is just the skeleton.*/
    return null;
    public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
    Servlet to display image --- ShowImage.java ********************************************************
    import java.io.*;
    import java.util.*;
    public class ShowImage extends HttpServlet {
    //Initialize global variables
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    byte[] rgb = (byte[]) request.getAttribute("byArr");
    if (rgb != null)
    response.setContentType("image/gif");
    OutputStream stream = response.getOutputStream();
    stream.write(rgb);
    else
    response.setContentType("text");
    response.getWriter().write("attribute byArr not found");
    This code will enable to to upload and display the image. If you know Struts, then you can write the Struts-Config.xml file by yourself. Other wise write to me, I will send you that. If you want to save the image in database, then you have to keep it as BLOB datatype is database. For database you need to send the byte array in the uploadAction.java file to database. Database will keep the image as binary.
    Thanks
    Amit

  • IOS how to upLoad image

    IOS how to upload image, how the
    receiving server,can you help me?

    Hi. The iOS library for Azure Storage is currently in planning. In the meantime, please check out the following blog
    http://chrisrisner.com/Mobile-Services-and-Windows-Azure-Storage which may help with your scenario. Thanks.

  • How to store image in the oracle database 10.2.

    Hi.,
    I am working on 10g ids. I have designed a form where there are two fields. Name and picture.
    I want to keep details of the person with their photo.
    I can simply put name but how to insert image in the picture field??
    can you suggest ??
    Thanks.
    Shyam

    Hi
    To store your binary images in an Oracle database, you will need to create a column in your table defined with the BLOB datatype BLOB stands for Binary Large Object. Images from scanners, mpeg files, movie files and so on can all be stored in the BLOB column
    sq>CREATE TABLE test_table (
       id NUMBER,
       image BLOB);then go to
    [http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10796/toc.htm]

  • How to store image in the oracle database 10.2. using File Maker 10.

    Hi.,
    I want to store image, media file in the oracle database using File Maker as a front end.
    I connect Oracle using odbc from file maker. There are table and in that table there a column "pict" of blob type. but this column is not showing in the file maker.
    2. Here I can not change the data type of any column.
    Now how to store images in the oracle table using odbc or any other tool.
    Regards,
    Shyam

    I wrote an example for my students, you can find it here. It's using PHP as the front end but all you need to do is know how and leverage the stored procedures. All code is downloadable in zip files from the blog.
    http://blog.mclaughlinsoftware.com/php-programming/oracle-lob-processing/

  • How to upload images in to custom table and display them in normal ABAP report?

    Hi Experts,
    Can anyone suggest me ,how to upload images into customised table and display thoes images in normal abap report.
    Thanks in Advance,
    Rgds,
    Anusha

    Hi Experts,
    Can anyone suggest me ,how to upload images into customised table and display thoes images in normal abap report.
    Thanks in Advance,
    Rgds,
    Anusha

  • How to upload Images to azure media services and show the image on on click on Link?

    Hi,
    I want to upload the image to the Azure media service asset and show the Link on the page. When use clicks on the Link I want to show it user. How can I implement this with C#? Now I am uploading the image to asset as in the normal way and getting the URL
    for that. But I am not able to show it user when he click on the image link.
    Thanks,
    Pavankuamr H K

    HI
    Azure media services has a RESTful service and a C# SDK that you can use to interact with the Azure Media Services.
    Here is the documentation and sample code for calling the Media services and using the SDK:
    https://msdn.microsoft.com/en-us/library/dn735908.aspx?f=255&MSPPError=-2147217396
    Aram Koukia | Blog: koukia.ca | Twitter:
    @aramkoukia

  • How to upload images to a DB and then view them in the site?

    Hi
    I have a form, and i want it to insert some data on a DB, so
    that the site can display that information. But i'm not able to
    upload images or files, because dreamweaver does not have a file
    upload option.
    I'm using PHP, can anyone help me on how to upload a image
    and display it on the web site?

    > I don't think its possible to store files in a
    > database.
    It is. But it's not a great way to do things.
    > store it's path in the DB
    Actually, what you want to store in the DB is the filename
    only. Put the
    path into the HTML. That way you don't have to change every
    record when you
    rename a folder.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "IndioDoido" <[email protected]> wrote in
    message
    news:e1rdmu$819$[email protected]..
    > Hi there!
    >
    > I don't want to upload a image to a DB...i want to
    upload it to a folder
    > but
    > store it's path in the DB. I don't think its possible to
    store files in a
    > database.
    > After the upload i want to display the image on the
    page, with its name
    > and
    > discription, in other words, with the information
    uploaded from the web
    > form
    > created with dreamweaver record insertion form.
    >

  • How to upload images to a Facebook page using the export module

    I'm trying to set up the export module for Facebook so I can upload my images.
    It works, but I want to upload them to a Page that I've created for my professional stuff not my personal account.
    Anyone have any ideas?
    Thanks
    Program: Bridge CS6
    Platform: Mac OS X 10.7.4

    Did you ever get a reply to how to upload your images to FB? I am wondering how to set the "services" to export to FB.
    Thank you.
    KaCe

  • How to upload images to any kind of server ?

    Hi all,
    I am developping a multiplatform j2me project which uploads images to any kind of servers ( operating systems ) , and I want to create directories, if possible in this situation, to put the image. How to achieve that ?
    Thank you very much indeed

    Hello,
    What you basically need is to have some sort of web application (for instance PHP or JSP) that receives the HTTP request coming from your mobile application, create the corresponding directories and saves the uploaded file.
    Have you worked out the upload process on the mobile end?

  • How to upload images into database.

    I have a employee table. I want to upload the image of the corresponding employee. How can we achieve this ??
    Edited by: Manjunath CN on Oct 14, 2008 2:15 PM

    Hi Manjunath,
    Please check Sikindar  post in  this link
    Photo Upload
    Tcode OAAD.
    Click on the Create button. Business object PREL and Docyment type HRICOLFOTO. Click on create (fill in the right personnel number in the pop up and click Continue).
    Choose the photo (as a JPG file) from the place where it is saved (e.g. hard disk). SAP will notify that the Stored Document was created succesfully.
    Photo is visible via PA10, PA20, PA30, PA40. Double-click to magnify photo.
    Best regards,
    raam

Maybe you are looking for