2009 Apr 23 2:26 PM
Hi,
I want to upload a file from client to server in webdynpro ABAP..
I am using the file upload UI element & I have the data uploaded..
But the data is in the XSTRING format.. How can I covert this data to CHAR or STRING format..
& how can be data be transferred to SERVER... Will the OPEN DATASET & TRANSFER statements work... ?
Thanks
Geetha
Hi,
I want to upload a file from client to server in webdynpro ABAP..
I am using the file upload UI element & I have the data uploaded..
But the data is in the XSTRING format.. How can I covert this data to CHAR or STRING format..
& how can be data be transferred to SERVER... Will the OPEN DATASET & TRANSFER statements work... ?
Thanks
Geetha
2009 Apr 23 2:32 PM
Assuming your xstring is in i_data, and t_data is your output table:
data: l_data type string,
lr_conv type ref to cl_abap_conv_in_ce.
* Convert to string
lr_conv = cl_abap_conv_in_ce=>create( input = i_data ).
lr_conv->read( importing data = l_data ).
* Convert string to table
split l_data at cl_abap_char_utilities=>cr_lf into table t_data.Now you can process t_data using the normal OPEN DATASET and TRANSFER commands.
matt
2009 Apr 23 2:35 PM
For converting xstring to string format you need to use some function module.
like below CRM_IC_XML_XSTRING2STRING
CALL FUNCTION 'CRM_IC_XML_XSTRING2STRING'
EXPORTING
INXSTRING = l_xstring
IMPORTING
OUTSTRING = l_string.Once it is converted to string format , you need to split at Tabs using cl_abap_char_utilities=>horizontal_tab (if the file is tab delimited file)
Check it once.