04-23-2008 5:07 AM
The first question as the title,and the second one is that,for example ,there is a value like 6.00,how can i delete the zeros and only leave the value 6,when i pass the value to a character variable?
04-23-2008 5:14 AM
Hi,
Check the code
DATA:
lv_decimal TYPE f DECIMALS 3,
lv_string TYPE string.
lv_decimal = '22.010'.
WRITE lv_decimal TO lv_string.
SHIFT lv_string RIGHT DELETING TRAILING '0'.
also delete trailing '.', if possible
SHIFT lv_string RIGHT DELETING TRAILING'.'.
CONDENSE lv_string NO-GAPS.
now no trailing zeros are in the decimal stored in LV_STRING
Regards,
Raj.
04-23-2008 5:12 AM
Hi,
Use the following function module.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input =
IMPORTING
OUTPUT =
.
Provide the appropriate parameters.
Reward if helpful.
Jagadish
04-23-2008 5:14 AM
Hi,
Pass the value to an integer variable and then to a character varaible..
DATA : integer TYPE I,
character TYPE C or STRING.....
integer = 6.00.
after this integer value will be '6'.
now pass this to character varaible..
Rewards if usefull
Regards,
ABAPer 007.
04-23-2008 5:14 AM
Hi,
Check the code
DATA:
lv_decimal TYPE f DECIMALS 3,
lv_string TYPE string.
lv_decimal = '22.010'.
WRITE lv_decimal TO lv_string.
SHIFT lv_string RIGHT DELETING TRAILING '0'.
also delete trailing '.', if possible
SHIFT lv_string RIGHT DELETING TRAILING'.'.
CONDENSE lv_string NO-GAPS.
now no trailing zeros are in the decimal stored in LV_STRING
Regards,
Raj.
04-23-2008 5:16 AM
Hi,
the leading and trailing space of a character variable can be deleted using CONDENSE command.
CONDENSE variablename.
04-23-2008 5:17 AM
Hi,
1.shift <char> left deleting leading space.
2. write <num> to <char> decimals 0.
Regards,
Vidya Chowdhary A.
04-23-2008 5:19 AM
Hi,
DATA : v_num1 TYPE N value '6.00',
v_num2 TYPE I,
v_char1(10).
v_num2 = v_num1.
v_char1 = v_num2.
write char1.
Pls. reward if useful...
04-23-2008 5:19 AM
Hi,
DATA : v_num1 TYPE F value '6.00',
v_num2 TYPE I,
v_char1(10).
v_num2 = v_num1.
v_char1 = v_num2.
write char1.
Pls. reward if useful...