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

concatenate

Former Member
0 Likes
656

Hi all,

How can i concatenate two fields at the time of fething from database .(ie in the select statement ).

for example : select a

b

c

d

e

from xxxx into table t_xx.

thanks & regards,

sandeep

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
628

Hi,

You cannot have a concatenated result while fetching from database.

You have to do the concatenation manually after fetching all your records.

Regards

Subramanian

Hi,

You cannot have a concatenated result while fetching from database.

You have to do the concatenation manually after fetching all your records.

Regards

Subramanian

4 REPLIES 4
Read only

Former Member
0 Likes
628

1) fetch data from dbtab into internal tab.

2)make a column for concatenate result field into internal field

3)try.....

loop at itab.
concatenate itab-field1 itab-field2 into itab-field3.
modify itab.
endloop.

Read only

Former Member
0 Likes
629

Hi,

You cannot have a concatenated result while fetching from database.

You have to do the concatenation manually after fetching all your records.

Regards

Subramanian

Read only

Former Member
0 Likes
628

you may do like this

select a b c into (v_a, v_b, v_c) from dbtab where a in s_a.

concatenate v_a v_b into V_result.

write : /v_result.<or fill the internal table.

endselect.

regards

shiba dutta

Read only

Former Member
0 Likes
628
SELECT a b c d e
             FROM xxxx
             into table t_xx.

LOOP AT t_xx.
CONCATENATE t_xx-a t_xx-b t_xx-c INTO t_xx-d.
MODIFY t_xx.
CLEAR t_xx.
ENDLOOP.

U can do like the logic above, u cant do in the select.