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
1,319

hi guyz,

this is the code:

DATA: lv_wa TYPE solisti1,

lv_output(150) TYPE c.

CONCATENATE

lv_wa-line

into lv_output

SEPARATED BY '|'.

error : "CHARLIKE-FIELD" EXPECTED AFTER "LV_WA-LINE".

plz advise..

regds

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,219

Hi,

Concatenate can be used only for two more values of character data type. Thats why you got the error. Just make it the code as like follows.

DATA: lv_wa TYPE solisti1,

lv_output(150) TYPE c.

CONCATENATE lv_wa-line ' ' into lv_output SEPARATED BY '|'.

Regards,

Sankar.

hi guyz,

this is the code:

DATA: lv_wa TYPE solisti1,

lv_output(150) TYPE c.

CONCATENATE

lv_wa-line

into lv_output

SEPARATED BY '|'.

error : "CHARLIKE-FIELD" EXPECTED AFTER "LV_WA-LINE".

plz advise..

regds

9 REPLIES 9
Read only

prasanth_kasturi
Active Contributor
0 Likes
1,219

hi

you must use minimum of two fields to concatenate like dobj1 and dobj2

CONCATENATE {dobj1 dobj2 ...}|{LINES OF itab}

INTO result

[IN {BYTE|CHARACTER} MODE]

[SEPARATED BY sep]

[RESPECTING BLANKS].

regards

prasanth

Read only

Former Member
0 Likes
1,220

Hi,

Concatenate can be used only for two more values of character data type. Thats why you got the error. Just make it the code as like follows.

DATA: lv_wa TYPE solisti1,

lv_output(150) TYPE c.

CONCATENATE lv_wa-line ' ' into lv_output SEPARATED BY '|'.

Regards,

Sankar.

Read only

Former Member
0 Likes
1,219

U should have atleast 2 variables to concatenate ..

CONCATENATE

lv_wa-line lv_wa-line1

into lv_output

SEPARATED BY '|'.

Read only

Former Member
0 Likes
1,219

CONCATENATE

lv_wa-line ' '

into lv_output

SEPARATED BY '|'.

Read only

Former Member
0 Likes
1,219

hi Sudheer,

You have to give at least two fields for concatenate.

I guess you are concatenation only one filed in concatenate.

If you dont have one, you can use it this way.

CONCATENATE

lv_wa-line

' '

into lv_output

SEPARATED BY '|'.

Hope this helps you.

Thanks,

Arun

Read only

Former Member
0 Likes
1,219

hi,

The syntax for CONCATENATE is

CONCATENATE SOURCe1 SOURCE2 into TARGET.

You are using only one source .

Please check and let us know.

Reward points if helpful.

Thanks and regards.

Read only

Former Member
0 Likes
1,219

DATA: lv_wa TYPE solisti1,

lv_output(150) TYPE c.

Concatenate lv_wa into iv_output seperated by '|'.

reward if its useful

Read only

venkat_o
Active Contributor
0 Likes
1,219

Hi Sudheer, Check this one.

DATA: lv_wa TYPE solisti1, 
      lv_output(150) TYPE c.

"CONCATENATE lv_wa-line INTO lv_output SEPARATED BY '|'.
1
" CONCATENATE commnad is used to concatenate to character strings. you have to specify another char variable.
2
"Above statement is not advisable because Length of lv_wa-line is greater
"than lv_output.
3.
"try this way
CONCATENATE lv_output ',' INTO lv_wa SEPARATED BY '|'.
Regards, Venkat.O

Read only

Former Member
0 Likes
1,219

Hi,

you need to concatenate atleast two fields,it will not work for a single value.

Check this

DATA: lv_wa TYPE solisti1,

lv_output(150) TYPE c.

lv_wa-line = 'suresh raja'.

CONCATENATE

lv_wa-line 'suresh'

into lv_output

SEPARATED BY '|'.

write: / lv_output.

output: suresh raja | suresh

Regards,

Raj.