Skip to Content
-2

concate two table fields

Jun 23, 2017 at 06:30 AM

72

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Richard Harper Jun 23, 2017 at 06:57 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Mangesh Parihar Jun 23, 2017 at 07:49 AM
-1

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

2

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.

0
umayaraja b Jun 23, 2017 at 07:14 AM
-4

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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.

4