‎2007 Jul 08 6:27 AM
Hi All,
Can we move values b/w fields having different data types?
Any sample code for type casting it ?
thanks in advance,
sushmitha
‎2007 Jul 08 6:51 AM
Hello Sushmitha,
You can move the values one data type to others,
if you do not have any calculation then move to charcter type otherwise use same data type to same data type
Simple example :
data: quant(17) type c.
value from mseg-menge to quant
quant = mseg-menge.-> menge is quantity field
replace ',' with space into quant.
condense quant no-gaps.
Check the below links :
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3260358411d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3427358411d1829f0000e829fbfe/content.htm
Thanks
Seshu
Message was edited by:
Seshu Maramreddy
‎2007 Jul 08 7:32 AM
Hi
Actually, sap supports character format in which ASCII format. So, you can covert from one type to another type. Sap internally identifies as a character.
go throgh the following example
Data: char1 type c value '5',
num type i.
move char1 to num.
write num.
output num = 5.
reward points helpful
‎2007 Jul 08 10:51 AM