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
653

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
625

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 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

4 REPLIES 4
Read only

Former Member
0 Likes
625

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
626

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
625

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
625
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.