‎2007 Mar 14 4:36 PM
Hi all,
I have an issue in SAP script. I have a table which have 7 quantity field of decimal type. it can have value 0 also. so if it any field is having 0 value it shud print '-' there.
i have done coding on form but its not working. Can any body please guide me how to compare decimal fields. ii have done like
if &v_amount1& = ' 0.0000 '
' - '
Else.
amount first = &v_amount1&
ENDIF.
thanks in advance.
Varu.
‎2007 Mar 14 4:39 PM
The easiest way is to activate the script debugger (SE71: Utilities->Activate debugger) and stop at the point in the script with this coding. Then take a look at the contents of your &v_amount1& field. You then can find out what should be exactly between the ' ' quotes.
Regards,
John.
‎2007 Mar 14 4:38 PM
Hello,
Check like this:
if &v_amount1& is initial " Check here
' - '
Else.
amount first = &v_amount1&
ENDIF.
Regards,
Vasanth
‎2007 Mar 14 4:42 PM
‎2007 Mar 14 4:50 PM
hi ' 0.0000 '
<b>
1.check the number of decimals in ur code</b>
or it should be '0.000'
If < symbol> has the value 123456789. &symbol(3)& -> 123 &symbol(7)& -> 1234567 You can combine an output length specification with an offset specification. The specified length is then counted from the specified offset position. &symbol+4(3)& -> 567 If a length specified is greater than the current length of the value, then spaces are appended to the symbol value. You can use the character * to specify the length of a program symbol. The value of the symbol is then printed using the output length defined in the ABAP Dictionary. Syntax &symbol(*)&
<b>&v_amount(1) = '0'</b> .
means to capture <b>0</b>.000
only the integer part as 0 and make the if true .
regards,
Vijay
‎2007 Mar 14 4:39 PM
The easiest way is to activate the script debugger (SE71: Utilities->Activate debugger) and stop at the point in the script with this coding. Then take a look at the contents of your &v_amount1& field. You then can find out what should be exactly between the ' ' quotes.
Regards,
John.
‎2007 Mar 15 10:23 AM
‎2007 Mar 15 10:33 AM
Hi
I had the same problem i wrote like this it worked for me.
Just try this.
loop at i_final.
if not i_final-qsatz is initial.
write i_final-qsatz to i_final-qsatz1.
modify i_final.
else.
write '-' to i_final-qsatz.
endif.
endloop.
Regards
Haritha.