Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Split issue

AJeB
Participant
0 Kudos
2,315

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

1 ACCEPTED SOLUTION

AJeB
Participant
2,222

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

17 REPLIES 17

xiswanto
Active Participant
0 Kudos
2,222

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).

AJeB
Participant
0 Kudos
2,222

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

TarunTakshak
Participant
2,222

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.

0 Kudos
2,222

weird its not working on me

0 Kudos
2,222

bolivs22 share screenshot of debugging screen

0 Kudos
2,222

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

matt
Active Contributor
0 Kudos
2,222

bolivs22

What is the full hex for WA_POCNF-ODOO_PO? And the first 12 characters of <FS_DATA>?

2,222

the full hex of wa_pocnf-odoo_po is FFFE500030003000300031003700370031003500

this is the hex of the first 12 characters of <fs_data> -> P000177154 = FFFE5000300030003000310037003700310035003400

2,222

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.

matt
Active Contributor
2,222

Darn, missed that!

gaddamarunkumar
Participant
0 Kudos
2,222

Hi Aaron,

can I know the data declaration of the res1-num?

0 Kudos
2,222

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

AJeB
Participant
0 Kudos
2,222

Hi gaddamarunkumarreddy
Its just a sample please see the answer in the comment below

Sandra_Rossi
Active Contributor
2,222

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.

matt
Active Contributor
0 Kudos
2,222

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?

AJeB
Participant
2,223

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

Sandra_Rossi
Active Contributor
0 Kudos
2,222

Thx for feedback and the good solution.