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: 

Need to create Table Maintenance with more than 400 characters

0 Kudos
2,546

I need to create table maintenance in which one filed have more than 400 characters. CHAR type support between 1-255 & STRING type not supported by Table Maintenance. Is there any alternative type or solution for that?

9 REPLIES 9

Former Member
0 Kudos
707

Hi,

you can use data type LCHAR which can hold more than 255 .

once try it

Regards,

ravi

Former Member
0 Kudos
707

Hi,

Try using the data type 'LCHR' and give the no.of.characters as per requirement.

Regards,

Sharin

0 Kudos
707

Facing this error for LCHAR :

" Field EMAIL_ADR ( field name) does not have a preceding length field of type INT4"

Edited by: ritesh9898 on Dec 16, 2011 7:12 AM

0 Kudos
707

Hi,

If you assign TMG to the table, it will throw error as unable to display the field on screen. why because it can able to display upto 255 char length only.

For this requirement you have 2 solutions :

1) Create multiple fields and your Z table, split the data and store them as required.

2) Create a TEXT ID and store it as a long text using FM CREATE_TEXT.

or

This type of text should be treated as Long Text.

And the steps are:

1. Create Text Object Using SE75.

2. Create Text ID Using SE75.

3. Now you have to Save the text with FM SAVE_TEXT.

For example:

The Most simple solution for it can be that Divide the field REMARKS of size 1000 in multiples of 200 characters like REMARK1, REMARK2....REMARKn.

Now you can create two FMs :

zset_data: To Store 1000 char long data in Table

Here you will divide the data of Variable (type char1024) in multiples of 200 and will store in REMARK1, REMARK2.....

zget_data: To Get 1000 char long data back from Table

Here you will concatenate REMARK1, REMARK2..... and will store in Variable of Type char1024.

This is the best solution if Table is not going to be maintained by Table Maintenance Generator.

regards,

ravi

0 Kudos
707

Hi,

Please check the following conditions:

1) In your Table 'LCHR' data type field should be a last field.

2) Before this field declare one variable of Data Type 'INT2'.

Before entering the Long text in the Text field you need to specify the length of the string in the field which has the data type 'INT2' in the Table Maintenance Generator.

While inserting data to the table using the screen, need to handle the length of the string dynamically.

former_member226225
Contributor
0 Kudos
707

you can use data type LCHAR which can hold more than 255 .

once try it

Former Member
0 Kudos
707

Hi Ritesh

Its not LCHAR its LCHR.

you can use the data type LCHR, it should be used for character strings of arbitrary length, but with at least 256 characters.

Unlike binary data (LRAW), character data (LCHR) is converted automatically in heterogeneous environments, providing the database system used supports ASCII-EBCDIC or code page conversion in heterogeneous networks. Type LCHR is therefore suitable for long texts that are to be stored. Fields of type LCHR can occur in structures and tables. Fields of this type must be placed at the end in tables and have a preceding length field of the type INT2. When using INSERT or UPDATE in ABAP/4 programs, the preceding length field must be filled with the length actually required. LCHR fields cannot be used in WHERE conditions.

LCHR is a character string of any length ...

So you can try creating a text object and text id in se75 and try with read_text.

Warm Regards

NZAB

Former Member
0 Kudos
707

If you are giving the type more than char255.... say string or lchar ....you cannot use table maintenance generator ....

For this you will have to create a upload program or a program which will give you on screen updation of table....

whichever suits your requirement.

Regards,

Lalit Mohan Gupta

Former Member
0 Kudos
707

Even if with LCHAR system allows you to create table maintenance generator... you won't be able to give text more than 255 on the screen.....

Please try a upload program for your use.

Lalit.