2013 Jan 23 5:24 AM
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
2013 Jan 23 9:33 AM
2013 Jan 23 5:39 AM
Hi Purnand ,
Move the Quantity to a CHAR type field and display that CHAR field.
Give a try to this solution it may work.
2013 Jan 23 5:43 AM
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.
2013 Jan 23 5:48 AM
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.
2013 Jan 23 5:48 AM
2013 Jan 23 6:24 AM
2013 Jan 23 6:30 AM
2013 Jan 23 6:32 AM
It worked with quan but not with curr. how to remove it with curr. changing it to char does not work
2013 Jan 23 6:39 AM
If it worked for Quantity then I think that it should work for currency fields even.
What is the problem you facing ?
2013 Jan 23 6:45 AM
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.
2013 Jan 23 6:54 AM
2013 Jan 23 7:45 AM
Hi Purnand ,
I had used this technique for my scenario and it works perfectly fine.
Use it correctly.
Show the dump result.
2013 Jan 23 5:42 AM
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
2013 Jan 23 5:52 AM
You should use like this to prevent Zero being displayed... Use the field like below..
Supress zero &FIELDNAME(I)&
2013 Jan 23 6:31 AM
2013 Jan 23 7:08 AM
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
2013 Jan 23 7:22 AM
Hi,
Use &Your Quantity field(I)& for to Suppresses display of initial values.
Thanks
Mani
2013 Jan 23 9:07 AM
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.
2013 Jan 23 8:59 AM
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.
2013 Jan 23 9:33 AM
2013 Jan 23 9:37 AM
my fielname is fklmg4. should i put it in text like this?
&fklmg4(Z)&
2013 Jan 23 9:37 AM
my fielname is fklmg4. should i put it in text like this?
&fklmg4(Z)&
2013 Jan 23 9:42 AM
If your fieldname is flmg4 then put it &fklmg4(Z)& in your text editor.
2013 Jan 23 10:49 AM
This is the simplest and the perfect solution. Thank you experts.
2013 Jan 23 10:54 AM
Hi Purnand ,
If you find the solution appropriate and if it does according to your scenario.
Then do award points and close this thread.
2013 Jan 23 11:00 AM
How to close this? Does rewarding means liking the solution here?
2013 Jan 23 11:03 AM
NO ,
Mark his solution as Correct Answer.
The thread will be closed.
Example :
2013 Jan 23 9:38 AM
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