cancel
Showing results for 
Search instead for 
Did you mean: 

Remove Decimals in Smartform

Former Member
0 Kudos

Hi Gurus/ Experts.

I have a trouble with my Smartform, especially with my numbers field. For example i will use field NETWR.

in my smartform the decimal is like this 123.321.231,000 how to remove the 000 please help me gurus / experts, and how to remove ,000 in quan field ? reward is available.

Accepted Solutions (1)

Accepted Solutions (1)

hedvig_rohonyi
Employee
Employee
0 Kudos

Hi Ri Zaldy,

the reason for your problem is that your field is of type CURR.

So it has a reference field, which already determines the number

of digits after the decimal point. So usually it doesn't

make sence to use the formatting option (.0), too.

If you want to change the number of digits in your Smartform

nevertheless, you should define a new number field (which is

not of type CURR or QUAN) in your form, put ...-NETWR into it (e.g. via an ABAP node) and print the new field with formatting option (.0).

Best Regards,

Hedvig

Former Member
0 Kudos

Hi Hedvig

Thank you for your clear answer, you give me the light, so I can come out from the darkness.

Please tell me, must the new field is custom ? I mean must I create a table ?

Please help me just need 1 more step to clear this trouble

I will give you helpful, but please help me to finish this one.

bastinvinoth
Contributor
0 Kudos

Hi Ri Zaldy

No need to create a table,

just add one more variable in global definitions

like net type p decimals 0 .

then before your passing value to node , just assign netwr value to your custom field net .

net = wa-netwr.

then display like &net(C)&

Regards,

Bastin.G


Former Member
0 Kudos

hi bastin

really really really really really really really helpful answer, this one answer that I need. Thank you so much for this. But like  you said just "assign netwr value to ur custom field net."  is this action do in SE38 ? just need a quarter step to finish this problem.

bastinvinoth
Contributor
0 Kudos

Hi Ri Zaldy

anyway your assigning values to smartforms right (like &NETWR&) ?

before displaying values add another program lines before that by right click option

better make a changes in smartforms

Regards,

Bastin.G


Former Member
0 Kudos

Hi my Lovely Bastin.

Finally... I found the answer ahahaha thank you so much. Finally I make it, but what must I do with the input para and output para ? just make it blank ? Ohh yeah, is the "decimal 0" is default value ? thank you so much bastin thank you so much

bastinvinoth
Contributor
0 Kudos

Hi Ri Zaldy

Happy to see your words Cheers

much appreciated comments from you thanks a lot

Regards,

Bastin.G

Former Member
0 Kudos

Hi Bastin, i have 1 more question, how to make quantity's decimals gone ? do you have the way ? @Bastin Vinoth

Former Member
0 Kudos

Hi Bastin, i have 1 more question, how to make quantity's decimals gone ? do you have the way ? @Bastin Vinoth

bastinvinoth
Contributor
0 Kudos

Ri Zaldy wrote:

how to make quantity's decimals gone ?

if i understood correctly,

why its coming with decimals that reason is already here told by Hedvig Rohonyi .

if you want to eliminate decimals while displaying means, please follow what i have suggested you already   i hopt it helps

Regards,

Bastin.G

Former Member
0 Kudos

hi Basti, i think you are not lucky today.. Because how is the way i can give you the Correct Answer that we talk in message ? hahaaha. I want give it to you, but the moderator not post my thread yet.

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Zaldy,

Please try below one..

Defined three global parameters like

data: lv_actvalue type string,

         lv_result     type string,

         lv_dec        type string.

lv_actvalue = wa_ekko-netwr.

split lv_actvalue at '.' into lv_result lv_dec.

Now use lv_result for output field.

Otherwise change your user settings in SU01.

Thanks,

Satya.

Former Member
0 Kudos

Hi satya,

Where must i write the data : lv_actvalue, etc ? in se38 ? or in global ?

Former Member
0 Kudos

Hi Zaldy,

1. In smart forms --> Types Tab ---> take your table types declaration part netwr type as char10.

2. Code initialization part---> after select query ---> netwr value pass to lv_actvalue ---> split to lv_actvaue into lv_result and lv_dec.

3.  remaining all values and lv_result value append to your table.(i.e., as per types declaration ).

Thanks,

Satya.

former_member209818
Active Contributor
0 Kudos

Hi,

You can show the currency or Quantity field without decimals using below format

Zero decimals: &<Variable>(.0)&.

For various formating options you can refer below WIKI Link.

http://wiki.sdn.sap.com/wiki/display/CodeExchange/Output+formatting+techniques+in+scripts+and+smartf...

I hope this helps you

- Harshad

Former Member
0 Kudos

Hi harshad,

Thank you, really thank you for your help. But I have to try that, and It didn't work. do you have any solution ?

gurunathkumar_dadamu
Active Contributor
0 Kudos

Hi Ri Zaldy,

Try to check in debug mode how the netwr values.if the value is showing what you mentioned i think go to SU01---> click on the default values--> in decimal notification check the format(necessary then try to  change the format).

Regards,

Gurunath

Former Member
0 Kudos

Hi Gurunath

I have check my SU01 and everything is right, do you have another solution ?

venkateswaran_k
Active Contributor
0 Kudos

Hi

&field(R10.2)&

&NETWR(R10.2)&

This will print of total length of 10 with 2 decimal places..

&NETWR(R10.x)&  where x is the number of decimal place

Former Member
0 Kudos

Hi Ven

&WA_EKPO-NETWR(R10.0)& can it be like this ?

venkateswaran_k
Active Contributor
0 Kudos

Hi

Yes you can specify like that.

However, also verify that what did you mention anything about your variable in Global definition under tab currency/qnt. fields. 

Regards,

Venkat

Former Member
0 Kudos

Hello again Ven

ok I see what you mean. Just make this one  clear, if my field is &WA_EKPO-NETWR& and I want to make it without decimals. In the reference field must I write like this

Field Name                                        Reference Field                         Data Type

&WA_EKPO-NETWR(R10.0)&          &WA_EKPO-NETWR(R10.0)     Curr

do you mean like this ?

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Set the option in command in your element text as this

&NETWR(.0)&

I hope this helps you

Regards

Eduardo

Former Member
0 Kudos

Hi Eduardo

hmm &WA_EKPO-NETWR(.0)& is this right ?