Application Development 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: 

Issue because of table field as string

gowrinath_gundu
Participant
0 Kudos

Hi All,

I need to store more than 255 characters in a database table. So I changed the table field from character to string. But when I am referencing that table in programs I am receiving following error

"**************" must be a flat structure. You cannot use intern

strings, references, or structures as components. ."

Please suggest how to resolve this issue.

15 REPLIES 15

Former Member
0 Kudos

Easy solution is to use datatype CHAR_512.

0 Kudos

Hi Steven,

Is CHAR_512 is data type or Data element. Will that store upto store 512 characters? I want to store more than 1000 characters. Please suggest

Former Member
0 Kudos

You need to create a data element with type String and use in table that Data element then this kind of error won't be there.

Former Member
0 Kudos

Hi,

You can create the domain like CHAR255 instead of declaring it as a string.

Thanks

Pavan.N

ronaldo_aparecido
Contributor
0 Kudos

HI .

PLease show the CODE.

Thanks.

Show more details.

Former Member
0 Kudos

What is the longest data you can conceive of needing to store?

Neal

0 Kudos

Hi Neal,

I want to store approx 1000 characters.

Thanks

Gowri.

0 Kudos

Hi,

is possible to create a field in data table with predefined type equal STRING.

Regards.

former_member186746
Active Contributor
0 Kudos

Hi,

You can use fields in tables of type string, however you cannot use them in key fields, nor can you use them in a where condition.

Check the sap help for more info about data type string

Kind regards, Rob Dielemans

0 Kudos

Exact Rob Dielemans well-minded.

0 Kudos

Hi Rob,

The field which I declared as string is not a key field.But when I am referencing that field in programs,For example(Declaring field string TABLES : ZTEST). I am getting below error.

"ZTEST" must be a flat structure. You cannot use intern

strings, references, or structures as components. ."

0 Kudos

Hi,

I believe tables is obsolete try the following

data ztest type ztest.

this should create a structure like your database table.

Kind regards, Rob Dielemans

0 Kudos

Hi Rob,

When I change from tables:ztest to data: ztest type ztest. I couldn't see any error. Is there any difference between these two statements? Can I replace tables ztest with data ztest type ztest in my program. Kindly let me know.

Thanks,

Gowri.

0 Kudos

I don't know when the ABAP gets compiled for runtime what exactly the differences are. But you should just look in the help on the tables statement. It has become obsolete and you can't use it in classes. (CTRL+F8 in abap editor and then type tables)

Former Member
0 Kudos

Gowrinath,

I'd really like to know what your final solution to this was...

Neal