on 09-29-2011 10:51 AM
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) {
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.