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: 

String larger than 255

Former Member
0 Kudos
3,187

Hi all. I need to fill a variable with more than 255 characters. I've created a custom domain with 500 length both on number of characters and output length. However, when I fill out the field, it only fills 255 chars, no more than that.

Any ideas?

Thanx.

Jesus

1 ACCEPTED SOLUTION

former_member183804
Active Contributor
0 Kudos
1,360

Hello Jesus,

moving more than 255 chars into a String or c field with apporiate size should be no problem at all.



report test.
  data: txt type string, len type i.
  concatenate sy-ULine sy-ULine into txt. len = strlen( txt ).
  write: / len , txt.

So I guess the problem is located in the fill logic. Could your please provide a small code excerpt?

Thanx

Klaus

10 REPLIES 10

former_member188685
Active Contributor
0 Kudos
1,360

Hi,

You can use Data type <b>LCHR</b>, it can hold up to 32000 chars.

just see the domain<b> J_2ICHRL</b> here LCHR is used.

Regards

vijay

0 Kudos
1,360

if you are on WAS6.10 or above you can use data type STRING

Regards

Raja

0 Kudos
1,360

Hi all. Thanx for your answer, but i've tryed both with J_2ICHRL data element and STRING, and it's still not working.

Thanx

Jesus

Message was edited by: Jesus Bohorquez

0 Kudos
1,360

when you LCHR data type , your table should also have another field of type i where you have to fill the size of the content.

Regards

Raja

0 Kudos
1,360

what do you mean by still not working? not able to create the field - synatx error ,

not able to fill data?

Regards

Raja

0 Kudos
1,360

It still only fill up to 255 chars

0 Kudos
1,360

if you are looking at the data in debugging , you will only see 255 characters

how do you fill the field?

Regards

Raja

0 Kudos
1,360

I1m looking at the field on debbuging, but I have a routine where I validate the length of the field with STRLEN (field_name) GT 255, and it doesn't work.

Thanx

Jesus

Former Member
0 Kudos
1,360

Hi Jesus,

I think you should use data type STRING instead of CHAR. Because CHAR has a certain limit of 255 even though we declare more than that it won't accept in such cases we have to go for STRING.

Thanks & Regards,

YJR.

former_member183804
Active Contributor
0 Kudos
1,361

Hello Jesus,

moving more than 255 chars into a String or c field with apporiate size should be no problem at all.



report test.
  data: txt type string, len type i.
  concatenate sy-ULine sy-ULine into txt. len = strlen( txt ).
  write: / len , txt.

So I guess the problem is located in the fill logic. Could your please provide a small code excerpt?

Thanx

Klaus