on 02-13-2008 1:18 PM
Hi,
I am struggling to find a solution for this requirement and I hope I get some help from the Gurus here.
I have to upload a ".csv" file from the WebDynpro application, and then store the data in the flat file in a Z# table.
Can some one explain me how to go ahead with this requirement??
Regards,
Nadh
Hi Nadh,
you can store binary data in a database table in a field of type XSTRING. The field
has to be a non-key field. For the key field, choose something appropriate for your
business scenario - or a guid.
Best regards,
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
Thankyou for the reply,
I binded the data to a context attribute and tried to display it. But the data in the text file is not read, instead I see some string charecters and numbers when i upload the text file with some string data.
I know I am missing some thing while trying to display the data on the layout, but could not find out a way get the data in the text file.
Any suggestion??
Regards,
Nrisimhanadh
Hi Nrisimhanadh Yandamuri ,
.
After reading the csv file using file up load you can use the following code to tranfer the same to an itab of your required format
DATA : loc_conv TYPE REF TO cl_abap_conv_in_ce,
var_string TYPE string.
Convert XString to String
CALL METHOD cl_abap_conv_in_ce=>create
EXPORTING
input = item_content
encoding = 'UTF-8'
replacement = '?'
ignore_cerr = abap_true
RECEIVING
conv = loc_conv.
*Read the file contents
TRY.
CALL METHOD loc_conv->read
IMPORTING
data = var_string.
CATCH cx_sy_conversion_codepage.
*-- Should ignore errors in code conversions
CATCH cx_sy_codepage_converter_init.
*-- Should ignore errors in code conversions
CATCH cx_parameter_invalid_type.
CATCH cx_parameter_invalid_range.
ENDTRY.
SPLIT var_string AT crlf INTO TABLE it_string_tab.
Regards
Sarath
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
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.