How to Read Java Byte Array back into SAP xstring Table?

Hi Guys,
I have a situation whereby a user can upload a document in a WebDynpro Java Application.  This needs to be saved.  I am trying to see if I can make the location of this file that is being saved to be on our SAP AS.  I have written a SAP RFC that is imported into the Java Application for use.
The RFC is expecting a table of type TBL1024 which is basically a table of xstring values.  The Java proxy interprets this SAP table as a byte array.  This is my problem... I cannot seem to "break" up the Byte array into lines of 1024 lengt and send it back to SAP.  All that is happening currently is that the byte array creates a singe line in the TBL1024 that consists of only the first 1024 bytes in the array...  This means that only the first 1024 bytes of my document is being saved - making it corrupt.
Please advise,
Kind regards,
Christiaan

Loop it...
File file = new File("java.pdf");
FileInputStream fis = new FileInputStream(file);
byte[] buf = new byte[1024];
        try {
            for (int readNum; (readNum = fis.read(buf)) != -1;) {
                // Here populate the RFC table               
        } catch (IOException ex) {

Similar Messages

  • Does anyone know how to reload Java SE 6 back into Lion until Apple and Oracle get it together?

    Does anyone know how to reload Java SE 6 back into Lion until Apple and Oracle get it together?

    See the following, with all of its caveats:
    http://managingosx.wordpress.com/2013/01/31/disabled-java-plugins-xprotect-updat er/
    For what it's worth, I am not using this method, nor am I re-enabling Java until Oracle comes out with a fix. I also won't be available to advise you on troubleshooting this method.

  • How to save Java byte Array in Oracle

    Hi All,
    I'm using Java and need to save byte Array in Database. Initially the column is varchar2 type. is it possible to save in this type or need to modify the column type to CLOB.
    please clarify me.
    thanks in advance.
    regards
    pavan.

    You might want to use a BLOB instead
    because CLOB & varchar2 are strings unless you encode your byte array
    CLOB & varchar2 datatypes won`t record 0x00 if you have any in your array
    it will be considered as the string terminator

  • How to read IDOC in flafile structure into SAP to create PO

    HI,
    We have a requirement like, we will be provided with IDOC PO flatfile structures(Exactly same as IDOC,but in Dlafile format) .
    We have to read those flafiles and create POs in our SAP system.
    how can we do that?what are the necessary configuration required?
    please explian the different steps involved.
    thank you in advance.
    ...Sri

    Hi,
    Thank you for your reply.
    is there any other methods of processing the Flatfile IDOC into SAP.
    like through using file port with configuration done in Partner Profile , standard FM and report ?
    would this be different if we have customised IDOC?
    thank you,
    regards,
    .....Sri

  • How to Read and write array data into notepad or lvm?

    Hello,
    I am new to Labview and i wanted to use it in my project where i get accelerometer values X,Y and Z serially into a notepad and then displaying those values in Labview as a 3D plot or graph.The problem i am facing is the use of Cover to dynamic data express VI and how to save the array in a notepad or a lvm file.i was testing a basic block of building x and y values separately.was successful in plotting it to  graph but dont know how to save those values in a file.Can some1 please help me out in his ??
    Solved!
    Go to Solution.
    Attachments:
    Capture.PNG ‏22 KB

    Thank you for looking into this. Since I was converting into dynamic data before writing it I thought you have to convert it after reading but then I got stuck as to whether build the array again so as to display it in the graph. Dennis I did what you said and the graph on reading is a bit funny just started today and I am kinda skipping the long tutorial due to shortage of time. sorry
    Attachments:
    Capture.PNG ‏32 KB
    Capture2.PNG ‏59 KB

  • To read data from exel file into sap

    hi all,
    How to read data from exel file into the internal table in abap?
    Regards,
    sugeet.

    Hi Sugeet,
    Use the following code.
    DATA : BEGIN OF tbl_asset occurs 0,
             anlkl LIKE anla-anlkl,          " Asset Class
             bukrs LIKE anla-bukrs,          " Company Code
             ranl1 LIKE ra02s-ranl1,         " Asset #
             txt50 LIKE anla-txt50,          " Description 1
             txa50 LIKE anla-txa50,          " Description 2
             sernr LIKE anla-sernr,          " Serial #
             invnr LIKE anla-invnr,          " Inventory #
             menge LIKE anla-menge,          " Quantity
             meins LIKE anla-meins,          " Base UOM
             inken LIKE anla-inken,          " Inventory
    END OF tbl_asset.
    DATA : w_filename TYPE IBIPPARMS-path,
           w_file     TYPE string.
    start-of-selection.
    *popup for file path from user
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       PROGRAM_NAME        = SYST-CPROG
       DYNPRO_NUMBER       = SYST-DYNNR
    IMPORTING
       FILE_NAME           = w_filename          .
    MOVE w_filename TO w_file .
    * upload data
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      =  w_file
        FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = 'X'
      TABLES
        DATA_TAB                      = tbl_asset
      EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    for HAS_FIELD_SEPARATOR Use
    'X': Fields are separated by tabs.
    SPACE: Fields are not separated by tabs. In this case, the table must contain only one column or all columns must be contained in the file in their entire length.
    Hope it helps...
    Lokesh
    Pls. reward appropriate points

  • I have my photos  iPhoto but my iPhoto library is empty. when clicked message reads could not be opened image capture cannot open files in the photo library format. How do I get my photos back into my library?

    I have my photos in  iPhoto but my iPhoto library is empty.When clicked message reads could not be opened image capture cannot open files in the photo library format. How do I get my photos back into my library?

    When what is clicked?
    There are 9 different versions of iPhoto and they run on 9 different versions of the Operating System. The tricks and tips for dealing with issues vary depending on the version of iPhoto and the version of the OS. So to get help you need to give as much information as you can. Include things like:
    - What version of iPhoto.
    - What version of the Operating System.
    - Details. As full a description of the problem as you can. For example, if you have a problem with exporting, then explain by describing how you are trying to export, and so on.
    - History: Is this going on long? Has anything been installed or deleted? - Are there error messages?
    - What steps have you tried already to solve the issue.
    - Anything unusual about your set up? Or how you use iPhoto?
    Anything else you can think of that might help someone understand the problem you have.

  • How to read and write a string into a txt.file

    Hi, I am now using BEA Workshop for Weblogic Platform version10. I am using J2EE is my programming language. The problem I encounter is as the above title; how to read and write a string into a txt.file with a specific root directory? Do you have any sample codes to reference?
    I hope someone can answer my question as soon as possible
    Thank you very much.

    Accessing the file system directly from a web app is a bad idea for several reasons. See http://weblogs.java.net/blog/simongbrown/archive/2003/10/file_access_in.html for a great discussion of the topic.
    On Weblogic there seems to be two ways to access files. First, use a File T3 connector from the console. Second, use java.net.URL with the file: protocol. The T3File object has been deprecated and suggests:
    Deprecated in WebLogic Server 6.1. Use java.net.URL.openConnection() instead.
    Edited by: m0smith on Mar 12, 2008 5:18 PM

  • I my harddrive with my photo library went bad, but I have the photos on my ipad, ipod and iphone.  How to I get those photos back into iphoto on my macbook?

    The external drive with my photo library went bad, but I have the photos on my ipad, ipod and iphone.  How to I get those photos back into iphoto on my macbook?

    Are the photos you want to send back to your mac on your iPad, iPod, iPhone saved to the camera roll? If you have photos in other albums (not camera roll) share them to the camera roll.
    Then connect your device via USB and lauch iPhoto. You will see your device as a camera in iPhoto.  Import those photos like you would import from a camera.

  • Code for how to read an integer array from the command prompt...

    hello,
    Could anyone give me the code for how to read an integer array from the command prompt...its very urgent!..

    If you are using a recent version of Java (5 or later) you can use Scanner:
    http://java.sun.com/javase/6/docs/api/java/util/Scanner.html
    That page has some example code on it, too.

  • How do i get icloud contacts back into Outlook contacts?  My outlook contacts got wiped off in a pst export.

    How do i get icloud contacts back into Outlook contacts?  My outlook contacts got wiped off in a pst export.
    I think i want to tell icloud to sync with Outlook and make icloud the controlling account.  NOT outlook to iclout.  there are 6325 contacts in icloud.  only 12 in outlook.  about 10 days ago i had same amount in OL and icloud.  i had to restore my computer PC.  My iphone is correct.  My PC/ Outlook i not. thanks for any help.

    Hello Otienogo,
    Try the below steps on your iPhone,
    Go to settings>iCloud and Login with your Apple Id.
    Contacts should be on, click on it to turn it off and choose keep (even if it shows you no contacts)
    When the process is done go ahead and turn on contacts again, choose merge.  All your contacts should show up if you had a previous backup to icloud.
    Hope this helps you.

  • How can I get my materials back into EBP 5.5?

    I have executed an initial replication of a single material into a clean EBP 5.5 (SRM 5.0) , i.e. no product master has ever existed
    After changing MATERIAL filters in R3AC1 and afterwards replicating using R3AS I managed to get more materials into the EBP 5.5 but found out that my filter settings had to be changed. So i deleted all product master (COM_PRODUCT_DELETE_ALL) succesfully changed my filter and ran R3AS but no materials was replicated... I have checked SMQ1 and SMQ2 which were empty. I have even tried to go back to the starting point of replicating just the one material and still no luck (even synchronized filter with R/3). I have gone through a number of notes. I have gone into SMWP and there are some red lights but e.g. 'Adapter Status Information' and 'System Settings' looks fine.
    How can I get my materials back into EBP 5.5? Is it a problem of changing filters and doing intial replications continuosly?
    While writing the above I have just now created a new material in ECC 6.0 and set up the filter to replicate just this new material and it was succesfully replicated to EBP 5.5 with product master! I guess something has to be cleaned up before I can get my materials back into EBP 5.5??? How???

    I managed to replicate all my materials with the broad range filter definition after working my way through all the errors in SMW01. However, I still don't understand why I couldn't make an initial replication of a single material (previously deleted)... anyway it is working now
    Thanks for all the help!

  • How do I get "hidden photos" back into album permanently.  How di they get "hidden"?

    How do I get "hidden photos" back into album permanently?  How did they get "hidden"?

    View -> Hidden Photos.

  • How to read a whole text file into a pl/sql variable?

    Hi, I need to read an entire text file--which actually contains an email message extracted from a content management system-- into a variable in a pl/sql package, so I can insert some information from the database and then send the email. I want to read the whole text file in one shot, not just one line at a time. Shoud I use Utl_File.Get_Raw or is there another more appropriate way to do this?

    how to read a whole text file into a pl/sql variable?
    your_clob_variable := dbms_xslprocessor.read2clob('YOUR_DIRECTORY','YOUR_FILE');
    ....

  • How do I get my tabs back into the main window?

    I've had a problem with an add-on displaying a small extra window every time I open a session for some months now: I know you're supposed to try disabling and re-enabling every add-on you've got to find out which one is responsible, but this is a work computer and with all the add-ons I have, it would take too long, so I've just closed the extra window every time and got on with my work. However, for some reason today my forty-odd tabs have all opened in the small extra window, which has no tab bar, navigation bar or menu button. How do I get my tabs back into the main window of Firefox, or alternatively get that window to behave like a normal Firefox window so I can use it?

    It is possible that there is a problem with the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    Delete the sessionstore.js file and possible sessionstore-##.js files with a number and sessionstore.bak in the Firefox Profile Folder.
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    *http://kb.mozillazine.org/Multiple_profile_files_created
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder

Maybe you are looking for