on 02-19-2015 3:15 PM
Hi Frnds ,
In my scenario iam uploading CSV file trough file upload Ui elemenrt in sap webdynpro
FYI,
cotents in the file are
Plant | Sales Organization | Distribution Channel | color |
2000 | 1000 | 10 | red,yellow,green |
1000 | 1000 | 10 |
and i am using the below code to read the contends in the file
*data source is attribute the trough which i have binded my data to file uplod ui element
wd_context->get_attribute( EXPORTING name = `DATASOURCE` IMPORTING value = l_xstring ).
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
in_xstring = l_xstring
IMPORTING
out_string = l_string.
in debugging i found the data in the below format in i_string.
Plant,Sales Organization,Distribution Channel,color##2000,1000,10,"red,yellow,green"##1000,1000,10,##
my concern is if in case in debugging if i chnage the conted to
werks,Sales Organization,Distribution Channel,color##2000,1000,10,"red,yellow,green"##1000,1000,10,##
i have just chnaged plant to werks in debugging
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = l_string
IMPORTING
buffer = xstr.
CALL METHOD cl_wd_runtime_services=>attach_file_to_response
EXPORTING
i_filename = 'Dashboard.csv'
i_content = xstr
i_mime_type = 'TEXT/CSV'
i_in_new_window = abap_false
i_inplace = abap_false.
when i am dowloding it is showing output as
werks | Sales Organization | Distribution Channel | color##2000 | 1000 | 10 | red,yellow,green##1000 | 1000 | 10 | ## |
if i am not chnaging any thingh in debugging on the field l_string
then it is giving out as \
Plant | Sales Organization | Distribution Channel | color |
2000 | 1000 | 10 | red,yellow,green |
1000 | 1000 | 10 |
kindly let me know what was the reason
Is that we should not edit any thingh
Thanks,
Harish.
Hi Harish,
## represents the linebreak ( cl_abap_char_utilities=>cr_lf ). I never had problems with textfiles so far. But maybe when you change the text in the debugger ## (linebreak) is converted to ## (real hashes) and so it's lost when you export again.
Can you try to change Plant to werks by ABAP command (REPLACE) instead of doing it in the debugger?
Regards,
Dennis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.