2008 Aug 27 11:59 AM
Hi,
I am working on SAP Script.
How do I suppress zero values & at the same time maintain the field length?
Eg:
&wa_itab-d_amt(I)& (say length of d_amt is 16) would suppress the initial value. but the field length is not maintained.
How do I achieve this?
Thanks.
2008 Aug 27 12:16 PM
Have you tried with
&wa_itab-d_amt(16I)&
if it is not working then try like this
/: if &wa_itab-d_amt(C)& eq '0.00'
/ &space(16)&
/: else
&wa_itab-d_amt(16)&
/: endif
2008 Aug 27 12:04 PM
Hi,
Use Avoid preceding Zeros option.
like: &wa_itab-d_amt(Z)&
and put the value into other and then use Left or Right justified options.
Regards,
Rama.
2008 Aug 27 12:09 PM
I think you have not understood my question.
My question is that I would like to suppress not just leading zeros but even if the value is 0.00. I can achieve this by using (I).
Secondly, I would like to maintain the field length as well, ie: if I suppress the value 0.00 using (I), I shld be able to maintain the length of the column as well.
2008 Aug 27 12:07 PM
why would you want to maintain field length? its not neccessary for anything.
2008 Aug 27 12:12 PM
Hi Florien,
I am using this for a tabular report.
So if a row column has value say 123456.78 and the next row has the value say 0.00 and i suppress initial value using (I), the width of the second line is smaller and hence the columns alignment is lost.
How do i handle this?
2008 Aug 27 12:16 PM
Have you tried with
&wa_itab-d_amt(16I)&
if it is not working then try like this
/: if &wa_itab-d_amt(C)& eq '0.00'
/ &space(16)&
/: else
&wa_itab-d_amt(16)&
/: endif
2008 Aug 27 12:31 PM
well if it´s about positioning and formatting, then i hope you dont work with spaces
well just work with tabulators.
every paragraph format can have its own tabulators, so define yourself a paragraph format with enough tabulators for you output and use ,, between your variables you wish to output.
you dont have to take care anymore for field length then unless they are too long.
e.G. i have paragraph format A1
i have defined 2 tabulatros.
first one at 2 characters left alignment,
second one at 15 characters left alignment.
so in SAP script
/: define &test& = 'hello'
/: define &test2& = 'world'
A1 &test&,,&test2&
would give you
hello world
if &test& would be longer than 13 characters (15 - 2) then you got a problem since he wants to print &test2& at character 15 but well there he isnt ready with printing &test&, so the second tab will be ignored an the &test2& will be printed right after &test& is finished just separated by a space.
2008 Aug 27 1:28 PM
Hi Florian,
Can u tell me the size of a character in pixels?
Say if i use font 10 and font 8, will the tabulators give the same result in both cases?