‎2006 Jun 16 10:57 PM
Hi,
For the following code ekkn-vproz always gives 0.0 as it is decimal value...so i want to change to 100.0...in the below code...unfortunately it is not showing the 100.0 value why...
data : v_vproz(10) type c.
v_vproz = lt_ekkn-vproz.
IF v_vproz = '0.0'.
MOVE '100.0' TO v_vproz.
ELSE.
v_vproz = lt_ekkn-vproz.
ENDIF.
SHIFT v_vproz LEFT DELETING LEADING space.
‎2006 Jun 16 11:01 PM
hi Vj,
declare v_vproz as type <b>P</b>/<b>F</b>.
i.e, data : v_vproz type P decimals 1.
or
data : v_vproz type F.
Reward if it helps,
Regards,
Santosh
‎2006 Jun 16 11:01 PM
hi Vj,
declare v_vproz as type <b>P</b>/<b>F</b>.
i.e, data : v_vproz type P decimals 1.
or
data : v_vproz type F.
Reward if it helps,
Regards,
Santosh
‎2006 Jun 16 11:02 PM
no i want it to be only character(c) because i m using it in concatenate statement........
‎2006 Jun 16 11:03 PM
no i want it to be only character(c) because i m using it in concatenate statement........
‎2006 Jun 16 11:11 PM
try
IF lt_ekkn-vproz.
is initial.
MOVE '100.0' TO v_vproz.
ELSE.
v_vproz = lt_ekkn-vproz.
ENDIF.
Regards,
Suresh Datti
‎2006 Jun 16 11:13 PM
hi Vj
do this way it works now
<b>if lt_ekkn-vproz is initial.
move '100.0' to v_vproz.
else.
v_vproz = lt_ekkn-vproz.
endif.</b>
Reward if it helps
Regards,
Santosh
‎2006 Jun 16 11:15 PM
‎2006 Jun 16 11:25 PM
hi,
Try Using FM <b>CONVERSION_EXIT_ALPHA_INPUT</b> before If Statement i.e,
i.e,
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = lt_ekkn-vproz
IMPORTING
OUTPUT = lt_ekkn-vproz
.
if lt_ekkn-vproz is initial.
move '100.0' to v_vproz.
else.
v_vproz = lt_ekkn-vproz.
endif.
Regards,
Santosh
‎2006 Jun 16 11:33 PM
Not sure I would do it this way, but this works because you are check the value of a character field, which means that you need to take the spaces into consideration.
report zrich_0001 .
data: lt_ekkn-vproz type ekkn-vproz.
data : v_vproz(10) type c.
v_vproz = lt_ekkn-vproz.
if v_vproz = ' 0.0 '.
move '100.0' to v_vproz.
else.
v_vproz = lt_ekkn-vproz.
endif.
write:/ v_vproz.
Regards,
Rich Heilman
‎2006 Jun 16 11:35 PM