2023 Aug 08 3:51 AM
why the last character is missing after split ?
this is just a sample.
DATA(text) = 1234567890,abcde.
SPLIT text AT ',' INTO res1-num res2-letter.
The length of the res1-num is 10 but after split it only get the 123456789
output:
res1-num = 123456789 "0 or last number is missing after split"
res2-lettter = abcde "resutl is correct"
___________________________________________________________________________________________
Code from debug
2023 Aug 08 9:52 AM
reply from sandra.rossi
FFFE is the invisible character for UTF-16LE (little endian) Unicode Byte Order Mark (BOM). You should not include it in your text variable. The exact solution depends on what you do to load the text. Or if you don't want to know how it works, just remove this first character.
thanks for the idea
__________________________________________________________________________________________
already fix by changing the file
I changed the csv that I uploaded from the application server from CSV UTF8(Comma Delimited) to CSV (Comma Delimited) after that the HEX FFFE is not showing
2023 Aug 08 4:20 AM
this quick test I've done contradicted with your statement which the last character before split is missing, are you sure your receiving field is defined correctly?
DATA(z_a1) = '1234567890,abcde'.
SPLIT z_a1 AT ',' INTO DATA(z_a2) DATA(z_a3).
2023 Aug 08 4:30 AM
yes it is defined correctly the length is correct, but I don't know why it is passing up to 9 characters only
the res1-num and res2-letter is from the structure, I checked the debug and the res1-num is receiving a wrong data
2023 Aug 08 6:28 AM
Hi bolivs22,
checked in debug getting exact output
DATA(text) = '1234567890,abcde'.
SPLIT text AT ',' INTO data(res1-num) data(res2-letter).
WRITE : res1-num,res2-letter.
2023 Aug 08 6:30 AM
2023 Aug 08 6:34 AM
2023 Aug 08 6:39 AM
Here the <fs_data> is P000177154 but after the split it only pass the P00017715
Note: value of <fs_data> is coming from application server
2023 Aug 08 8:20 AM
bolivs22
What is the full hex for WA_POCNF-ODOO_PO? And the first 12 characters of <FS_DATA>?
2023 Aug 08 8:31 AM
the full hex of wa_pocnf-odoo_po is FFFE500030003000300031003700370031003500
this is the hex of the first 12 characters of <fs_data> -> P000177154 = FFFE5000300030003000310037003700310035003400
2023 Aug 08 9:09 AM
bolivs22
FFFE is the invisible character for UTF-16LE (little endian) Unicode Byte Order Mark (BOM). You should not include it in your text variable. The exact solution depends on what you do to load the text. Or if you don't want to know how it works, just remove this first character.
That's the reason.
2023 Aug 08 10:20 AM
2023 Aug 08 8:40 AM
2023 Aug 08 8:45 AM
its just a sample I can't give you a data declaration for that
please see the reply from taruntakshak, I have debug screen shot
2023 Aug 08 8:43 AM
Hi gaddamarunkumarreddy
Its just a sample please see the answer in the comment below
2023 Aug 08 9:06 AM
especially because dot and comma look very similar in the forum, Please edit your question (Actions>Edit), select your code and press the button [CODE], which makes the code appear colored/indented, it'll be easier for people to look at it. Thanks!
, and .
versus
, and .
dot and comma look very different in the two situations.
2023 Aug 08 9:15 AM
Try this program:
REPORT.
DATA: BEGIN OF test,
field1 TYPE char10,
field2 TYPE char10,
END OF test.
DATA(input) = 'P000177154,127007'.
SPLIT input AT ',' INTO test-field1 test-field2.
WRITE: test-field2, test-field2.
Do you get the same issue?
2023 Aug 08 9:52 AM
reply from sandra.rossi
FFFE is the invisible character for UTF-16LE (little endian) Unicode Byte Order Mark (BOM). You should not include it in your text variable. The exact solution depends on what you do to load the text. Or if you don't want to know how it works, just remove this first character.
thanks for the idea
__________________________________________________________________________________________
already fix by changing the file
I changed the csv that I uploaded from the application server from CSV UTF8(Comma Delimited) to CSV (Comma Delimited) after that the HEX FFFE is not showing
2023 Aug 08 11:12 AM