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: 

adding _ve sign to a field

Former Member
0 Kudos

hi,

i need to add a -ve sign to a field which is of type quen,but the fm i used is taking only chr.this is what i did? but not getting how to do it

loop at i_ekpo into wa_ekpo.

wa_ekpo-menge = wa_ekpo-menge * -1.

data : lw_var(14) type c .

lw_var = wa_ekpo-menge .

CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'

CHANGING

value = lw_var .

wa_ekpo-menge = lw_var.

modify i_ekpo from wa_ekpo.

15 REPLIES 15

Former Member
0 Kudos

Hi

Thats true. The Fm will take only char.

Regards,

Vishwa.

former_member598013
Active Contributor
0 Kudos

Hi Radhika,

If this problem is still there then why dont you try to assign the value in the CHAR data type.

I think this is the only solution for your problem.

Thanks,

Chidanand

0 Kudos

the table field is of quen type which i shound not change it char.

0 Kudos

In that case...

first..

var1 = quantity field

split var1 at '-' to var2 var3.

now..

var4 = '-'.

concatenate var4 var2 into var5.

Regards,

VIshwa.

Former Member
0 Kudos

do it like this:

wa_ekpo-menge = 0 - wa_ekpo-menge .

Former Member
0 Kudos

try :

multiply lw_var by -1.

regards,

Advait

0 Kudos

plz verify my code ,i have done like that only but its not working

thnaks

former_member203501
Active Contributor
0 Kudos

hi use concatenate '-' or multiple with '-1'.

former_member182426
Active Contributor
0 Kudos

hi,

try like this.

FIELD-SYMBOLS: <FS> type any.

assing <var> to <fs>.

concatenate '-' <fs> into <fs>.

OR.

<fs> = <fs> * -1.

Regards,

Shankar.

0 Kudos

but its saying type incompatable .boz one is of type quen

another one is of char.

thanks

0 Kudos

Did u try the solution I gave earlier?

0 Kudos

hi,

i have tried like this way ,i got the result ,but is it correct.

wa_ekpo-menge = wa_ekpo-menge * -1.

data : lw_var(14) type c .

lw_var = wa_ekpo-menge .

CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'

CHANGING

value = lw_var .

wa_ekpo-menge = lw_var. "is this correct to equal

modify i_ekpo from lw_var.

thanks

0 Kudos

Yeah

I think this should work.

Regards,

Vishwa.

0 Kudos

its working fine.but i used like this is it correct.

wa-ekpo-menge = lw_var.

modify i-ekpo from lw_var.

thanks

0 Kudos

is i_ekpo a field or a table...?? you cant modify an internal table from a field..

say:

move lw_var to i_ekpo- "give the field name here.