‎2019 Nov 11 11:02 AM
DATA: lv_file TYPE string.
lv_file = p_server.
DATA LV_xstring TYPE xstring.
OPEN DATASET lv_file FOR INPUT IN TEXT MODE ENCODING DEFAULT .
IF sy-subrc <> 0.
MESSAGE e999(zz) WITH 'error'.
ENDIF.
DO.
READ DATASET lv_file INTO LV_xstring. "DUMP
IF sy-subrc <> 0.
EXIT.
ENDIF.
"APPEND ls_string TO lt_string.
ENDDO.
CLOSE DATASET lv_file.
DUMP:
For the statement "READ DATASET ... INTO f" only character-type data objects are supported at the argument position "f". In this case. the operand "f" has the non-character-type "y". The current program is a Unicode program. In the Unicode context, the type 'X' or structures containing not only character-type components are regarded as non-character-type.
‎2019 Nov 11 11:57 AM
Hello luca treva,
Change the datatype of LV_xstring to String as mentioned below and try:
DATA: lv_xstring TYPE string.Regards!
‎2019 Nov 11 12:57 PM
this is the dump try type string:
During conversion of a text from code page '4110' to code page '4103', one of the following occurred: - Characters were discovered that cannot be displayed in one of the code pages - The conversion could not be performed for some other reason (see below for more details). Excerpt from the source buffer from the first character that could not be converted, displayed in hexadecimal form (with the ASCII characters in brackets): "82 CF 6E 01 00 00 04 05 00 00 13 00 08 02 5B 43 (..n...........[C)" The system was forced to terminate the current ABAP program 'ZTESTPROVA' since the conversion would have produced incorrect data. There are 50 of these non-convertible characters. If this number is 0, the second of the two scenarios described above applies.
‎2019 Nov 11 3:34 PM
What is the data we are dealing with, any idea?
This issue is mainly due to certain invalid characters in the path mentioned.
Check from your end if you can find any invalid character in the destined path.
Regards!
‎2019 Nov 11 3:41 PM
Why do you ask the question twice? (https://answers.sap.com/questions/12903642/read-csv-from-server-directory.html)