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

Unicode error

Former Member
0 Likes
1,029

Hi ,

I am getting error - 'The key of internal table "SYS_TABL" contains components of type "X" or

"XSTRING". The "READ TABLE SYS_TABL" statement is not permitted '

for the following read statment

READ TABLE SYS_TABL.

The internal table SYS_TABL defined as-

DATA: BEGIN OF SYS_TABL OCCURS 50.

INCLUDE STRUCTURE MSXXLIST.

DATA: END OF SYS_TABL.

The structure MSXXLIST contains fields with hexadecimal .

How can I solve this problem ?

7 REPLIES 7
Read only

Former Member
0 Likes
872

hi,

try moving the data to workarea after read.

data : wa_sys_tabl like sys_tabl.

read table sys_tabl into wa_sys_tabl index 1.

Atul

Read only

0 Likes
872

Hi Atul ,

My read statment itself is failing, so moving it to work areay is not the right solution.

Read only

Former Member
0 Likes
872

Hi

Try using the method CONVERT of the class CL_ABAP_CONV_IN_CE.

This method converts the data of type X or Xstring to character type data object.

Hope this helps.

Edited by: Archna Raja on May 25, 2009 8:30 AM

Read only

Former Member
0 Likes
872

Hi,

The READ TABLE syntax is not complete.

If you want to read the first entry of the table use:

READ TABLE table INDEX 1.

or

If you want to read table based on some value then try the syntax:

READ TABLE table WITH KEY host = '.....'.

The syntax "READ TABLE table." is not complete and so you are getting error when activating the code.

Regards,

George

Read only

Former Member
0 Likes
872

hai ,

u have used the data type xstring in strucuture MSXXLIST ,

so just change it to type string and it might solve ur problem

afzal

Read only

0 Likes
872

Hi,

break up the declaration, that is redeclare the internal table manually without referring to the structure directly, but by using all the fields of the structure one by one.

Then when you encounter the filed that has the Hexa decimal part, use the class CL_ABAP_CHAR_UTILITIES. Go through the documentation of this once.

  • CONSTANTS: lc_tab TYPE x VALUE '09', " Tab delimiter

CONSTANTS: lc_tab TYPE c VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
872

Hello,

Is this part of some standard code or custom code? Plz share your code which will be more helpful to analyse the problem.

BR,

Suhas