Application Development and Automation 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: 
Read only

string length

Former Member
0 Likes
2,600

Hi

I want to concatenate text into String data type but problem is that String data type is also having some maximum length limit. Then what of data type i can use.

my text length is approx 500 characters

Regards

Aditya

12 REPLIES 12
Read only

Former Member
0 Likes
1,756

Hi,

try to use character type..

C(500)

Read only

Former Member
0 Likes
1,756

Hi

i already checked it Its not working.

Aditya

Read only

Former Member
0 Likes
1,756

hi aditya,

use this

t_text(1024) type c .

concatenate into this.

regards,

sandeep

Read only

bpawanchand
Active Contributor
0 Likes
1,756

Hi

In SE11 declare a domain with CHAR with size 1000 characters and then declare it in your program

use this domain type

CHAR1024_WAO its length is 1024 and also output

Try out i hope it works

Regards

Pavan

Edited by: Pavan Bhamidipati on Jul 16, 2008 8:16 AM

Read only

Former Member
0 Likes
1,756

Hi,

If this the issue then its better you Declare the Variable Character with length 500.

Like

Data: variable(500) type c.

Now concatenate the Text into Variable.

Regards,

Sujit

Read only

Subhankar
Active Contributor
0 Likes
1,756

Hi

You can use string to concatenate the variables .

It will be more flexible than use of any data element of length. Because it maximum length

is around 1500. BUt if you use string it can capture 5000 characters.

Plzz see the example

DATA: l_char TYPE /DVSREPRO/ZFILBUFT500,

l_string TYPE string,

l_char1 TYPE /DVSREPRO/ZFILBUFT500,

l_char2 TYPE /DVSREPRO/ZFILBUFT500.

l_char = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'.

l_char1 = 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'

& 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB'

& 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'.

l_char2 = 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC'

& 'ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'

& 'c1c1c1c1c1c1c1cc1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1cc1c1c1c1c'.

CONCATENATE l_char l_char1 l_char2 INTO l_string.

WRITE: l_string.

Edited by: Subhankar Garani on Jul 16, 2008 8:22 AM

Read only

Former Member
0 Likes
1,756

hiii

you can use type C here as its having maximum length as 65535..but i think if it will be string then also it should work..because for a long line mostly we are using string as data type.

regards

twinkal

Read only

Former Member
0 Likes
1,756

Hi Adithya,

The variable TEXT which is of type string can have length of more than 500 characters also. I checked . its working fine.

Regards,

Swapna.

Read only

vinod_vemuru2
Active Contributor
0 Likes
1,756

Hi Aditya,

There should not be any problem. Because i used a string variable to concatenate data having lenth of around 2500 characters+.

Paste ur concatenate statement.

Check this piece of code which transfers 1500 characters at once into application server(This is limit with transfer but not with string)


  l_len = strlen( p_data ).
  DO.
    IF l_len LT 1500.
      TRANSFER p_data+l_offset(l_len) TO p_file.
      MOVE 0 TO l_len.
    ELSE.
      TRANSFER p_data+l_offset(1500) TO p_file.
      SUBTRACT 1500 FROM l_len.
      ADD 1500 TO l_offset.
    ENDIF.
    CHECK l_len EQ 0.
    EXIT.
  ENDDO.

If u still have problem then declare one character variable of sufficient length.

DATA: l_data(2000) TYPE c.

Thanks,

Vinod.

Read only

Former Member
0 Likes
1,756

Hi,

you can declate a data element with a domain of required size...

and then use it....

reward if useful

preet

Read only

Former Member
0 Likes
1,756

thanks but not solved

Read only

0 Likes
1,756

Dear Aditya,

I am also having the same issue.

I tried by defining the variable as Char(500) and Char(1024). But of no use.

I am concatenating the text1 and text2 of more than 255 characters (After concatenation) into a variable which is type String.

But it is taking only 255 characters.

Could you please share with me how you resolved it?

Regards,

Chaitanya A