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: 
Read only

Could not able to split the string at #!

Former Member
0 Likes
2,790

Hi,

Hi Below is the value coming in a field character string 130 and I have used SPLIT at '#' and also Split at tab which has a value horzontal tab.

Below is the string Value..

'Feedback on Mr Richard Harris#360 category Partner#Department Human Resources#Office London#Review period 01.01.2010 to 31.12.2010'.

Please let me know how to resolve this?

Regards,

Srinivas

1 ACCEPTED SOLUTION
Read only

jrg_wulf
Active Contributor
0 Likes
1,920

Hi Srinivas,

0A00 is the Value for LineFeed so retry split with CL_ABAP_CHAR_UTILITIES=>NEWLINE instead of tab.

regards

Jörg

10 REPLIES 10
Read only

Former Member
0 Likes
1,920

Hi,

Try this


data: lv_var type CHAR1 value CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
split lv_string at lv_var into wa-field1 wa-field2.

Read only

0 Likes
1,920

Thanks for the quick reply.

I tried this already and is not working.

Also I tried to split the contents into Internal table as below which is also not working.

data: lv_var type CHAR1 value CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.

split lv_string at lv_var into table <STRING_TABLE>

Regards,

Srinivas

Read only

0 Likes
1,920

Hi Srinivas,

'#' means any unwritable character so it could have a lot of values!

If possible, could you have a look to the corresponding value of this symbol represented by '#' in hexadecimal value (you can get hexadecimal value in debugger) : this represent the ASCII value...

Best regards,

Samuel

Read only

0 Likes
1,920

Dear Samuel,

The hexa decimal value for '#' is coming as '0A00'.

Please check..

Regards,

Srinivas

Read only

0 Likes
1,920

Hi,

It would be better if you can let us know how you are getting the data into string. Is it uploaded from some file? Here Hash(#) means any unprintable character. So hexadecimal value of hash may not help. You need to see how the data is populated to string field.

Based on that use the SPLIT statement. Hope this helps...

Thanks,

Vinod.

Read only

0 Likes
1,920

The value is coming from Portal application and it will be used in Interactive form of adobe.

Regards,

Srinivas

Read only

0 Likes
1,920

Hi,

Then check with portal team to see what value they are passing to you at the place of hash(#). Seems like some code page conversion is failing.

Thanks,

Vinod.

Read only

0 Likes
1,920

Very Nice. This is really appreciable as working absolutely fine without changing much in the program

Read only

Former Member
0 Likes
1,920

This works as it should:


DATA:
lv_field(130) TYPE c VALUE
'Feedback on Mr Richard Harris#360 category Partner#Department Human
resources#office london#review period 01.01.2010 to 31.12.2010',

lv_01(50) type c,
lv_02(50) type c,
lv_03(50) type c,
lv_04(50) type c,
lv_string TYPE string.

lv_string = lv_field.
split lv_string at '#' into
lv_01 lv_02 lv_03 lv_04.

write: / lv_01 ,
       / lv_02 ,
       / lv_03 ,
       / lv_04.

Read only

jrg_wulf
Active Contributor
0 Likes
1,921

Hi Srinivas,

0A00 is the Value for LineFeed so retry split with CL_ABAP_CHAR_UTILITIES=>NEWLINE instead of tab.

regards

Jörg