11-08-2006 7:16 AM
Hi all,
Is there any way to have filter on character fields to get the data even if the input is not given without padding zeroes before the data. for eg in ALV grid display if the data is having 7 characters but total field length is 10 chars then in filter we have give 3 zeroes leading to the data to get the filtered condition. is there any way to avoid this so that the users can give directly the data without leading zeroes.
11-08-2006 7:21 AM
Hi,
use the function module
<b>CONVERSION_EXIT_ALPHA_INPUT</b> converts any number into a string fill with zeroes, with the number at the extreme right
Example:
input = 123
output = 0000000000000...000000000000123
Hope it helps.
Reward if helpful.
Regards,
Sipra
11-08-2006 7:31 AM
l_var (fild which u declared)
use the function module
CONVERSION_EXIT_ALPHA_INPUT
in export pass l_val
in import get l_val.
ok
Regards,
Ramesh.
11-08-2006 8:47 AM
Another way is to use the data element for the particular field similar to VBELN. In that case you can enter the filter with or without zero's and it would be taken care off.
Regards
Anurag
11-08-2006 9:45 AM
Hi sathya,
in your itab declare the same field referring to Db table.
this will take care of the padding of zeros as alpha routine is applied on that filed.
so the user can proceed with the same by not giving the input padded with zeroes.
below code will give u an idea.
data : val1 like vbak-vbeln value '0005002030'.
data : val(10) type c value '0005002030'.
write:/ val.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = val
IMPORTING
OUTPUT = val.
write:/ val.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = val1
IMPORTING
OUTPUT = val1.
write:/ val1.
i agree with anurag ..
regards,
VIjay
11-08-2006 12:14 PM
Hi,
I have declared the fields same as the database field only. But in the report only if we pad zeroes manually the filter is working. How can I apply the function module when the user clicks filter for all the character fields. I think it is impossible. but I wnat to avoid the users to enter zeroes before the input. please help
11-08-2006 12:54 PM
It does not work like that as it is the property of the domain/data element which drives that ...If you follow my post..you need to define the field like VBELN to use the particular property of the domain.
11-08-2006 1:21 PM
Hi,
If you have declared the field inside an internal table, loop that internal table and pass the value to the FM CONVERSION_EXIT_ALPHA_INPUT,by which you will be able to filter for all the character fields.
Regards
Yamini.A