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

Simple Requirment.

Former Member
0 Likes
639

Hi Experts,

i want to convert - sign to + sign. is there any function module. and if its + it should be +.

Correct answers will be rewarded.

Regards,

Sunita.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
616

Hi,

Why are you looking for function module, you can write simple logic.

IF variable < 0.

variable = variable * -1.

ENDIF.

6 REPLIES 6
Read only

Former Member
0 Likes
617

Hi,

Why are you looking for function module, you can write simple logic.

IF variable < 0.

variable = variable * -1.

ENDIF.

Read only

Former Member
0 Likes
616

HI,

TRY LIKE THIS..

REPLACE ALL OCCURRENCES OF '-' IN <STRING NAME> WITH '+'.

for EG try this..

data : hi(12) type c.

HI = '-asdas'.

WRITE HI.

REPLACE ALL OCCURreNCES OF '-' IN hi WITH '+'.

WRITE HI.

Regards,

Sai

Edited by: Saikumar on Jul 11, 2008 11:39 AM

Edited by: Saikumar on Jul 11, 2008 11:40 AM

Read only

Former Member
0 Likes
616

hi,

You can use ABS (var). It will give you all the positive values.

Concatenate all with '+' symbol.

I hope this will help.

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
616

Hi,

Move that field to a variable type of string then replace '-' with statment of Replace.

Read only

0 Likes
616

Hi,

there is no need to have functionmodule

have a look.

REPLACE ALL OCCURRENCES OF '-' IN <variable name>

WITH '+'.

regards.

sriram.

Read only

Former Member
0 Likes
616

Hi try this code...

FORM change_sign CHANGING var TYPE c.

IF var LT 0.

SHIFT var RIGHT DELETING TRAILING '-'.

SHIFT var LEFT DELETING LEADING ' '.

CONCATENATE '-' var INTO var.

ELSE.

SHIFT var LEFT DELETING LEADING ' '.

ENDIF.

ENDFORM.