01-08-2007 10:11 AM
Hi ,
I have a field I_MARC-EISBE which is of type quan.
If this field EISBE is initial , I need to give blank field but not 00.000
Similarily VBBE-VMENG is initial , i need to to give blank field but not 0.000
How to convert quan to char and give blank????
Points will be rewarded
Thnaks in advance
01-08-2007 10:13 AM
01-08-2007 10:14 AM
chk this FM CEVA_CONVERT_FLOAT_TO_CHAR
or
data : v_char(25).
v_char = I_MARC-EISBE.
01-08-2007 10:14 AM
Move the quantity value into a variable of type Characrter, please try NUMC too.
01-08-2007 10:33 AM
data: v1(16) type c.
move quantity to v1.
write:/ v1.
alos, try checking CEVA_CONVERT_FLOAT_TO_CHAR fm
01-08-2007 10:34 AM
Execute the code and see if this works for u .
data : val1 like vbbe-vmeng,
val2(13) type c.
val1 = 2.
val1 = val1 * 0.
write:/ val1.
move val1 to val2.
if val2 eq 0. "---> Condition if zero
val2 = space.
write:/ 'hi', val2.
endif.
val2 from 0.00 to space .
regards,
vijay
01-08-2007 10:35 AM
Hi Jayasree,
As abap uses internal Conversions between any Basic Data types, you can create a variable and assign this quant field to it, for whatever result type you want.
If you are trying to display the EISBE (Please refere the Piece of code i given below).
For your information refer Conversin Routine (CONVERSION_EXIT_QUANT_INPUT or CONVERSION_EXIT_QUANT_OUTPUT ) these routines converts Decimal (1) to Decimal (2) and vice versa.
**********************************070108 (DZ8Z6L)
tables: marc,
vbbe.
data: begin of t_marc occurs 0,
matnr like marc-matnr,
werks like marc-werks,
eisbe like marc-eisbe,
end of t_marc.
select matnr
werks
eisbe
from marc
into corresponding fields of table t_marc.
loop at t_marc.
if sy-tabix = 2.
t_marc-eisbe = '22.22'.
endif.
write:/ t_marc-matnr,
t_marc-werks,
t_marc-eisbe no-zero.
endloop.
For any further detaisl let me know...
Regards,
Manjunatha
Message was edited by:
MANJUNATHA KS
01-08-2007 11:09 AM
hI Jayashree,
DATA : V_EISBE(100) TYPE C.
IF I_MARC-EISBE IS INITIAL.
V_EISBE = I_MARC-EISBE.
ENDIF.
IF I_VBBE-VMENG IS INITIAL.
V_VMENG = I_VBBE-VMENG.
ENDIF.
WRITE : V_EISBE,
V_VMENG.
Thanks
Vikranth Khimavath
01-08-2007 11:16 AM
Assign quan field to CHAR field or use FM CEVA_CONVERT_FLOAT_TO_CHAR
01-08-2007 11:21 AM
hi,
try this.
Take a character field of length which can acccomdate Quantity field and use Move statement.
data: v1(16) type c.
move quantity to v1.
write:/ v1.
Regards
Anver