To upload file and save it in a location

Hi,
I need to upload an image file in database. and also save a copy of this uploaded image file in a particular location. If updating the image file, then i need to remove the previous image file and save the new one against a particular record.
I did to upload. i want to save a new file and remove the previous file. how to do this?
Thanks in advance

Hi,
Hope this help
https://cn.forums.oracle.com/forums/thread.jspa?threadID=983109
ADF Faces Intermedia image upload and Display
http://baigsorcl.blogspot.com/2010/08/uplaoding-and-downloading-images-in.html
http://baigsorcl.blogspot.com/2010/09/store-images-in-blob-in-oracle-adf.html
~Abhijit

Similar Messages

  • Read multiple files and save all into one output file(AGAIN)

    Hi, guys
    I need your help for reading data from multiple files and save the results into one output file. When files are selected from file chooser, my program read the data line by line , do some calculations and save the result into the output. I made an array to store input files and it seems to be working fine, but when it comes to SaveFile() function, issues NullPointException message.
    public class FileReduction1 extends JFrame implements ActionListener
       // GUI definition and layout
        /* ACTION PERFORMED */
        public void actionPerformed(ActionEvent event) {
            if (event.getActionCommand().equals("Open File")) getFileName();
        /* OPEN THE FILE */
        private void getFileName() {
            // Display file dialog so user can select file to open
         JFileChooser fileChooser = new JFileChooser();
         fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            fileChooser.setMultiSelectionEnabled(true);
         int result = fileChooser.showOpenDialog(this);
         // If cancel button selected return
         if (result == JFileChooser.CANCEL_OPTION) return;
            if (result == JFileChooser.APPROVE_OPTION)
             files = fileChooser.getSelectedFiles();
                textArea.setText("");
                if(files.length>0)
                    filelist="";
                    System.out.println("files length"+files.length);
                    for(int i=0;i<files.length;i++)
                         System.out.println(files.getName());
    filelist+=files[i].getName()+" ,";
    if (checkFileName(files[i]) )
    openButton.setEnabled(true);
    readButton.setEnabled(true);
    textArea.append("file "+files[i].getName()+"is a proper file"+"\n");
    readFile(files[i]);
    textfield.setText(filelist);
    else{JOptionPane.showMessageDialog(this,"Please select file(s)",
                    "Error 5: ",JOptionPane.ERROR_MESSAGE); }
         // Obtain selected file
    /* READ FILE */
    private void readFile(File fileName_in) {
    // Disable read button
    readButton.setEnabled(false);
    // Dimension data structure
         getNumberOfLines(fileName_in);
         data = new String[numLines][4];
         // Read file
         readTheFile(fileName_in);
         // Rnable open button
         openButton.setEnabled(true);
    /* GET NUMBER OF LINES */
    /* Get number of lines in file and prepare data structure. */
    private void getNumberOfLines(File fileName_in) {
    int counter = 0;
         // Open the file
         openFile(fileName_in);
         // Loop through file incrementing counter
         try {
         String line = fileInput.readLine();
         while (line != null) {
         counter++;
              System.out.println("(" + counter + ") " + line);
    line = fileInput.readLine();
         numLines = counter;
    closeFile(fileName_in);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile(fileName_in);
         System.exit(1);
    /* READ FILE */
    private void readTheFile(File fileName_in)
    // Open the file
    //int row=0;
    int col=0;
    openFile(fileName_in);
    System.out.println("Read the file");
    // Loop through file incrementing counter
    try
    String line = fileInput.readLine();
    while (line != null)
    boolean containsDoubles = false;
    double temp;
    String[] lineParts = line.split("\t");
    try
    for (col=0;col<lineParts.length;col++)
    temp=Double.parseDouble(lineParts[col]);
    data[row][col] = lineParts[col];
    containsDoubles = true;
    System.out.print("data["+row+"]["+col+"]="+lineParts[col]+" ");
    } catch (Exception e) {row=0; col=0; temp=0.0;}
    if (containsDoubles){ row++;}
    System.out.println();
    line = fileInput.readLine();
    catch(IOException ioException)
    JOptionPane.showMessageDialog(this,"Error reading File", "Error 5: ",JOptionPane.ERROR_MESSAGE);
    closeFile(fileName_in);
    System.exit(1);
    //System.out.println("length"+data.length);
    closeFile(fileName_in);
    process(fileName_in);
    /* CHECK FILE NAME */
    /* Return flase if selected file is a directory, access is denied or is
    not a file name. */
    private boolean checkFileName(File fileName_in) {
         if (fileName_in.exists()) {
         if (fileName_in.canRead()) {
              if (fileName_in.isFile()) return(true);
              else JOptionPane.showMessageDialog(null,
                        "ERROR 3: File is a directory");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 2: Access denied");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 1: No such file!");
         // Return
         return(false);
    /* OPEN FILE */
    private void openFile(File fileName_in) {
         try {
         // Open file
         FileReader file = new FileReader(fileName_in);
         fileInput = new BufferedReader(file);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
         textArea.append("OPEN FILE\n---------\n");
         textArea.append(fileName_in.getPath());
         textArea.append("\n");
         //System.out.println("File opened successfully");
    /* CLOSE FILE */
    private void closeFile(File fileName_in) {
    if (fileInput != null) {
         try {
              fileInput.close();
         catch (IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File closed");
    private void process(File fileName_in) {
    //getNumberOfLines();
         //data = new String[numLines][3];
         // Read file
    double temp,temp1;
         //readTheFile();
    //System.out.println("row:"+row);
    //int number=data.length;
    //System.out.println(number);
    for (int i=0; i<row; i++)
    temp=Double.parseDouble(data[i][1]);
    sumx+=temp;
    temp1=Double.parseDouble(data[i][3]);
    sumy+=temp1;
    multixy+=(temp*temp1);
    square_x_sum+=(temp*temp);
    square_y_sum+=(temp1*temp1);
    //System.out.println("Sum(x)="+sumx);
    double tempup=(row*multixy)-(sumx*sumy);
    double tempdown=(row*square_x_sum)-(sumx*sumx);
    slope=tempup/tempdown;
    double tempbup=sumy-(slope*sumx);
    intb=tempbup/row;
    double tempside=(row*square_y_sum)-(sumy*sumy);
    double cordown=Math.sqrt(tempdown*tempside);
    corr=tempup/cordown;
    r_sqrt=corr*corr;
         textArea.append("Data for file"+ fileName_in.getName()+" have been processed successfully.");
         textArea.append("\n");
         textArea.append("Please enter output file name including extension.");
    System.out.println("number"+row);
    System.out.println("slope(m)="+slope);
    System.out.println("intecept b="+intb);
    System.out.println("correlation="+corr);
    System.out.println("correlation="+r_sqrt);
    saveFile();
    private void saveFile()
    textArea.append("SAVE FILE\n---------\n");
    if (openFile1())
         try {
              outputToFile();
    catch (IOException ioException) {
              JOptionPane.showMessageDialog(this,"Error Writing to File",
                   "Error",JOptionPane.ERROR_MESSAGE);
    private boolean openFile1 ()
         // search for the file path
    StringBuffer stringpath;
    title=textfield1.getText().trim();
    int temp=fileName_in.getName().length();
    int temp_path=fileName_in.getPath().length();
    int startd=(temp_path-temp);
    stringpath=new StringBuffer(fileName_in.getPath());
    stringpath.delete(startd, temp_path+1);
    //System.out.println("file-path="+temp_path);
    //System.out.println("length-file="+temp);
    path=stringpath.toString();
    fileName_out = new File(path, title);
    //System.out.println(file_out.getName());
    if (fileName_out==null || fileName_out.getName().equals(""))
         JOptionPane.showMessageDialog(this,"Invalid File name",
                   "Invalid File name",JOptionPane.ERROR_MESSAGE);
         return(false);
         else
    try
    boolean created = fileName_out.createNewFile();
    if(created)
    fileOutput = new PrintWriter(new FileWriter(fileName_out));
    fileOutput.println("File Name"+"\t"+"Slope(m)"+"\t"+"y-intercept(b)"+"\t"+"Coefficient(r)"+"\t"+"Correlation(R-Squared)");
    return(true);
    else
    fileOutput = new PrintWriter(new FileWriter(fileName_out,true));
    return(true);
    catch (IOException exc)
    JOptionPane.showMessageDialog(this,"Please enter the file name","Error",JOptionPane.ERROR_MESSAGE);
    return(false);
    private void outputToFile() throws IOException
    // Initial output
         textArea.append("File name = " + fileName_out + "\n");
         // Test if data exists
         if (data != null)
         fileOutput.println(fileName_in.getName() +"\t"+ slope+"\t"+intb+"\t"+corr+"\t"+r_sqrt);
    textArea.append("File output complete\n\n");
         else
    textArea.append("No data\n\n");
         // End by closing file
    initialcomp();
         fileOutput.close();
    private void initialcomp()
    slope=0.0;
    intb=0.0;
    corr=0.0;
    r_sqrt=0.0;
    sumx=0.0; sumy=0.0; multixy=0.0; square_x_sum=0.0; square_y_sum=0.0;
    for(int i=0;i<data.length;i++)
    for(int j=0;j<data[i].length;j++)
    data[i][j]=null;
    /* MAIN METHOD */
    public static void main(String[] args) throws IOException
         // Create instance of class FileChooser
         FileReduction1 newFile = new FileReduction1("File Reduction Program");
         // Make window vissible
         newFile.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         newFile.setSize(500,400);
    newFile.setVisible(true);
    Sorry about the long lines.
    As you can see, all input files saved in array called files, however when OpenFile1() function is called, it take input (fileName_in) as a single file not an array. I'm assuming this causes the exception.
    When there's muptiple inputs, program should take each file from getFileName() to outputToFile() sequentially.
    Does anybody have an idea to solve this?
    Thanks a lot!!

    you naming convention is confussing. you should follows Java naming convention..you have a getXXX but decalred the return type as "void"...get usully means to return something...
    your code is doing too much..and hard to follows..
    1. get the selected files
    for each selected file
    process the file and return the result
    write out the result.
    /** close the precious resource */
    public void closeResource(Reader in){
        if (in != null){
            try{ in.close(); }
            catch (Exception e){}
    /** get the total number of line in a file */
    public int getLineCount(File file) throws IOException{
        BufferedReader in = null;
        int lineCount = 0;
        try{
            in = new BufferedReader(new FileReader(file));
            while ((in.readLine() != null)
                lineCount++;
            return lineCount;
        finally{ closeResource (in);  }
    /** read the file */
    public void processFile(File inFile, File outFile) throws IOException{
        BufferedReader in = null;
        StringBuffer result = new StringBuffer();
        try{
            in = new BufferedReader(new FileReader(inFile));
            String line = null;
            while ((in.readLine() != null){
                .. do something with the line
                result.append(....);
            writeToFile(outFile, result.toString());
        finally{ closeResource (in);  }
    public void writeToFile(File outFile, String result) throws IOException{
        PrintWriter out = null;
        try{
            out = new PrintWriter(new FileWriter(outFile, true));  // true for appending to the end of the file
            out.println(result);
        finally{  if (out != null){ try{ out.close(); } catch (Exception e){} }  }
    }

  • Which Version of Adobe do I need to be able to "extract" a page from a existing  file and save/download to another file?

    Which Version of Adobe do I need to be able to "extract" a page from a existing  file and save/download to another file?

    Acrobat Pro or Standard.

  • How to use cfdocument  create a PDF file and save the file in server?

    Hi,
    I want to use cfdocument to create a PDF file and save it in
    the server for other people to download,can you give me a idea how
    to do this.Thanks.
    <cfdocument format = "PDF" pagetype="A4"
    orientation="portrait">
    </cfdocument>
    Mark

    Hi
    <cfdocument filename="" format = "PDF" pagetype="A4"
    orientation="portrait">
    </cfdocument>
    Give the physical path to the filename. You have write
    permission for this folder to create a PDF file.

  • How to upload file and show it's progress

    hi
    i want to upload files and show the progress of the upload
    process how?
    thanks in advance.

    Hey,
    I attached a sample I did in Flash 8 using PHP. Hope it
    helps.
    http://www.cybercussion.com/vault/fileuploading.zip

  • When I upload files and correct in lightroom then I export to another named file I keep getting two duplicates. numbered 1 and 2. this never happened before

    When I upload files and correct in lightroom then I export to another named file I keep getting two duplicates. numbered 1 and 2. this never happened before

    When I first upload to lightroom I set up a file called new photos. When I correct them I export to a newly named file. But when I go to the newly named
    File on my harddrive there are duplicate files
    Stan

  • What steps do I take to edit raw files and save for web use, such as Instagram, Facebook, Websites, and emailing?

    What Steps do I take to edit raw files and save for web use, such as Instagram, Facebook, Websites, and emailing?

    When you open a raw file it will open in Adobe camera raw. That is where you can do most of the editing. Then it will be placed inside Photoshop where you can do more if needed.
    Now you can use the save for web dialog to export your image as a png or jpg to use on those sites.

  • Reinstalling AE and PP due to an error with dynamic link. Where do i find the program install? And tips on how to reinstall without messing things up? last question is, does my recent files and saves work after the reinstall?

    I have allready bought the programs, but need to reinstall AE and PP due to an error with dynamic link.
    Where do i find the program install?
    And tips on how to reinstall without messing things up?
    last question is, does my recent files and saves work after the reinstall?
    Thank you

    karianne wrote:
    I have allready bought the programs, but need to reinstall AE and PP due to an error with dynamic link.
    Where do i find the program install?
    Which versions? Which operating system?
    Try Download and Installation Help

  • How to tell script colse all files and save, but no untitle docs

    Hi everyone 
    I want to colse the open files and save them but no those files which have never been saved.
    I try this script but after ran, all the files are no be saved.
            var docs = app.documents;
                 for (var i = docs.length-1; i >= 0; i--) {
                     if(app.activeDocument.saved == false){
                           docs[i].close(SaveOptions.NO);
                     else if(docs[i].close(SaveOptions.YES));
    can someone tell me what's wrong with the script?
    thanks
    Regard
    Teetan

    var docs = app.documents;
    for (var i = docs.length-1; i >= 0; i--) {
        if (docs[i].saved == false) {
            docs[i].close(SaveOptions.NO);
        else {
            docs[i].close(SaveOptions.YES);

  • File upload using commons-upload-file and tomcat 5.5

    Hi,
    This is my first post and I hope that I post it at the right place.
    I'm trying to upload a file using commons-upload-file and tomcat 5.5.
    Is there a way to prevent submitting a big file, If I detect that the file being uploaded exceed a limit that I have fixed ?
    i.e. I check the request length, if it's bigger than 1meg I cancel the whole thing and the big file is not transferred.
    The problem that I get at the moment is that it seems that the file is transferred even if I close request inputstream or response outputstream. Any help would be appreciated !
    Thank you
    Redgy

    Well here is a snippet of my code:
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            long maxSize = 50000;
            boolean isMultipart = ServletFileUpload.isMultipartContent(request);
            if(isMultipart){
                // Create a new file upload handler
                ServletFileUpload upload = new ServletFileUpload();
                upload.setSizeMax(maxSize);
                try {
                    upload.parseRequest(request);
                } catch (FileUploadException ex) {
                    ex.printStackTrace();
                    request.getInputStream().close();
                    response.getWriter().print("blah");
                    response.sendError(response.SC_INTERNAL_SERVER_ERROR);
                    response.getOutputStream().close();
        }If the file is bigger than 50kb, it Throws the FileUploadException.
    But whatever I do, It seems that there is still a connection between my browser and tomcat.. any clue ?
    thanks
    Edited by: redgyx on Jan 31, 2008 6:17 AM

  • HT4599 How do I upload photos from PC to icloud - loaded into upload file and does not seem to upload

    How do I upload photos from PC to icloud.  I have already moved photos to icloud upload file and nothing seems to upload.  jnelso1

    I have this problem too. Photo stream works fine on iPhone+iPad, but the photos are never loaded to my PC (Win 8.1). My shared folders works fine on iOS and PC, but not My photo stram.
    In the beginning, a couple of years ago, it work, but not now (2014).
    All iOS are updated, and PC-iCloud software/panel is Active, and Photo stream is activated.
    What to do??
    Reset all streams on PC? I tried, no result.
    I can understand that it takes time to reload all Pictures from iCload to my PC, but I wait Days, weeks...

  • Using ABAP Webdynpr How to Upload File and download file in SAP R/3

    Hi SAP GURUS ,
                             I wanted to save employee profile from ESS to SAP so i am creating ESS Application .
    For that I go with BDS Approach and create test program for this  I got success while uploading file in my folder
    which i have created with the help of class and content repository . but when i Using ABAP Webdynpro , i got error FM "BDS_BUSINESSDOCUMENT_CREATEF"  message " error_kpro " .
                           Also I wanted to use KM for storage of Documents and wanted to retrive with help of ABAP Webdynpro .
                           So pls tell me / mailed me the process , approach and if you have examples .
        Thanks in Advance ,
         Vishwassap at gmail

    Hi Vishwas,
    Check out the thread [Efficient way of saving documents uploaded|Re: Efficient way of saving documents uploaded by users; and check the blog by Raja Thangamani.
    Also check the thread [Export Images through Function Modules   |Export Images through Function Modules;.
    Hope it helps you.

  • How to sign a pdf file and save it directly back to sharepoint site?

    Hello,
    I own a Sharepoint site for testing. It is installed in my computer with Sharepoint 2010 (WSS). What I want to do is to find a way to achieve a signing function for pdf file type on sharepoint.
    By refer to this site below, the site has been able to recognize pdf file type and open it and edit it directly on the sharepoint site.
    http://www.portalsolutions.net/Blog/Lists/Posts/Post.aspx?ID=40
    I can edit the pdf file by checking out and then the modification will be save directly back to the pdf file in the shared document library when I am done. Now the problem is, I cannot save the pdf directly back to sharepoint after I inserted a digital signature
    to the pdf file.
    Everytime I inserted a digital signature to the pdf file, a "save as..." window would pop up and asked me to save the signed pdf file as another file in my local computer, so the changes were not applied to the original pdf file on the shared document library
    of my sharepoint site. I have to upload the local signed version back to the site and replace the old one manually.
    Any suggestion? Thank you.
    Mengxin Wu

     
    Hi,
    According to my analysis, for Digital Signatures: Adobe has changed the behavior around digital signatures and SharePoint-hosted PDF files. Now, when digitally signing a SharePoint-hosted PDF file, it will be saved directly to SharePoint if that PDF file
    is already checked out. If not, the user will be prompted to check it out. When digitally signing a SharePoint-hosted PDF file in Acrobat X, Version 10.0, the user would be prompted to save that file locally and would then need to upload it separately to SharePoint
    as a new version.
    I suggest that you use Acrobat X, then check the result. For more information about Acrobat X, please refer to
    http://blogs.adobe.com/pdfitmatters/2011/06/whats-new-in-acrobat-x-version-10-1.html
    In addition, you can also consider the following third-party tool:
    http://www.arx.com/digital-signature/sharepoint
    Thanks,
    Rock Wang

  • Upload file and link to sales order in SAP via rfc (C#)

    Hello all,
    In my company we have the possibility to attach files to sales orders, e.g. pdf files with the printing details.
    These files are added by the GUI user, this works fine.
    Now we have an extra order creation stream in which a pdf file has to be added to the SO without user interaction.
    In a previous question I had a little question about the linking, that has been solved, I will post the test program later.
    I now can link front end files (pdf's in this case) to the sales orders and it works fine.
    Now we are developing a frontend in C# (build by a third party) which creates a sales order via a RFC. We also want that RFC to include the PDF file and link it to the created order.
    In the interface of the RFC I included a table with 255 char lines. That is the same as in the example program. the problem is that our partner is yet unable to fill the interface in exact the same way as the example program does, so the linked pdf file is corrupted.
    Does anyone have hints how C# should fill the interface table, or how I can change the interface?
    code snippid table declaration for pdf table:
    IT_PDF     LIKE     ZETEX_TAB_PDF
    and
    structure ZETEX_TAB_PDF consists of
    LINE     CHAR255
    the sample program (see other topic on where I got it)
    REPORT  zzfb_brc LINE-SIZE 260.
    * Report  Z_RMTIWARI_ATTACH_DOC_TO_BO
    * Written By : Ram Manohar Tiwari
    * Function   : We need to maintain links between Business Object and
    *              the attachment.Attachment document is basiclally a
    *              business object of type 'MESSAGE'.In order to maintain
    *              links, first the attachment will be crated as Business
    *              Object of type 'MESSAGE' using Message.Create method.
    *              Need to check if we can also use FM
    *              'SO_DOC_INSERT_WITH_ORIG_API1' or SO_OBJECT_INSERT rather
    *              than using Message.Create method.
    * I took this program and removed all the parts for adding URL's and
    * notes.
    * Include for BO macros
    INCLUDE : <cntn01>.
    * Load class.
    CLASS cl_binary_relation DEFINITION LOAD.
    CLASS cl_obl_object      DEFINITION LOAD.
    PARAMETERS:
    *  Object_a
       p_botype LIKE obl_s_pbor-typeid DEFAULT 'BUS2032',    "SO
       p_bo_id  LIKE obl_s_pbor-instid DEFAULT '0000757830', "example number
    *  Object_b
       p_docty  LIKE obl_s_pbor-typeid DEFAULT 'MESSAGE' NO-DISPLAY,
       p_msgtyp LIKE sofm-doctp        DEFAULT 'EXT'     NO-DISPLAY,
    *  Relationship
       p_reltyp  LIKE mdoblrel-reltype DEFAULT 'ATTA'.
    TYPES: BEGIN OF ty_message_key,
            foltp     TYPE so_fol_tp,
            folyr     TYPE so_fol_yr,
            folno     TYPE so_fol_no,
            doctp     TYPE so_doc_tp,
            docyr     TYPE so_doc_yr,
            docno     TYPE so_doc_no,
            fortp     TYPE so_for_tp,
            foryr     TYPE so_for_yr,
            forno     TYPE so_for_no,
           END OF ty_message_key.
    DATA : lv_message_key TYPE ty_message_key.
    DATA : lo_message TYPE swc_object.
    DATA : lt_doc_content TYPE STANDARD TABLE OF soli-line,
           ls_doc_content TYPE soli-line.
    * Create an initial instance of BO 'MESSAGE' - to call the
    * instance-independent method 'Create'.
    swc_create_object lo_message 'MESSAGE' lv_message_key.
    * Upload the pdf file, for now from the frontend, in the future from
    * the server.
    DATA:
    *  dsn(40) TYPE C VALUE '/usr/sap/trans/convert/1.pdf', "server location
    l_lines TYPE i. "filelenght
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename   = 'c:tsimple.pdf'
        filetype   = 'BIN'
      IMPORTING
        filelength = l_lines
      TABLES
        data_tab   = lt_doc_content.
    * no exceptions, the file is there in this example
    clear l_lines.
    loop at lt_doc_content into ls_doc_content.
    l_lines = l_lines + 255.
    endloop.
    compute l_lines =   l_lines
                      + STRLEN( ls_doc_content ).
    ** the coding for the server input, for later
    *OPEN DATASET dsn FOR INPUT IN BINARY MODE.
    *IF sy-subrc <> 0.
    *  EXIT.
    *ENDIF.
    *READ DATASET dsn INTO ls_doc_content.
    *WHILE sy-subrc EQ 0.
    *  APPEND ls_doc_content TO lt_doc_content.
    *  READ DATASET dsn INTO ls_doc_content.
    *ENDWHILE.
    *CLEAR ls_doc_content.
    *CLOSE DATASET dsn.
    * define container to pass the parameter values to the method call
    * in next step.
    swc_container lt_message_container.
    * Populate container with parameters for method
    swc_set_element lt_message_container 'DOCUMENTTITLE' 'Some title'.
    swc_set_element lt_message_container 'DOCUMENTLANGU' 'E'.
    swc_set_element lt_message_container 'NO_DIALOG'     'X'.
    swc_set_element lt_message_container 'DOCUMENTNAME' p_docty.
    swc_set_element lt_message_container 'DOCUMENTTYPE' 'PDF'.
    swc_set_element lt_message_container 'DocumentSize'    l_lines.
    swc_set_element lt_message_container 'DocumentContent' lt_doc_content.
    swc_call_method lo_message 'CREATE' lt_message_container.
    * Refresh to get the reference of create 'MESSAGE' object for attachment
    swc_refresh_object lo_message.
    * Get Key of new object
    swc_get_object_key lo_message lv_message_key.
    * Now we have attachment as a business object instance. We can now
    * attach it to our main business object instance.
    * Create main BO object_a
    DATA: lo_is_object_a TYPE sibflporb.
    lo_is_object_a-instid = p_bo_id.
    lo_is_object_a-typeid = p_botype.
    lo_is_object_a-catid  = 'BO'.
    * Create attachment BO object_b
    DATA: lo_is_object_b TYPE sibflporb.
    lo_is_object_b-instid = lv_message_key.
    lo_is_object_b-typeid = p_docty.
    lo_is_object_b-catid  = 'BO'.
    *TRY.
    CALL METHOD cl_binary_relation=>create_link
      EXPORTING
        is_object_a = lo_is_object_a
        is_object_b = lo_is_object_b
        ip_reltype  = p_reltyp.
    * Check if everything OK...who cares!!
    COMMIT WORK.

    I woudl suggest you check ORDERS05 IDOC type (ORDCHG message type).
    FM - idoc_input_ordchg

  • Scripting to replace a layer in a psd file and save as a tiff for multiple images in a sequence

    I have over a hundred images, all the same size, that I need bring into photoshop as a designated layer, one at a time, flatten the image and save as a tiff file with a sequential number, then repeating the process. I have not used javascript before but it seems like it should work. I'm using CS5. Thanks

    It is possible to do that via Scripting.
    If you are unable to create such a Script maybe you should look up the chapter »Creating data-driven graphics« in the documentation.

Maybe you are looking for