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

Data type to be used

Former Member
0 Likes
1,020

Hi All,

I have a requirement where i have to fetch mutiple rows of a table and then concatenate the data of a particular field of all the rows and put it into a single variable.

I have no restrictions on the no of rows to be fetched due to which i cannot plan of the size of that single variable.

Can anyone suggest me some data type which can take variable lengths at run time. also the size limit can go beyond 255.

Please help.

Thanks,

Chandna

Hi All,

I have a requirement where i have to fetch mutiple rows of a table and then concatenate the data of a particular field of all the rows and put it into a single variable.

I have no restrictions on the no of rows to be fetched due to which i cannot plan of the size of that single variable.

Can anyone suggest me some data type which can take variable lengths at run time. also the size limit can go beyond 255.

Please help.

Thanks,

Chandna

7 REPLIES 7
Read only

Former Member
0 Likes
982

hi,

u can choose data type as STRING also.

Cheers,

Rudhir

Read only

keerthy_k
Product and Topic Expert
Product and Topic Expert
0 Likes
982

Hi,

U can use string or xstring as the data type and concatenate all the variables into the string type one.

U can declare as :

DATA: str type string.

concatenate field1 field2 field3 into str.

Keerthi

Edited by: Keerthy K on Feb 25, 2009 11:49 AM

Edited by: Keerthy K on Feb 25, 2009 11:50 AM

Read only

Former Member
0 Likes
982

Hi,

You can use string or CHAR_1536.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
982

HI,

use EDI_SDATA data element which can hold 1000 characters.

OR

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.

Regards,

Venkatesh

Read only

former_member222860
Active Contributor
0 Likes
982

Hi,

Use SYCHAR512

Pl. refer table TAB512

Read only

0 Likes
982

Hi,

You can use local variable with lenght 65535 type c. It's the maximum length allowed for char data type.

Regards,

Surendar Reddy.

Read only

Former Member
0 Likes
982

Hello Chandna,

You can go with the following workaround;

DATA:
  w_var1 TYPE string,
  w_var2 TYPE string.

LOOP AT t_table INTO fs_table.
  CONCATENATE w_var1 fs_table-field1 INTO w_var2.
ENDLOOP.

Now, every time loop is run, current value is attached to previous value and at the end, you'll get concatenated values in w_var2.

You can very well use w_var2.

Hope, it helps you.

Thanks: Zahack