2023 Oct 10 12:22 PM
I am getting # appended into the last column after reading the file in a string variable and also after I spilt the same string variable into a field of work area type char04 I am not getting the last character...for ex I am getting TAB instead of TABL .
OPEN DATASET p_fname FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE mess.
* OPEN DATASET p_fname FOR INPUT IN BINARY MODE MESSAGE mess.
IF sy-subrc = 0.
DO.
READ DATASET p_fname INTO lv_string.
IF sy-subrc <> 0.
EXIT.
ENDIF.
CONDENSE lv_string.
SPLIT lv_string AT ','
INTO ls_itab-typ
ls_itab-prog.
APPEND ls_itab TO lt_itab.
CLEAR ls_itab.
ENDDO.
CLOSE DATASET p_fname.
Here ls_itab-typ is of type char04- and is of type SY-Repid.
Here when we split the string variable lv_string containing value TABL,ZCUSTOMTABLE1.
But the value in the fields are coming as ls_itab-typ = 'TAB'
ls_itab-prog = 'ZCUSTOMTABLE1#'.
I hope i am able to explain the question
Any solution will be appreciated.Thanks.
2023 Oct 10 12:30 PM
2023 Oct 10 2:39 PM
2023 Oct 10 3:46 PM
2023 Oct 11 7:13 AM
Look at the value ls_itab-prog in debug and see what hex value is behind the # character.
2023 Oct 11 11:58 AM
ls_itab-prog is solved as I have done string manipulation to remove # from this,hex value is attached also ....but for ls_itab-typ the value should come as TABLE instead it is coming as TAB but when the input is changed to PROG it is coming as PROG only any idea on this.
2023 Oct 11 3:49 PM
As you can see, it's the first character FFFE (invisible) = well-known UTF-16 Little Endian Byte-Order Mark (see wikipedia).
This character should be removed, but you must also change your logic to decode UTF-16.
Open the file in binary mode.
Convert the text from UTF-16LE codepage (SAP 4103) - The class to use depends on your ABAP version.
2023 Oct 12 10:13 AM
Thank you Sandra for the explaination.But I am not able to figure out the code.
Can you provide the code Please!
Thank you!
2023 Oct 12 5:40 PM
Which part of the code are you interested in? What did you try? What issue do you have?
There are many questions and answers in the forum for every part of the code .