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
903

Hi All,

I have a requirement to concatenate the contents of fields and some text into a character string.

Concatenate (FIELD_A) ' AND ' (FIELD_B) ' ON '
                  into text_from.

If Field_A = '1000'. and

Field_B = '2000'.

then the contents of text_from should be

' 1000 AND 2000 ON '

Please let me know how to achieve this.

Thanks again,

Jr.

1 ACCEPTED SOLUTION
Read only

abdul_hakim
Active Contributor
0 Likes
831

Use the below code...

If Field_A = '1000'. and

Field_B = '2000'.

<b>CONCATENATE '1000' 'AND' '2000' 'ON' INTO TEXT_FROM SEPARATED BY SPACE.</b>

endif.

Cheers,

Abdul Hakim

Hi All,

I have a requirement to concatenate the contents of fields and some text into a character string.

Concatenate (FIELD_A) ' AND ' (FIELD_B) ' ON '
                  into text_from.

If Field_A = '1000'. and

Field_B = '2000'.

then the contents of text_from should be

' 1000 AND 2000 ON '

Please let me know how to achieve this.

Thanks again,

Jr.

5 REPLIES 5
Read only

abdul_hakim
Active Contributor
0 Likes
832

Use the below code...

If Field_A = '1000'. and

Field_B = '2000'.

<b>CONCATENATE '1000' 'AND' '2000' 'ON' INTO TEXT_FROM SEPARATED BY SPACE.</b>

endif.

Cheers,

Abdul Hakim

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
831

You can do like so...

Concatenate FIELD_A 'AND' FIELD_B 'ON'
                  into text_from
                      separated by space.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
831

DATA: v_tmp type c value ''.

Concatenate v_tmp FIELD_A 'AND' FIELD_B 'ON' v_tmp

into text_from separated by space.

Try this.

Read only

Former Member
0 Likes
831

if field_a eq '1000' and

field_b eq '2000'.

text_from = ' 1000 AND 2000 ON'.

else.

concatenate field_a 'AND' field_b 'ON' into text_from separated by space.

endif.

hith

Sunil Achyut

Read only

Former Member
0 Likes
831

hi,

it seems to be your requirement is like to concatenate few values with some text.

in such a case you first move those integer values to a character variable and then use CONCATENATE.

data V_char(20) type c.

v_char = v_integer. "your 1000 or 2000 etc..

then use

CONCATENATE V_CHAR1

'AND'

V_CHAR2

'ON'

INTO V_CHAR3 SEPARATED BY SPACE.

regards

srikanth