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: 

negative sign

Former Member
0 Kudos
125

hi gurus,

now im getting a value like £-2.5 ..how can i change it into -£2.5 (insmartforms)

regds

7 REPLIES 7

former_member223537
Active Contributor
0 Kudos
88

if watab-qty+1(1) eq '-'.

replace all occurrences of '-' in watab-qty with ' '.

condense watab-qty no-gaps.

concatante '-' watab-qty into watab-qty.

endif.

former_member480923
Active Contributor
0 Kudos
88

Hi

In Smartforms the Unit does not come automatically so actually the $ (menis) and Amount (NETWE) are 2 different fields so basically u have to create a variable that can hold the concaenated value of teh meins and Netwr and try sothing like the below:


data: w_amount type char40.
if i_tab-netwr < 0.
 concatenate '-' i_tab-meins i_tab-netwr into w_amount. 
else.
 concatenate i_tab-meins i_tab-netwr into w_amount. 
endif. 

Hoep That Helps

Anirban M.

former_member188827
Active Contributor
0 Kudos
88

create program lines.provide ur value as input parameter.

declare a varaible zch of type c and desired length in global definitions and provide it as output parameter in da program lines.

den use da following code..

data zc1(2) type c.

data zc2(10) type c.

split zch at '-' into zc1 zc2.

zc11(1) = zc10(1).

zc1+0(1) = '-'.

cozchncatenate zc1 zc2 into zch.

den use zch o text element

0 Kudos
88

hi thanks for your reply..your logic works in se38 but its not working in smartform...may i know why it is happening

input parameters :promotion_amt o/p parameter = lv_prom_amt.

my logic:(programming lines)

data promotion_amt type ZAZ2DEL_PROMOTION_AMT.

DATA LV_PROMOTION_AMT(10) TYPE C.

data zc2 type ZAZ2DEL_PROMOTION_AMT .

DATA PROM_AMT(10) TYPE C.

split promotion_amt at '-' into promotion_amt zc2.

promotion_amt1(1) = promotion_amt0(1).

promotion_amt+0(1) = '-'.

concatenate PROMOTION_AMT+0(1) '£' zc2 into LV_proM_amt.

output i can see : -£

plz advise..

rgds

varma_narayana
Active Contributor
0 Kudos
88

Hi Try this..

&wa_ekpo-waers(S)&

<b>reward if Helpful</b>

Former Member
0 Kudos
88

Hi,

£ and -2.5 both are separate fields, first one is Currency symbol and the second one is currency, so if you want the Negative sign in front then you need to Concatinate £ with the value into a new values then put the Negative sign in front

Regards

Sudheer

0 Kudos
88

its not working

thanks