File to SAP Database using XI

Hi,
I am new to XI and doing a sample scenario.
The data from file is sent to RFC in SAP and RFC is updating Z tables.
I am facing the problem.
The file is read and I am monitoring the details in SXMB_MONI.
I could see the data content here. The data to be transferred.
The RFC is getting invoked but blank values are updated in my Z table.
There is no problem with the RFC or the insert query. I have checked it with manual execution.
Also if I hard code values in RFC, they are inserted successfully.
But values coming from file are not getting updated.
I think the values are not coming in the RFC.
However the success flag is seen in SXMB_MONI.
Can anyone help me out?
I cannot debug the RFC to check if the values are actually coming or not.
Would appretiate with points.
reagrds,

Hi,
if you changed the RFC many times (and imported again into repository)
restart XI (j2ee part at least)
you can also debug the RFC from XI - create an endless loop
inside your RFC and when XI will call it go inside via SM50
Regards,
michal

Similar Messages

  • How to upload the data from XML file to SAP database using IDOC

    Hi,
    I need some steps  to upload  data from XML format file from other directory to SAP database using IDOC.
    how to approch this please if any one knows give me ans
    it will be a great help ful to me
    Thanks in Advance
    Mallik

    Thank you vijay,
    But i heard that by using this Fun modules, when we are passing IDOC in back ground schedule,  so some other depended FM not supporting, so how to approach this and how to avoid this problem. 
    Have you worked on this before if any one worked on this please help me out
    And thank you once again for your valuable information
    Best Regards
    Mallik

  • Saving in sap database using kpro

    hie gurus, I'm configuring dms for the first time in ECC 6.0. I'm trying to store files in SAP DB using kpro however when I have created and checked  in originals  when i try to save the DIR i get an error that says error when trying to save with kpro. What could be the problem  ? please help.
    regards musi

    Hi Musiyandakarue 
    You have set Indicator Use KPRO in Define Document Types. So remonve this Selection.
    Please Go through these Links for your Problem.
    Storage of Data in Storage Systems Using the Knowledge Provider
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/8a/d31c34044611d3951d00a0c92f024a/content.htm
    Checking an Original Application File into the SAP Database
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/c1/1c27f743c711d1893e0000e8323c4f/content.htm
    This will clear your Problem.
    With Regards
    Mangesh Pande

  • How To Store pdf or doc file in Oracle Database using Java Jdbc?

    can any one help me out How To Store pdf or doc file in Oracle Database using Java Jdbc in JSP/Serlet? i tried like anything. using blob also i tried. but i am able 2 store images in DB not files. please if u know or else if u have some code like this plz send that to me, and help me out plz. i need that urgent.

    Hi.. i am not getting error, But i am not getting the original contents from my file. i am getting all ASCII vales, instead of my original data. here i am including my code.
    for Adding PDF in DB i used image.jsp
    Database table structure (table name. pictures )
    Name Null? Type
    ID NOT NULL NUMBER(11)
    IMAGE BLOB
    <%@ page language="java" import="java.util.*,java.sql.*,java.io.*" pageEncoding="ISO-8859-1"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%
    try{
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
         PreparedStatement ps,pstmt,psmnt;
         ps = con.prepareStatement("INSERT INTO pictures VALUES(?,?)");
    File file =
    new File("D:/info.pdf");
    FileInputStream fs = new FileInputStream(file);
    ps.setInt(1,4);
    ps.setBinaryStream(2,fs,fs.available());
    int i = ps.executeUpdate();
    if(i!=0){
    out.println("<h2>PDF inserted successfully");
    else{
    out.println("<h2>Problem in image insertion");
    catch(Exception e){
    out.println("<h2>Failed Due To "+e);
    %>
    O/P: PDF inserted successfully
    i tried to display that pdf using servlet. i am giving the code below.
    import java.io.IOException;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class DispPDF extends HttpServlet {
         * The doGet method of the servlet. <br>
         * This method is called when a form has its tag value method equals to get.
         * @param request the request send by the client to the server
         * @param response the response send by the server to the client
         * @throws ServletException if an error occurred
         * @throws IOException if an error occurred
         public void service(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              //response.setContentType("text/html"); i commented. coz we cant use response two times.
              //PrintWriter out = response.getWriter();
              try{
                   InputStream sPdf;
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                        Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
                        PreparedStatement ps,pstmt,psmnt;
                   psmnt = con.prepareStatement("SELECT image FROM pictures WHERE id = ?");
                        psmnt.setString(1, "4"); // here integer number '4' is image id from the table.
                   ResultSet rs = psmnt.executeQuery();
                        if(rs.next()) {
                   byte[] bytearray = new byte[1048576];
                        //out.println(bytearray);
                        int size=0;
                        sPdf = rs.getBinaryStream(1);
                        response.reset();
                        response.setContentType("application/pdf");
                        while((size=sPdf.read(bytearray))!= -1 ){
                        //out.println(size);
                        response.getOutputStream().write(bytearray,0,size);
                   catch(Exception e){
                   System.out.println("Failed Due To "+e);
                        //out.println("<h2>Failed Due To "+e);
              //out.close();
    OP
    PDF-1.4 %âãÏÓ 2 0 obj <>stream xœ+är á26S°00SIá2PÐ5´1ôÝ BÒ¸4Ü2‹ŠKüsSŠSŠS4C²€ê P”kø$V㙂GÒU×713CkW )(Ü endstream endobj 4 0 obj <>>>/MediaBox[0 0 595 842]>> endobj 1 0 obj <> endobj 3 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj xref 0 7 0000000000 65535 f 0000000325 00000 n 0000000015 00000 n 0000000413 00000 n 0000000168 00000 n 0000000464 00000 n 0000000509 00000 n trailer <<01b2fa8b70ac262bfa939cc786f8770c>]/Root 5 0 R/Size 7/Info 6 0 R>> startxref 641 %%EOF
    plz help me out.

  • Store and Display doc/pdf files in the database using Forms

    Hi all,
    How can i store and display doc/pdf files in the database using Forms 10g?.
    Arif

    How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
    Solution
    Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
    here are steps to get a small test form running, using WebUtil 1.06.
    Note: [OraHome] is used as an alias for your real oDS ORACLE_HOME.
    Feel free to copy this note to a text editor, and do a global find/replace on
    [OraHome] with your actual value (no trailing slash). Then it is easy to
    copy/paste actual commands to be executed from the note copy.
    1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
      and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
    2) Copy or move jacob.jar and jacob.dll
      [JacobStage] is the folder where you extracted Jacob, and will end in ...\jacob_18
         cd [JacobStage]
         copy jacob.jar [OraHome]\forms\java\.
         copy jacob.dll [OraHome]\forms\webutil\.
      The Jacob staging area is no longer needed, and may be deleted.
    3) Sign frmwebutil.jar and jacob.jar
      Open a DOS command prompt.
      Add [OraHome]\jdk\bin to the PATH:
         set PATH=[OraHome]\jdk\bin;%PATH%
      Sign the files, and check the output for success:
         [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\frmwebutil.jar
         [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\jacob.jar
    4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
      you may skip this step. Otherwise,
      Create a schema to hold the WebUtil stored code, and privileges needed to
      connect and create a stored package. Schema name "WEBUTIL" is recommended
      for no reason other than consistency over the user base.
      Open [OraHome]\forms\create_webutil_db.sql in a text editor, and delete or comment
      out the EXIT statement, to be able to see whether the objects were created witout
      errors.
      Start SQL*Plus as SYSTEM, and issue:
         CREATE USER webutil IDENTIFIED BY [password]
         DEFAULT TABLESPACE users
         TEMPORARY TABLESPACE temp;
         GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
         CONNECT webutil/[password]@[connectstring]
         @[OraHome]\forms\create_webutil_db.sql
         -- Inspect SQL*Plus output for errors, and then
         CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
      Reconnect as SYSTEM, and issue:
         grant execute on webutil_db to public;
    5) Modify [OraHome]\forms\server\default.env, and append [OraHome]\jdk\jre\lib\rt.jar
      to the CLASSPATH entry.
    6) Start the OC4J instance
    7) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
      Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
      It is important to generate the PLX, to avoid the FRM-40039 discussed in
      Note 303682.1
      If the PLX is not generated, the Webutil.pll library would have to be attached with
      full path information to all forms wishing to use WebUtil. This is NOT recommended.
    8) Create a new FMB.
      Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
      There is no need to Subclass the WebutilConfig object.
      Attach the Webutil.pll Library, and remove the path.
      Add an ON-LOGON trigger with the code
             NULL;
      to avoid having to connect to an RDBMS (optional).
      Create a new button on a new canvas, with the code
             show_webutil_information (TRUE);
      in a WHEN-BUTTON-PRESSED trigger.
      Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
    9) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
      the "Application Server URL" is empty.
      Then append "?config=webutil" at the end, so you end up with a URL of the form
          http://server:port/forms/frmservlet?config=webutil
    10) Run your form.sarah

  • How to upload a Flat file into sap database if the file is in Appl'n Server

    Hello Sap Experts , Can you tel me
    " How to upload a Flat file into sap database if the file is in Application Server.
    what is Path for that ?
    Plz Tel Me its Urgent
    Thanks for all

    Hi,
    ABAP code for uploading a TAB delimited file into an internal table. See code below for structures.
    *& Report  ZUPLOADTAB                                                  *
    *& Example of Uploading tab delimited file                             *
    REPORT  zuploadtab                    .
    PARAMETERS: p_infile  LIKE rlgrap-filename
                            OBLIGATORY DEFAULT  '/usr/sap/'..
    DATA: ld_file LIKE rlgrap-filename.
    *Internal tabe to store upload data
    TYPES: BEGIN OF t_record,
        name1 like pa0002-VORNA,
        name2 like pa0002-name2,
        age   type i,
        END OF t_record.
    DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
          wa_record TYPE t_record.
    *Text version of data table
    TYPES: begin of t_uploadtxt,
      name1(10) type c,
      name2(15) type c,
      age(5)  type c,
    end of t_uploadtxt.
    DATA: wa_uploadtxt TYPE t_uploadtxt.
    *String value to data in initially.
    DATA: wa_string(255) type c.
    constants: con_tab TYPE x VALUE '09'.
    *If you have Unicode check active in program attributes then you will
    *need to declare constants as follows:
    *class cl_abap_char_utilities definition load.
    *constants:
    *    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
    *START-OF-SELECTION
    START-OF-SELECTION.
    ld_file = p_infile.
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    ELSE.
      DO.
        CLEAR: wa_string, wa_uploadtxt.
        READ DATASET ld_file INTO wa_string.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                          wa_uploadtxt-name2
                                          wa_uploadtxt-age.
          MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
          APPEND wa_upload TO it_record.
        ENDIF.
      ENDDO.
      CLOSE DATASET ld_file.
    ENDIF.
    *END-OF-SELECTION
    END-OF-SELECTION.
    *!! Text data is now contained within the internal table IT_RECORD
    * Display report data for illustration purposes
      loop at it_record into wa_record.
        write:/     sy-vline,
               (10) wa_record-name1, sy-vline,
               (10) wa_record-name2, sy-vline,
               (10) wa_record-age, sy-vline.
      endloop.

  • Can we connect and access SAP database using db adapter?

    Hi,
    I need couple of details:
    1) Can we connect to SAP database using db adapter and run select query to extract data from the SAP database tables?
    2) Where can I download SAP adapter? How to install it? and how to plug that in to the JDev?
    Cheers

    1) Can we connect to SAP database using db adapter and run select query to extract data from the SAP database tables? It is possible as long as back-end DB version of SAP are supported by DB adapter. Oracle recommends SAP connectivity through Oracle Application Adapter for SAP rather than direct connection to SAP Database tables.
    2) Where can I download SAP adapter? How to install it? and how to plug that in to the JDev?http://www.oracle.com/technology/products/integration/adapters/pdf/DS_OracleASAdapter_SAP.pdf
    http://www.oracle.com/technology/software/htdocs/devlic.html?url=/technology/software/products/ias/htdocs/101202.html
    http://download.oracle.com/docs/cd/E12524_01/doc.1013/e14201/toc.htm (Installation)
    http://download.oracle.com/docs/cd/E12524_01/doc.1013/e14196/toc.htm (SAP adapter configurtation)
    Manoj

  • Uploading File into SAP Transaction using BSP

    Hi Everybody,
    I would like to know how to save the file into SAP Transaction thro BSP. I have one requirement,For example,the captured file from the web should be attached into the Equipment master (Transaction Code IE02).Its possible via SAP GUI.But i would like to know how it can be done from BSP.The same example applicable to sales order also..
    Also i wondering where these files get stored.
    Anybody could help me out of this issue please?...
    Naga Bokkisam

    You can do that using BDS..But you need to find the Business object to store it under Equipment Master or Sales order.
    Here is the example where i stored the document under Warranty process, ie sub set of Equipment master:
    Here BUS2222 is business object for Warranty Process:
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          BUFFER                = STR_FILE_CONTENT
        TABLES
          BINARY_TAB            = I_FILE_CONTENT.
      CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CREA_TAB'
        EXPORTING
          CLASSNAME             = 'BUS2222' "classname_select
          CLASSTYPE             = 'BO'" classtype_select
        CLIENT                = SY-MANDT
          OBJECT_KEY            = OBJECT_KEY
        BINARY_FLAG           = 'X'
        TABLES
          SIGNATURE             = I_SIGNATURE
          COMPONENTS            = I_COMPONENTS
        CONTENT               = I_FILE_CONTENT
    EXCEPTIONS
       NOTHING_FOUND         = 1
       PARAMETER_ERROR       = 2
       NOT_ALLOWED           = 3
       ERROR_KPRO            = 4
       INTERNAL_ERROR        = 5
       NOT_AUTHORIZED        = 6
       OTHERS                = 7     .
    Let me know if you need any detail..
    <i>*Reward each useful answer</i>
    Raja T

  • How to Load Multiple Files in Oracle Database using Sql Loader

    Hi All,
    I want to import multiple files in my DB using Sql*Loader. Please tell me the Syntax, how can I import multiple files using one Control File?
    Thanks & Regards,
    Imran

    Hi,
    You might get a good response to your post in the forum dedicated to data movement , including SQL*Loader . You can find it here Export/Import/SQL Loader & External Tables
    Regards,

  • Uploading Excel file into SAP Database table?

    I built a table in the SAP Data Dictionary, and i need to write a program that uploads the Excel table, into the SAP Database table.  Does anybody have a sample program that may help me?  Thanks!

    TYPES:
         BEGIN OF ty_upload,
         matnr like mara-matnr,
         meins like mara-meins,
         mtart like mara-mtart,
         mbrsh like mara-mbrsh,
         END OF ty_upload.
      DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH header line.
      DATA wa_upload TYPE ty_upload.
      DATA: itab TYPE STANDARD TABLE OF alsmex_tabline WITH header line.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename    = 'C:\Documents and Settings\venkatapp\Desktop\venkat.xls'
          i_begin_col = 1
          i_begin_row = 1
          i_end_col   = 4
          i_end_row   = 65535
          TABLES
          intern      = itab.
    if not itab[] is initial.
    loop at itab .
    case itab-col.
    when '0001'.
    it_upload-matnr = itab-value.
    when '0002'.
    it_upload-meins = itab-value.
    when '0003'.
    it_upload-mtart = itab-value.
    when '0004'.
    it_upload-mbrsh = itab-value.
    append it_upload.
    clear it_upload.
    clear itab.
    endcase.
    endloop.
    endif.
    loop at it_upload into wa_upload.
    ztable-matnr = wa_upload-matnr.
    ztable-meins = wa_upload-meins.
    ztable-mtart = wa_upload-mtart.
    ztable-mbrsh = wa_upload-mbrsh.
    insert ztable.
    endloop.

  • Upload data from multiple worksheets of excel file into SAP by using MIME?

    Hi all,
    I'm trying to getting the data from a multiple worksheet excel file by usin the MIME Repository.
    First of all i realizied it like [here|http://abap-explorer.blogspot.com/2008/12/upload-data-from-multiple-worksheets-of.html] in a normal ABAP Report.
    By trying to transfer the code to a WebDynpro Component, i get problems.
    With this part of code, because ActiveX is not allowed in our Webbrowser. So i have to find another solution to get the data from the excel file.
    CALL METHOD c_oi_container_control_creator=>get_container_control
    IMPORTING
    control = iref_control
    error   = iref_error
    I tried to rebuild this solution in webdynpro. But it dont works.
    So my next step was trying to Read the Excel sheet directly from MIME by getting the Content (XString).
    But there is no useful information Just a mix out of '######' and other symbols.
    By converting it into String the same problem.
    Maybe someone has an idea how to rebuild [this code|http://abap-explorer.blogspot.com/2008/12/upload-data-from-multiple-worksheets-of.html] in Webdynpro that it works correctly.
    Currently Im Using the Fileupload UI Element. All Works fine. I can Upload the Excel file to MIME Repository and i can open it from there.
    But i cant get the same clear informationen from the file, to write it later in a Database, like before without webdynpro.
    i hope someone can help me.
    Edited by: Sascha Baumann on Apr 20, 2009 4:28 PM

    You can't read the native binary Excel Format in server side ABAP.  The functions and classes that did this in Classic Dynpro used OLE Automation via the SAPGUI Control Framework to remotely control Excel to read the data.  Because in the browser you have no connection to the SAPGUI or are sandboxed inside the browser; the same functionality is not possible. 
    I would suggest that you look into saving the Excel file as a open, text format.  You might be able to use XML (although the Excel XML format can be complex) to support multiple sheets. You would have to build the logic yourself (using XSLT or the iXML parser) to process the XML format back into ABAP data.

  • Playing a video file retrieved from database using JMF

    Hello!
    I am developing a multimedia application that has to store videos, music, pictures in a database. I did a little searching and found that JMF is a very good solution in playing video/music using Java. I found some examples to play the video/music stored on the hard drive (as separate files), but i have to be able to take the video/music from the database, and feed it to the JMF player. Has anyone some suggestions about how this could be done?
    Thanks in advance!
    Edited by: radu.miron on May 8, 2008 9:03 AM

    Well, i think i didn't make myself clear enough :). i know how to retreive the data from the database. The thing is this: let's suppose i have a 700 MB movie stored in the database. One option to play that movie would be to retrieve it from the DB, create a file somewhere on the disk, and put the data retrieved from the database in that file. But this involves that the disk will be overflooded when let's say 100 people watch 100 different movies. Another option (as i see it) would be to gradually take parts of the movie from the database (first 50 MB, then another 50 MB, then another and so on), and feed it to the JMF player. The user will watch the movie, but will not have the whole movie available, just a part of it. As he watches it, the application takes the next chunck of movie data and feeds it to the JMF player. That was the question i intended to ask, if anyone has any idea regarding the second option, and not the part with retrieving from the database, but the part with giving the JMF player video data to play.
    The example i found on the web with JMF player is the following:
    import javax.swing.*;*
    *import javax.media.*;
    import java.awt.*;*
    *import java.awt.event.*;
    import java.net.*;*
    *import java.io.*;
    public class PlayVideo extends JFrame {
         Player player;
         Component center;
         Component south;
         public PlayVideo() {
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              JButton button = new JButton("Select File");
              ActionListener listener =
                   new ActionListener() {
                   public void actionPerformed(
                             ActionEvent event) {
                        JFileChooser chooser =
                             new JFileChooser(".");
                        int status =
                             chooser.showOpenDialog(PlayVideo.this);
                        if (status ==
                             JFileChooser.APPROVE_OPTION) {
                             File file = chooser.getSelectedFile();
                             try {
                                  load(file);
                             } catch (Exception e) {
                                  System.err.println("Try again: " + e);
              button.addActionListener(listener);
              getContentPane().add(button,
                        BorderLayout.NORTH);
              pack();
              show();
         public void load(final File file)
         throws Exception {
              URL url = file.toURL();
              final Container contentPane =
                   getContentPane();
              if (player != null) {
                   player.stop();
              player = Manager.createPlayer(url);
              ControllerListener listener =
                   new ControllerAdapter() {
                   public void realizeComplete(
                             RealizeCompleteEvent event) {
                        Component vc =
                             player.getVisualComponent();
                        if (vc != null) {
                             contentPane.add(vc,
                                       BorderLayout.CENTER);
                             center = vc;
                        } else {
                             if (center != null) {
                                  contentPane.remove(center);
                                  contentPane.validate();
                        Component cpc =
                             player.getControlPanelComponent();
                        if (cpc != null) {
                             contentPane.add(cpc,
                                       BorderLayout.SOUTH);
                             south = cpc;
                        } else {
                             if (south != null) {
                                  contentPane.remove(south);
                                  contentPane.validate();
                        pack();
                        setTitle(file.getName());
              player.addControllerListener(listener);
              player.start();
         public static void main(String args[]) {
              PlayVideo pv = new PlayVideo();
    }but this example plays a video stored on the disk ( player = Manager.createPlayer(url); ), rather than a chunck of data (the whole movie or parts of it) retrieved from the database.
    Sorry for the misunderstanding!
    Cheers!

  • Inserting a pdf file in mysql database using jdbc

    hi guys,
    i'm developing an application, where i have to upload the documents and store it in the database.
    i'm using mysql db. using the jdbc statements i have stored the contents of the pdf file. But, i'm unable to read the content, it's looks like junk values. and when i retrieved using the stream objects. it looks like the same.
    i'm able to store and retrieve the text based and image files.
    is it possible to store pdf and word documents in the database columns directly??
    any ideas are appreciated.
    thanks in advance,
    -bala

    This may help[
    Table example
    DROP TABLE IF EXISTS `employeephoto`;
    CREATE TABLE `employeephoto` (
    `Employee_ID` varchar(15) NOT NULL default '',
    `Binary_Photo` mediumblob NOT NULL,
    `LastUser` varchar(100) NOT NULL default '',
    `LastMod` datetime NOT NULL default '0000-00-00 00:00:00',
    `Created` datetime NOT NULL default '0000-00-00 00:00:00',
    PRIMARY KEY (`Employee_ID`)
    ) TYPE=MyISAM;
    Save photo as jpeg to database
    public static void saveMySqlPhoto(String empID, ImageIcon icon) {
      try {
        Image image = icon.getImage();
        BufferedImage bImage = new BufferedImage(image.getWidth(null),image.getHeight(null),BufferedImage.TYPE_INT_RGB);
        Graphics bg = bImage.getGraphics();
        bg.drawImage(image,0,0,null);
        bg.dispose();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ImageIO.write(bImage,"jpeg",out);
        byte[] buf = out.toByteArray();
        // setup stream for blob
        ByteArrayInputStream inStream = new ByteArrayInputStream(buf);
        // get or create a connection here
        Connection photoConnection = startup.connectionPool.getConnection();
        sqlStatement = "insert into employeephoto (Employee_ID,Binary_Photo,LastUser,LastMod,Created) values ('"+empID+"', ?, '"+startup.User+"', NOW(), NOW())";
        ps = photoConnection.prepareStatement(sqlStatement);
        ps.setBinaryStream(1,inStream,inStream.available());
        ps.executeUpdate();
        // release or close connection here
        startup.connectionPool.releaseConnection(photoConnection);
      catch (Exception exc) {
        // process error
    }Retrieve photo from database
    public static ImageIcon getMySqlPhoto(String employeeID){
      ImageIcon dPhoto = null;
      // get or create a connection here
      Connection photoConnection = connectionPool.getConnection();
      String sqlStatement = "select Binary_Photo from employeephoto where Employee_ID = '"+employeeID+"'";
      try {
        ResultSet rs = photoConnection.createStatement().executeQuery(sqlStatement);
        if (rs.next()){
          Blob image = rs.getBlob("Binary_Photo");
          // setup the streams
          InputStream input = image.getBinaryStream();
          ByteArrayOutputStream output = new ByteArrayOutputStream();
          // set read buffer size
          byte[] rb = new byte[1024];
          int ch = 0;
          // process blob
          while ((ch=input.read(rb)) != -1){
            output.write(rb, 0, ch);
          byte[] b = output.toByteArray();
          input.close();
          output.close();
          // load final buffer
          dPhoto = new ImageIcon(b);
        rs.close();
      catch (Exception exc) {
        // do error processing
      // release or close connection here
      connectionPool.releaseConnection(photoConnection);
      return dPhoto;
    public byte[] toByteArray(int width, int height, BufferedImage imageBuff) throws java.io.IOException{
      BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
      bi.getGraphics().drawImage(imageBuff, 0, 0, null);
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
      JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bi);
      param.setQuality(1.0f, false);
      encoder.setJPEGEncodeParam(param);
      encoder.encode(bi);
      return out.toByteArray();
    }rykk

  • I want to upload files in  sap-directories using  webdynpro abap.

    My requirement is i need to read the filess from the local system in a  folder and save those files in the sap directories(AL11).Need help .
    Thanks.

    Hi Dear,
    U have to use File upload UI element , then read the file then  follow the code for transfering into SAP directories:
    check this 
    *Declare T_UPLOAD , W_UPLOAD  itab  and  wa with your file heading structure
    DATA:L_LINE TYPE STRING.
      P_FLNAME = 'Test123'. " file name
    OPEN DATASET P_FLNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    CHECK SY-SUBRC = 0.
    LOOP AT T_UPLOAD INTO W_UPLOAD.
      CONCATENATE W_UPLOAD-Field1
                  W_UPLOAD-Field2
                  W_UPLOAD-Field3
                  W_UPLOAD-Field4
                  W_UPLOAD-Field5
                  INTO L_LINE
                  SEPARATED BY ','.
    TRANSFER L_LINE TO P_FLNAME.
    ENDLOOP.
    CLOSE DATASET P_FLNAME.
    I think it may help u a lot..
    Regards
    Aisurya

  • File to SAP (IDoc) using XI

    Hi,
    I am trying to create an IDoc (Order) in SAP R/3 system based the file I receive. I am getting the following error
    <b><?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIAdapter</SAP:Category>
      <SAP:Code area="IDOC_ADAPTER">ATTRIBUTE_IDOC_RUNTIME</SAP:Code>
      <SAP:P1>Transaction IDX1: Port XI_00_800, client , RFC destination contain errors</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error: Transaction IDX1: Port XI_00_800, client , RFC destination contain errors</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error></b>
    Could someone help me in resolving this error. Also Why IDX1 is showing up here for receiver IDoc Adapter? Other info: In my SAPE15 (SAP R/3) communication channel the receiver IDoc adapter has the following info. RFC Destination: T90XLNT090 (defined in XI-SM59-R/3 Connections, pointing to R/3 server), Port: XI_00_800 defined in R/3-WE21-Transactional RFC-XI_00_800 points to XI server. No identifiers nor modules, selected Apply control record values from payload. Everthing else seems to be OK. If required I can provide more information.
    Looking forward for response,
    Thanks and Regards,
    Jagadish.

    hI,
      There might be a port issue as the error is attached to "Port XI_00_800".
    Try this link :
    IDX1
    (reply from Christine)
    And use this link from sap
    http://help.sap.com/saphelp_nw04/helpdata/en/3b/beb13b00ae793be10000000a11402f/content.htm
    Regards,
    Anirban.

Maybe you are looking for

  • Process empty file : file (fcc) to rfc

    Hi Experts, I have a scenario where. I have to process files and send it to rfc.. file to rfc scenario... now basically.. when the file is empty the content conversion does not produce any payload and throws error.. can u pls help me in this?

  • BPM - BPE_ADAPTER : Unknown message Type

    Hello Experts, I am developing a simple BPM scenario with just one receive and one send step. I have configured bothl the BPM steps along with the container elements and verified the objects in IR and ID. In SXI_CACHE the status of teh Integartion Pr

  • Override cannot be resolved to a type

    Hello there, I have installed 32-bit and 64-bit versions of the JDK But my path is pointing at the 32-bit version. Moreover in the eclipse IDE, I have set the JRE environment variable pointing at the 32-bit jre6. I have also tried jre7 to no avail. B

  • Has anybody else experienced problem saving scanned documents since installing Mavericks.

    I have just scanned a document on Macbook Pro, it is a recipe, I have dozens of recipes scanned to Recipes folder. Now, there seems to be no option to Save the document after scanning.

  • The jdbcTable.jsp example with Sybase database??

    Hi there,           Does anyone got the jdbcTable.jsp example working with Sybase           jConnect?           Thank you