cancel
Showing results for 
Search instead for 
Did you mean: 

attaching commas in quantityvariable

Former Member
0 Kudos

hi experts,

In my smartforms,i have a variable temp_menge which is having value 1000000 but i want to get it displayed as 1,000,000.How to write the same.?????

Thanks,

Gaurav

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Gaurav,

Have u checked the user settings ?? as ouput also depends upon user settings.

if not then check them once and in the driver program u can define a variable like A1(20) type char.

and then

if its item level quantity, in the loop

write : itab-quantity to a1 unit 'KG'.

and then call this variable a1 in the script.

I think this might solve ur problem.

Reward points for helpful answers

Cheers,

Deepthee Kasal

Former Member
0 Kudos

Hi Gaurav,

Prior to display, write it to a variable of type QUAN/CURR. This will solve your problem automatically.

Regards,

Narendra.

Former Member
0 Kudos

sorry all,

it was sapscript not smartforms....

and i assigned that variable to quan variable but no commas came..

nivin_varkey
Active Participant
0 Kudos

it can be done in two ways:

1. create a structure with fields for MENGE (Quantity) and MEINS (UoM), where MENGE has reference to MEINS. once you use the MENGE field in the text element it automatically handles decimals and commas.

2. write the menge field to a CHAR variable with unit and use that character variable in the text element.

Hope this solves your problem