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: 

0.0 is displaying istead of blank

Former Member
0 Kudos
283

Hi experts,

I have created a smartform. The quantity is to be displayed. When no value is there it should be blank but it is coming as 0.0.

Regards

Purnand

1 ACCEPTED SOLUTION

Former Member
0 Kudos
245

Hi Purnand,

To avoid zeros use &FIELDNAME(Z)&.

27 REPLIES 27

Sijin_Chandran
Active Contributor
0 Kudos
245

Hi Purnand ,

Move the Quantity to a CHAR type field and display that CHAR field.

Give a try to this solution it may work.

0 Kudos
245

Hi, I already tried this. The value is not coming even if it is there. In global definition, I declared it as fklmg4 type c. Now where to provide its length. Its not accepting there.

0 Kudos
245

Hi Purnand.

Write the same in IF condition.

If fkimg is intial.

CHAR_fkimg = fkimg.

endif.

And for the other cases let it be like as  it was earlier.

0 Kudos
245

hi,

Define it as FKLMG4 TYPE CHAR25.

Regards

Ajit Tiwari

0 Kudos
245

It worked but I disturbed my font size and alignment.

Thanx

0 Kudos
245

Define it with minimum size .

CHAR01-CHAR08.

0 Kudos
245

It worked with quan but not with curr. how to remove it with curr. changing it to char does not work

0 Kudos
245

If it worked for Quantity then I think that it should work for currency fields even.

What is the problem you facing ?

0 Kudos
245

Its working for both actually but I have change its font, alignment n everything. Changing its data type in char is not the perfect solution.

0 Kudos
245

Its giving dump

0 Kudos
245

Hi Purnand ,

I had used this technique for my scenario and it works perfectly fine.

Use it correctly.

Show the dump result.

Former Member
0 Kudos
245

Hi,

  If Quantity field is Declared as Quantity type it comes 0.0 but instead of quantity type declare it as a character type it shows blank.

Regards

Ajit Tiwari

surajarafath
Contributor
0 Kudos
245

You should use like this to prevent Zero being displayed... Use the field like below..

Supress zero &FIELDNAME(I)&

0 Kudos
245

suppress zero is not taking

0 Kudos
245

Hi Purnand,

The only solution here is to declare the field as char.

The output length of standard field FKLMG is 17. So you need to declare a field of length 17.

If the output lengths of both the fields is same, i don't hink there would be any alignment problem

0 Kudos
245

Hi,

Use  &Your Quantity field(I)&  for to Suppresses display of initial values.

Thanks

Mani

0 Kudos
245

Hi Purnand ,

As suggested by Arunkumar , don't forget to  write condense statement after transferring it to CHAR type variable.

I think it will work.

former_member184497
Participant
0 Kudos
245

Hi,

The Solution contains in above discussion,

IF your populating the amount field in ABAP/smart form program do the following step.

  If qty is not initial.

       qty_text =  qty.

      condense: qty_text.

  else.

      clear qty_text.

endif.

The above statements will move the qty value into text variable.

The alignment got disturbed because, the entire length of the qty field will be moved into character field.

Hope this solves your issue.

Thanks.

Former Member
0 Kudos
246

Hi Purnand,

To avoid zeros use &FIELDNAME(Z)&.

0 Kudos
245

my fielname is fklmg4. should i put it in text like this?

&fklmg4(Z)&

0 Kudos
245

my fielname is fklmg4. should i put it in text like this?

&fklmg4(Z)&

0 Kudos
245

If your fieldname is flmg4 then put it &fklmg4(Z)& in your text editor.

0 Kudos
245

This is the simplest and the perfect solution. Thank you experts.

0 Kudos
245

Hi Purnand ,

If you find the solution appropriate and if it does according to your scenario.

Then do award points and close this thread.

0 Kudos
245

How to close this? Does rewarding means liking the solution here?

0 Kudos
245

NO ,

Mark his solution as Correct Answer.

The thread will be closed.

Example :

Former Member
0 Kudos
245

Hi Purnand,

You can also refer to the standard SAP commands for your future reference.

&symbol(Z)&  Omit Leading Zeros  &symbol(S)&  Omit Leading Sign

&symbol(<)&  Display Leading Sign to the Left

&symbol(>)&  Display Leading Sign to the Right

&symbol(C)&  Compress Spaces

&symbol(.N)&  Display upto N decimal places

&symbol(T)&  Omit thousands separator

&symbol(R)&  Right justified

&symbol(I)&  Suppress output of the initial value