2007 Nov 29 7:44 AM
hi,
I have suppose 0010000073 No.
I want to pass this value to other table for with value as 10000073.
which statement i should use for deleting the zeros
hi,
I have suppose 0010000073 No.
I want to pass this value to other table for with value as 10000073.
which statement i should use for deleting the zeros
2007 Nov 29 7:47 AM
data: w_vbeln type vbak-vbeln,
w_char(10).
w_vbeln = '000012345'.
write w_vbeln to w_char no-zero.
2007 Nov 29 7:47 AM
Hi,
You can use the fm CONVERSION_EXIT_ALPHA_OUTPUT
or you can use the SHIFT.
SHIFT <yourField> LEFT DELETING LEADING '0'.Regards,
Omkar.
2007 Nov 29 7:47 AM
Hi,
Use the statement as below:
SHIFT C LEFT DELETING LEADING '0'.
2007 Nov 29 7:48 AM
data: lv_swap type c length 10.
write your_variable to lv_swap no-zero.
2007 Nov 29 7:48 AM
U can even make use of the function module
CONVERSION_EXIT_ALPHA_OUTPUT
2007 Nov 29 7:50 AM
ch = '0010000073'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = ch
IMPORTING
OUTPUT = ch.
2007 Nov 29 7:51 AM
The function Module 'CONVERSION_EXIT_ALPHA_OUTPUT' is used to remove the leading zeros in a field.
the following is a sample code which i have used for 'Commitment item' in my report. replace the field with your required field.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IT_FMIT1-RFIPEX
IMPORTING
OUTPUT = IT_FMIT1-RFIPEX.
Rewards if useful.
2007 Nov 29 7:52 AM
Conversion exit ALPHA, external->internal
ALPHA conversion is used especially with account numbers. During conversion from the external to the internal format, the system checks to see if input in the INPUT field is purely numeric, that is, if this input consists only of numbers, possibly with spaces before and after them. If this is the case, then the number string is inserted right- justified in the display field OUTPUT and all spaces to the left of the value are filled with zeroes ('0'). If the input is not purely numeric, it is inserted in the display field from left to right and all extra spaces are filled with blanks.
Example:
(Input field and output field are both eight characters in length)
1. '1234 ' --> '00001234'
2. 'ABCD ' --> 'ABCD '
3. ' 1234 ' --> '00001234'
Conversion from the internal to the external format (function module CONVERSION_EXIT_ALPHA_OUTPUT) is undertaken in exactly the opposite manner.