2009 Jan 20 6:12 AM
hiii
i have a field of 18char where i input a currency value.
This field is used to be put in a field of currency 9 and 2DP. if ever a user put more that is expected a dump of overflow will occur . i was thinking of checking the STRLEN to be not more than 12.
If there another way of doing so instead of STRLEN check.
Edited by: Matt on Jan 20, 2009 10:06 AM - don't use "hi" in the subject!
hiii
i have a field of 18char where i input a currency value.
This field is used to be put in a field of currency 9 and 2DP. if ever a user put more that is expected a dump of overflow will occur . i was thinking of checking the STRLEN to be not more than 12.
If there another way of doing so instead of STRLEN check.
Edited by: Matt on Jan 20, 2009 10:06 AM - don't use "hi" in the subject!
2009 Jan 20 6:19 AM
Hi,
Instead of using STRLEN, you can directly use OFFSET to move only 11 character to the decimal value.
REPORT ztest_ram.
DATA: l_char TYPE CHAR18,
l_dec(9) TYPE p DECIMALS 2.
l_char = '1234567890123456'.
l_dec = l_char+0(11).
WRITE: 'DECIMAL VALUE', l_dec.Best Regards,
Ram.
2009 Jan 20 6:24 AM
think u can directly declare the field of type and length that u need to exactly enter according to ur requirement. this will avoid the validation too.