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: 

What is the idea of having STRING type when you can't write into that field

Former Member
0 Kudos

Hello friends

I am desperately trying to write to a field of a database table with DATA TYPE 'STRING'.

When I try to write it using a program from < SE38> or a function <SE37>, I get following error message, while activating the program.

============================================================

<DATABASE_TABLE> must be a flat structure. You cannot use internal tables,

strings, references, or structures as components.

============================================================

So, I have been going in circle to find out how to write a string into this field.

I can't use the CHAR or any such type with a limited field length, since the requirement from my customer is to use a variable length string.

Has anybody seen this problem before and if you have resolved this issue, I would appreciate if you can please let me know.

Thanks a lot in advance.

Ram

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ram,

I created a Ztable with one field of type STRING and it is working fine.

Check with the Enhancement Category of the database table.

Rewards if helpful

Harish

3 REPLIES 3

Former Member
0 Kudos

Hi Ram,

I created a Ztable with one field of type STRING and it is working fine.

Check with the Enhancement Category of the database table.

Rewards if helpful

Harish

0 Kudos

Hi Harish

Thanks for your response.

I can create the table with the data type 'String'. However, the problem is when I try to update the table from a program in SE38 or a Function Module in SE37.

When I try to activate the PROGRAM or FUCNTION, I GET A MESSAGE THAT I MENTIONED EARLIER.

Here is the simple program that I have created that I am not able to activate

==========================================

REPORT ZTEST_STRING1.

tables: ztest.

ztest-zid = 2.

ztest-zstring1 = 'ABC'.

insert ztest.

===========================================

ztest has two fields

zid which is NUMC type

and zstring1 which is STRING type.

When I try to activate I get an error message as follows:

'ztest' must be a flat structure. You cannot use internal tables,

strings, references, or structures as components.

Edited by: Ram Prasad on Mar 20, 2008 6:08 PM

Former Member
0 Kudos

There's a solution for this.

Your table must be declared in the Export Parameters of your RFC's structure, as a Table Type using se11 transaction.

Next, in the line type of your table type, point it to the structure that you'd like to use.

Not sure if when you've posted this in issue in 2008 this feature was already available, but now with this kind of declaration, you will be able to use strings as much as you want.

Hope it helps!