on 04-09-2009 3:45 PM
Hi all
when i m converting xstring to string,the string is comming
饉#胥#################>#################################
how can i solve this problem.i m using 'HR_KR_XSTRING_TO_STRING' RFC.
Pls help me.
Regards
Susheel Joshi
Thanks All
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't see that this question is directly related to Web Dynpro ABAP. It seems to be more of a general ABAP question.
I take it that your XSTRING is of a different code page than your server (or it is Unicode and your server is not) or that it is truely binary data and therefore is comprised of non-printable characters. What is the source of the XSTRING?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just because you are uploading via WDA doesn't make this a WDA question. You could uplaod the file many different ways - like via CL_GUI_FRONTEND_SERVICES. Once the file is in memory on the application server, the options to process it in ABAP are the same.
You say you got the file from the frontend, but you haven't said what type of file it is? That information is critical to know how to help you to process the binary data - assuming it is even possible to do so.
Hi Susheel
Try following code:
z_convt = cl_abap_conv_in_ce=>create( input = lv_ca_filecontent ). " lv_ca_filecontent IS EXTRING DATA
z_convt->read( IMPORTING data = z_string ). " Z_STRING IS STRING VARIABLE
"Column headers
SPLIT z_string AT cl_abap_char_utilities=>cr_lf INTO TABLE t_stable.
READ TABLE t_stable INTO z_table INDEX 1.
"Delete column header
DELETE t_stable INDEX 1.
SPLIT z_table AT cl_abap_char_utilities=>horizontal_tab INTO TABLE t_fields.
z_num_cols = LINES( t_fields ).
REFRESH t_fields.
LOOP AT t_stable ASSIGNING <fs_table>.
SPLIT <fs_table> AT cl_abap_char_utilities=>horizontal_tab INTO :
z_wreg-" FIELDS OF INTERNAL TABLE
z_wreg-" FIELDS OF INTERNAL TABLE
z_wreg-" FIELDS OF INTERNAL TABLE
z_wreg-" FIELDS OF INTERNAL TABLE
APPEND z_wreg TO t_reg.
CLEAR z_wreg.
ENDLOOP.
Hope this will hepl.
Regards,
Saket.
Saket, this conversion would work assuming the file being uploaded is a text, tab delimited file from something like Excel. However Susheel hasn't told us what the source of the file is yet. These instructions might not be helpful at all if the file turns out to be Native Excel format, Word Document, or even an image file.
Hi Thomas,
I have just started to work on Webdynpro.
i m uploading excel sheet ,but THE RFC is Properly working ,
one of the import parameter of that RFC is file Path,
so i want to just pass that string(path string) to that RFC which comes in FILEUPLOAD ui Element.
Any other way to solve this problem.
Regards,
Susheel
You can't process native Excel files in ABAP. The native, binary Excel format is Microsoft specific and there is no server side library to process it. The file must be saved in a neutral format like XML or Text Tab Delimited and then processed on the ABAP side. Sorry there is no RFC that will process the binary file. The old SAPGUI specific ones did this via a connection to the client machine and OLE automation to Excel. That isn't possible within a browser.
I think you need to take a closer look at those parameters. FileUpload only has one XSTRING parameter and that is DATA. It will receive the actual contents of the uploaded file - not a path to the file. I think you want the fileName parameter - but it STRING, so you don't have to do any conversions on it.
Look at the properties on the FileUpload UI element. That will show you what you have to work with:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/b3/be7941601b1d09e10000000a155106/frameset.htm
FileName is your only choice here. I don't believe it gives you the whole path. Even if it did - what RFC are you calling. I hope you don't expect the RFC to process that file. From Web Dynpro you have no direct connection to the SAPGUI or the Client Desktop - so Function Modules that do such things won't work.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.