‎2008 Feb 25 2:34 PM
Hi we are upgrading to Ecc 6 from 4.6 and have the following Syntax error.
The Error is - "HT" must be a character-type data object (data type C, N, D, T or STRING)
data declaration,
DATA: BEGIN OF ht,
x(1) TYPE x VALUE '09',
END OF ht.
DATA: BEGIN OF itab1x,
condition_id(10) TYPE c,
change_date(10) TYPE c.
DATA: END OF itab1x.
DATA: BEGIN OF itab1 OCCURS 0,
condition_id(10) TYPE c,
change_date(10) TYPE c.
DATA: END OF itab1.
the error is at,
SPLIT fieldy AT ht INTO
itab1x-condition_id
itab1x-change_date.
MOVE-CORRESPONDING itab1x TO itab1.
APPEND itab1.
ANy Suggestions please.
Thanks,
Raju..
‎2008 Feb 25 3:00 PM
Have you tried:
SPLIT fieldy AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB INTO itab1x-condition_id itab1x-change_date.
matt
‎2008 Feb 25 2:36 PM
‎2008 Feb 25 2:39 PM
hi ,
it will not allow the type x check it and let me know..
regards,
venkat.
‎2008 Feb 25 2:42 PM
You can't use the type x variable because of the unicode in ECC.
What is the real value of '09'? You could replace it with a method in cl_abap_char_utilities?
I also heard there's a type CVALUE to define chars the same way you did it with variable x, try it that way, I'm also in 4.6 and can´t check it
‎2008 Feb 25 2:55 PM
ANy More suggestions.
I am still Unable to get this.
If this dosent work what would be an alternative for this.
Raju.
‎2008 Feb 25 3:00 PM
Have you tried:
SPLIT fieldy AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB INTO itab1x-condition_id itab1x-change_date.
matt
‎2008 Feb 25 3:22 PM
Thanks Matthew,
What would be the data Declaration for this.
I see you didnt use ht in the split statement.
Thanks,
Raju.
‎2008 Feb 25 3:56 PM
‎2008 Feb 25 4:00 PM
try declaring x as type xstring
But matthew's suggestion is the right way to do it in ECC, it should work
Edited by: Ramiro Escamilla on Feb 25, 2008 5:00 PM
‎2008 Feb 25 4:04 PM
You don't need a declaration, you use CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB precisely as I've stated.
matt
‎2008 Feb 25 5:07 PM
Thanks All.
Thanks Matthew. The problem is solved but I am still wondering where are we splitting now and how does the statement you have specified works.
Thanks,
Raju.
‎2008 Feb 26 8:53 AM
You're splitting at the horizontal tab character represented in hex as x09. You can reference any public constant (a_constant) of some class (cl_class) using the following syntax:
cl_class=>a_constant. It's standard ABAP syntax.
In this case you are accessing the constant public attribute HORIZONTAL_TAB of class CL_ABAP_CHAR_UTILITIES. This constant was provided specifically by SAP to address the fact that in a unicode system you can't use the "ht" approach you tried anymore.
If you look at class CL_ABAP_CHAR_UTILITIES, you'll see useful methods, and other attributes you can use; e.g. NEWLINE.
matt
‎2008 Feb 25 3:02 PM
Hi,
Check the following link:
http://www.sap-img.com/abap/doubt-in-unicode-enabling.htm
Regards,
Bhaskar