Application Development 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: 

Replace a string in a character field with a amount value

Former Member
0 Kudos
166

Hi,

I have a text field in which I want to replace a string with an amount value. while am trying to replace it , it gives me some empty space.

For example:

amount = '1200 '

message = 'The STIP amount is &1'

in my code :

replace &1 with message into message.

the result is

'The STIP amount is 1200 '

I dont want the space after 1200.

I tried for condense no-gaps also but it is not working ..

What may be the problem?

Can you suggest some solution for this?

Regards,

Vimala

4 REPLIES 4

Former Member
0 Kudos
114

Hi,

First move to asmount field into char type. after do the condense, and try to replace.

Regards

Jana

Former Member
0 Kudos
114

Hi,

try this-

Replace &1 with amount into message.

0 Kudos
114

Hi Friend,

I think the space is from the amount field:

Meth 1. Transfer the amount value to character, then condense and concatenate with your text

Meth 2. Or use this statement to remove the space at the end SHIFT text right deleting trailing space.

Regards,

Jey

Former Member
0 Kudos
114

Hi,

replace &1 with message into message.

I guess its replace &1 with amount into message.

Convert the amount to a character type (example move amount to amount_c ), then condense it and and then replace it using the 'REPLACE' statement.

regards,

Advait.