on 03-12-2014 9:34 AM
Hi,
I am using OVS and It's working fine for Text but when I try to search all data by ' * ' in numeric field like Customer Id then no result
comes.
I try to find the solution but did not get but Cause of problem I have got.
Customer Id is char 10 and it is stored in form of preceding zero so this zero is creating issue at the time of search.
Thanks and Regards,
Amit
Hi Amit,
According to my understanding you cannot use * with numeric field because it will abap through an error message. "Enter numeric value".
So you have to go with OVS with normal text type and in select query where condition use LIKE syntax.
Hope this will solve your issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit,
Amit wrote:
when I put zero then it's working.
As you said, if you put a zero it works, that means in your table, the data is stored for only 9 digits and first digit is stored as 0. i.e. you are using only 9 digits of 10.
If that is the case, you can always concatenate a zero at 1st place for your search parameter
Example:
If user inputs:
- 2* then... 02% will be queried against database table
- *24* then.... no need to concatenate a zero.... %245%
i.e.
DATA LV_KUNNR type CHAR10.
"get search querie into LV_KUNNR
Replace all occurrence of '*' with '%' in lv_KUNNR.
if lv_kunnr+0(1) ne '%'.
concatenate '0' lv_kunnr into lv_kunnr.
endif.
... select *
from ztable
into lt_data
where kunnr like lv_kunnr.
Hope this helps you.
Regards,
Rama
Hi Prachi,
Suppose Customer Id is char 10 and I am trying to search 2* then Conversion Routine FM convert it into '000000002*' and it gives result like '0000000021' '0000000022' '0000000023' '0000000024' etc.
I want '2000000001' '2000000002' '2000000003' '2121381357' etc.
Thanks and Regards,
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
In your OVS Code please use Conversion Routine FM 'CONVERSION_EXIT_ALPHA_INPUT' for Customer Id.
Regards,
Prachi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit,
Yes, thats true that the values of numberic field are stored with preceding zeros.
but the solution provided in the link : OVS - Search with '*' not working also for numberic field and it should work.
Please share your code, for further analysis.
Regards,
Rama
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.