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

Syntax Error

Former Member
0 Likes
987

I am facing an problem when I check the unicode on in the attributes of the program.

The error is,

"C_TAB_CHAR" must be a character-type data object (data type C, N, D, T or STRING) .

code for the error,


DATA: BEGIN OF ht,
        x(1) TYPE x VALUE '09',
        END OF ht.

      SPLIT fieldy AT ht INTO
        itab1x-condition_id
        itab1x-change_date.

Any Suggestions,

Raju

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
940

Hi,

Please check the constant C_TAB_CHAR whether it is Character type or Not. If it is not declare that as character type.

If you are splitting the data, then all the variables should be declared as character types or string.

Regards

Kannaiah

7 REPLIES 7
Read only

Former Member
0 Likes
941

Hi,

Please check the constant C_TAB_CHAR whether it is Character type or Not. If it is not declare that as character type.

If you are splitting the data, then all the variables should be declared as character types or string.

Regards

Kannaiah

Read only

0 Likes
940

Thanks for the reply,

I guess I had posted the wrong error message,

The error message is,

"HT" must be a character-type data object (data type C, N, D, T or string,

and the declearation and code is,

DATA: BEGIN OF ht,
        x(1) TYPE x VALUE '09',
        END OF ht.

      SPLIT fieldy AT ht INTO
        itab1x-condition_id
        itab1x-change_date.

Thanks,

Raju

Read only

0 Likes
940

Try this way.


split fieldy  at cl_abap_char_utilities=>horizontal_tab into itab1x-condition_id itab1x-change_date.

a®

Read only

0 Likes
940

Hi Raju,

You are getting a error because of the TYPE X u are using.

Using CL_ABAP_CHAR_UTILITIES->HORIZONTAL_TAB makes your variable of type C.

try Mandeep's solution, it should work.

Even ARS's solution is correct.

Cheers

~goldie.

Read only

0 Likes
940

Or:

      SPLIT fieldy AT ht-x INTO      "<====
        itab1x-condition_id
        itab1x-change_date.

Rob

Read only

0 Likes
940

Thanks Rob,

I have tried the way you have specified and the error message is

"HT-X" must be a character-type data object (data type C, N, D, T or string.

DATA: BEGIN OF ht,

x(1) TYPE x VALUE '09',

END OF ht.

SPLIT fieldy AT ht-x INTO

itab1x-condition_id

itab1x-change_date.

I am facing this problem after I made the program Unicode enable.

Raju.

Read only

Former Member
0 Likes
940

use this code :

class CL_ABAP_CHAR_UTILITIES definition load.

DATA: BEGIN OF ht,

  • x(1) TYPE x VALUE '09',

x(1) type c value CL_ABAP_CHAR_UTILITIES->HORIZONTAL_TAB,

END OF ht.

horizontal_tab is equivalent to 09 in hexa.

In commands like split, concatenate u can't use type x values

in unicode enabled program..

rest of code remain same.

With regards

Mandeep