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: 

Storing a field of length 500 char in a database table

Former Member
0 Kudos

I want to create a ztable in which I need to store the data of length more than 256 , so please let me know , how can we create the field of length 500 chars..

I have tried using STRING and LCHR , but it's not working.

Thank You,

Ankur Goyal

1 ACCEPTED SOLUTION

santosh_kumarm
Participant
0 Kudos

Hi Ankur,

try using data element CHAR1250 for the field in the table .

Hope it shall be useful.

Regards

Santosh

18 REPLIES 18

santosh_kumarm
Participant
0 Kudos

Hi Ankur,

try using data element CHAR1250 for the field in the table .

Hope it shall be useful.

Regards

Santosh

0 Kudos

Its not working , I have tried it and as like char1250 we also have char512 but they can only be used in the structures not while creating the database table fields.

Former Member
0 Kudos

Hi,

IN SE11 create a domain or char type and length 500.

Now assign this assign domain to the data element .

TC

Sajimon Chandran

0 Kudos

Hi Ankusaru,

Assign a field of type int4 before the long character field. Use the LCHR field with the output length of 500. Long fields require a preceding length field of type INT4.

It must be located directly before the long field in the field list. Please also note that long fields must be located at the very end of the field list.

It works only if u dont have to specify the long char field in the primary key. Primary key fields can't be more then 255 char length.

Regards,

Akhil

0 Kudos

M so sorry, I have tried this way as well but its not working and for the char we have maximum 256 character length..

0 Kudos

hi

thank you for the reply , but would like to tell you 2 things

1. i have also tried this way and its not working.

2. I cant use the int4 data type as per the requirments.

I have tried to do that ,.. , tried to give the size to the string also like String and the output length as 500 , but failed..

please let me know if you know any thing about it.. thankyou ...

0 Kudos

you don't have to enter any size for STRING, it's dynamic. It will handle 500 characters and even more.

0 Kudos

Hi Ankusaru,

try with data element 'EDI_SDATA' edi sdata is a field which holds upto 1000 characters.

see the table EDIDD or EDID4 as a reference..

Regards,

Prabhuda

0 Kudos

Hi,

You can create a data element with type - RAWSTRING..we can give variable lenght for this data element.Plz confirm.

Regards,

Vamshi

0 Kudos

Hi,

Try using VARCHAR It may work.

Thanks,

Pavan.

0 Kudos

hi

thank you for replying , while creating the ztable as per the requirements this was the first thing that I did however, its good to use the string data type while declaring the variable .

I have tried it also, but , its giving me an error of 'FLAT STRUCTURE' even though I can enter the data.

Thank & regards

Ankur Goyal

0 Kudos

where and when do you have this error, and could you paste the full message text please?

0 Kudos

Hi,

We cannot create a field with >256 char in a database table.

we had a similar issue and we resolved it using 3 different fields and storing in database.

Regards,

Teja.

0 Kudos

I also have the same problem. I am creating infotype . I want the field of length 400 inmy database table and structure .

So i cant use the field with length 1000. As in infotype maximum limit is 900. So will you plz suggest me any other method or

other field with length 400 or 500 .

s_nnoorie
Active Participant
0 Kudos

Hi,

you cannot store more that 256 char in 1 field.

to achive this u can either

1. split the content and save it in 2 to 3 fields.

or

2. convert it into coded form using function module . i dont remember the name of function module.

( as we do in standard and when u wanna read it use Read_text functional module)

(refer table stxh)

hope this will solve ur problem

Former Member
0 Kudos

Hi,

Try creating the field like this

1. Create a new data element with required description.

2. While creating data element select 'Built-in type' radio button under Data Type tab. Specify Data type as STRING and press enter. You need not specify Length (or you can provide 500 here, I suggest not to specify field length as it leads to short dump if you enter text more than 500 chars in it).

Note: Once you press enter you can see an information message 'No length restriction'.

3. Save and activate the data element.

4. Use the data element for your text field in your custom table.

Important:

The text field with size >255 chars should not be a key field, neither you should select 'Initial values' option while defining field.

I have tried this and it worked.

Hope this helps.

Thanks,

Venkat

kesavadas_thekkillath
Active Contributor
0 Kudos

Did you try creating a domain of type string ( No length restriction ).

Former Member
0 Kudos

thank you for your valuable replies