05-12-2011 7:14 PM
Hello,
I have created a BAPI which is exposed as a webservice and is called in JAVA program.
I need to upload a file from JAVA Client into SAP and attach it to the claim.
I am using FM BDS_BUSINESSDOCUMENT_CREA_TAB
but this Fm requires file content in XSTRING. HOw do i get the XSTRING of the file ..???
If anyone has a different view of uploading the file please suggest.
Thanks,
Swati
05-12-2011 7:41 PM
Did you do a where-used on the function for examples? Or look at test program BDSTESTOO? Why do you think the data has to be in XSTRING format?
05-12-2011 7:41 PM
Did you do a where-used on the function for examples? Or look at test program BDSTESTOO? Why do you think the data has to be in XSTRING format?
05-12-2011 8:52 PM
FM BDS_BUSINESSDOCUMENT_CREA_TAB that i use, accepts file content in Binary format .
So if i get the XSTRING of the file i can convert it to binary and pass it to my FM.
Thanks.
05-12-2011 8:55 PM
Swati,
I have used some of these FMs in the past for similar needs:
SCMS_BINARY_TO_XSTRING
SCMS_FTEXT_TO_XSTRING
SCMS_STRING_TO_XSTRING
SCMS_TEXT_TO_XSTRING
SCMS_XSTRING_TO_BINARY
05-12-2011 9:05 PM
These are not RFC ... i can not use them in my BAPI
Do you have another idea for uploading file in sap using BAPI ...
05-12-2011 9:17 PM
If you have a custom Web Service (which sounds like a Provider WS), then after the WS gets the file from the client - call the appropriate FM from my list (it does not need to be remote-enabled once inside of SAP) and convert the file into XSTRING format.
05-12-2011 9:28 PM
Sawti,
I guess I am unclear as to which application is in control of the transaction - is the Java client in control or SAP?
By default - SAP provides many methods to upload a file from any client.
05-12-2011 10:58 PM
These are not RFC ... i can not use them in my BAPI
Of course you can...what makes you think that? But there are more up to date ways to convert if you'd peruse the ABAP syntax or search the forums. Your content, however, doesn't even need to be binary in format...
05-13-2011 1:40 PM
Thanks for everyones input..
Java client is calling the WS. How do i upload file present in Java Client to SAP??
GUI_upload doesnt seem to work ..
Please help.. since i could not get it uploaded i thought getting file in binary format would help me ..
Please guide if i am heading to a wrong direction .
Thanks again
Swati.
05-13-2011 3:04 PM
Java client is calling the WS. How do i upload file present in Java Client to SAP??
GUI_upload doesnt seem to work ..
GUI_UPLOAD will not work in an RFC. Either load the file in the Java app (binary or base64 encoded) and transfer it via your BAPI call or mount the location on your app server and load it using OPEN DATASET/READ DATASET/... as usual.
05-13-2011 3:53 PM
Could you please elaborate on the methods that can upload file from any client.
05-13-2011 4:08 PM
Swati,
OK - so the Java Client is in control of the transaction.
On what hardware and OS is this Java Client running? Is the hardware "hard-wired" to the same network that holds SAP? Or you trying to upload from the BlackBerry or the like?
05-13-2011 5:36 PM
No the JAVA system is not at all connected to our SAP system..
They have a JAVA application , this calls our BAPI..
File is in JAVA Client ... somewhere in their directory structure.. so SAP does not have access to file..
here is the problem of uploading the file..
Please guide.
Any help will be appreciated
05-13-2011 5:41 PM
See Brad earlier reply. You have to mount the file system. Did you ever talk to BASIS people about this issue. If not, ask them if they can mount the file system that is in the structure (java file system or whatever it is). They should have answer for you. From ABAP side, it is either use GUI functions if accessing via GUI else use Read data set function to read from application server which i meant file system
05-13-2011 6:00 PM
OK . I guess i have only 2 options left now..
Either connect to their file system and mount file in our application server
OR
get the file content in BInary format and then try attaching .
I will 1st try 2nd options if it works good.. other wise i have no option but 1st.
Thanks.
05-13-2011 6:07 PM
05-16-2011 3:07 PM
Hi Swathi,
This Function Modules may helpful to you.
NLS_STRING_CONVERT_FROM_SYS
NLS_STRING_CONVERT_TO_SYS
Thanks & Regards,
Bhargav.