2010 Oct 13 6:17 AM
Hi All,
I have problem in reading the file from excel , i copied the file from excel as csv AND STORED IN ftp FOLDER
i USE FTP CONNECT AND FTP COMMAND TO READ THE FILE AND THEN USING open DATA SET method
and split the file at comma and into some lv_rec and the contents into workarea of the internal tabel
the problem is iam getting the file contents but at the end of each record i am getting # at the end of each record
aprreciated if any body have the clue to get rid of # .
Regards
subbara
2010 Oct 13 9:49 AM
Hi,
the '#' character is probably a line separator. You can remove it programmatically, but it is probably better to try to use addition [OPEN DATASET - linefeed |http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_LINEFEED.htm] whe opening a file. Check also [OPEN DATASET - os_additions |http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_OS_ADDITION.htm].
Regards,
Adrian
Hi All,
I have problem in reading the file from excel , i copied the file from excel as csv AND STORED IN ftp FOLDER
i USE FTP CONNECT AND FTP COMMAND TO READ THE FILE AND THEN USING open DATA SET method
and split the file at comma and into some lv_rec and the contents into workarea of the internal tabel
the problem is iam getting the file contents but at the end of each record i am getting # at the end of each record
aprreciated if any body have the clue to get rid of # .
Regards
subbara
2010 Oct 13 9:36 AM
Hello subbara
This is the line separator, you can use the public constant CR_LF of the class cl_abap_char_utilities ( cl_abap_char_utilities=>cr_lf ) to check all the occurrences of this separator.
Declare a string internal table and do a split command to have all the records without the separator.
Hope it helps
Kleber Santos
2010 Oct 13 9:48 AM
Hi kleber,
I am not familiar with oops concepts , can declare the conatant i the declaration and i will do without seperator.
please put a line of code how to use the method or class in the code.
Regards
subbara
2010 Oct 13 9:56 AM
Hi,
if you want to remove # programmatically, you can do it like this
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf IN gv_string WITH ''.for string.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf IN TABLE gt_string_table WITH ''.for table of strings.
But I still think, that using some addition for OPEN DATASET statement would be a better solution.
Regards,
Adrian
2010 Oct 13 10:04 AM
2010 Oct 13 9:49 AM
Hi,
the '#' character is probably a line separator. You can remove it programmatically, but it is probably better to try to use addition [OPEN DATASET - linefeed |http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_LINEFEED.htm] whe opening a file. Check also [OPEN DATASET - os_additions |http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_OS_ADDITION.htm].
Regards,
Adrian
2010 Oct 13 10:03 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |