cancel
Showing results for 
Search instead for 
Did you mean: 

condense the space ?

Former Member
0 Kudos

hi ,

I want to condense the space which is coming in the string .

CONCATENATE lv_ystring 'years' lv_mstring '.5' 'months' INTO lv_total

SEPARATED BY space.

The output is coming like this :

2 years 2 .5 months

in my application

Actually , I want to condense the space b/w ' 2' and ' .' . The output should be 2.5 instead of 2 .5 .

How can I do so ??

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Use

CONDENSE variable NO-GAPS.

Former Member
0 Kudos

Hi

data lv_tmp type string.

concatenate lv_mstring '.5' into lv_tmp.

CONCATENATE lv_ystring 'years' lv_tmp 'months' INTO lv_total

SEPARATED BY space.

Thanks

Chitrali

Former Member
0 Kudos

This question is no way related to WDA. Please use Normal ABAP forum to post such messages in the future.

There are various ways to do it. Simplest way would be to split the code as follows:

CONCATENATE lv_ystring 'years' lv_mstring INTO lv_total

SEPARATED BY space.

concatenate lv_total '.5' into lv_total.

concatenate lv_total 'months' into lv_total separated by space.

Otherways would be use to regex functionality to replace the blank space prior to the point.

Regards

Rohit Chowdhary

Edited by: Rohit Chowdhary on Dec 4, 2008 4:05 PM