‎2006 Sep 14 2:15 PM
Hi
the <b>split command</b> is not recognizing <b>'#'</b> character.
‎2006 Sep 14 2:19 PM
Check the below code:
DATA: ws_data TYPE char10,
ws_data1 TYPE char5,
ws_data2 TYPE char5.
ws_data = 'Prak#ash'.
SPLIT ws_data AT '#' INTO ws_data1 ws_data2.
WRITE: / ws_data1.
WRITE: / ws_data2.
Regards,
Prakash.
‎2006 Sep 14 2:19 PM
The hash is nothing but a 'tab' character.
trty using CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB instead of #.
split v_str into field1 field2 at CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
Regards,
Ravi
‎2006 Sep 14 2:26 PM
I am new to object oriented concept, i have used
<b>CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB </b> as suggested by u. but while syntactical check it is showing <b>class is unknown</b>.
Any help in this regrads is greatly appreciated.
‎2006 Sep 14 2:32 PM
Hi Vijay,
1) Use statement CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB instead of '#' in your SPLIT statement.
2) Use CLASS CL_ABAP_CHAR_UTILITIES DEFINITION LOAD as the first statement in your report.
Thanks,
Vinay
‎2006 Sep 14 2:32 PM
Check if the following helps:
DATA : l_string TYPE string VALUE 'abcd#efgh#ijkl#mnop',
lt_string TYPE TABLE OF string.
SPLIT l_oth_string AT '#' INTO TABLE lt_string.
hith
Sunil Achyut
‎2006 Sep 14 2:47 PM
Hi
You need not declare the class. Try using as below.
<b>data: l_tab(1) type c value CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.</b>
split l_text at l_tab into l_text1 l_text2.
Kind Regards
Eswar
‎2006 Sep 14 2:55 PM
Hi Vinay,
i had used all the statements as suggested by u, but when activating it is giving the following message.
the type 'CL_ABAP_CHAR_UTILITIES' is unknown.
‎2006 Sep 14 2:58 PM
Hi Vijayarama,
Which version are you working on?
If you are on <4.7, then you have to use
data: v_tab type x value '09'.
split v_str into val1 val2 at v_tab.
REgards,
Ravi
‎2006 Sep 14 2:20 PM
its working for me.check this code.
REPORT ZSRIM_TEMP14.
data : v1 type string,
v2 type string,
v3 type string,
v4 type string.
v1 = 'abcd#def#ghi'.
split v1 at '#' into v2 v3 v4.
write 😕 v1,v2,v3,v4.
but remember that if you are downloding data from application server and if the file has any seperator like (horizantal tab,or any special character) will be displayed for us as #.but internally it will be treated differently. so first confirm whether its a special character # or any other seperator ??
if you are in a unicode system, use
CL_ABAP_CHAR_UTILITIES=>HORIZANTAL_TAB for horizantal tab seperator
or use
data : v_htab type x value '09'. in a non unicode system.
Message was edited by: Srikanth Kidambi
Message was edited by: Srikanth Kidambi
‎2006 Sep 14 2:21 PM
this is working fine in my system
REPORT ZSPELL.
DATA : CHA(10) VALUE 'ch#an',
VAR1(5),
VAR2(5).
SPLIT CHA AT '#' INTO VAR1 VAR2.
WRITE : VAR1 , VAR2.
‎2006 Sep 14 2:25 PM
Hi,
Split command recognises this character.
if you write split 'abc#efg' at '#' into string1 string2.
it is working.
can you elaborate ur problem or write some code where r you facing the problem.
Regards,
Sonika
‎2006 Sep 14 2:32 PM
Hi,
The <b>'#'</b> symbol is special character, when i am converting the file from excel to <b>tab-delimited</b> some special characters are being introduced by sytem where ever there is a <b>enter or space</b>.
This special characters in SAP r shown as '#' and this r not recongnized by <b>split command</b>.
please help me in this regard.