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

concate two table fields

Former Member
0 Likes
1,306

I have two table fields first name and last name. I want concatenation of these two fields into new table field Name. Please help me with this.

6 REPLIES 6
Read only

Former Member
1,169

Hi Malaviben.

You will need to read up on the following statements:

TYPES

DATA

FIELD-SYMBOLS

SELECT [INTO TABLE]

LOOP AT [Assigning Field Symbol]

String concatenation using &&, and ` instead of ' as a string delimiter

ENDLOOP

I'm not going to provide the code for you because this is so basic (if you'll pardon the pun).

Rich

Read only

Former Member
0 Likes
1,169

Hi malaviben,

Step 1 : ( define long string)

      DATA final TYPE soli-line.

Step 2: ( get data from table and pass to field)

      LOOP AT itab INTO wa.
        l_f1 = wa-firstname .
        l_f2 = wa-secondname .
      ENDLOOP.

Step 3: ( now pass the two field value to log sting"final" field)

       LOOP AT it_soli1.
        CONCATENATE l_f1 l_f2 INTO final.
      ENDLOOP.

Regards,

Umayaraj.B

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
1,169

Since the questioner seems to know nothing about ABAP, it isn't helpful to answer with faulty code excerpts that do not match at all.

Read only

mangesh_parihar
Explorer
0 Likes
1,169

Hi,

Loop at i_tab into w_tab.
w_final-f_name = w_tab-f_name.
w_final-l_name = w_tab-l_name.
concatenate w_tab-f_name w_tab-l_name into w_final-full_name seperated by space.
endloop.

Hope this works.

Regards,

Mangesh

Read only

1,169

Ever heard of the concatenation operator && or string templates? Maybe even FOR expressions?

Read only

0 Likes
1,169

There are many ways to do the same. I just commented one of them.

And no, i haven't heard of them. Thanks for the suggestion. I'll learn it for sure.