cancel
Showing results for 
Search instead for 
Did you mean: 

Star ( * ) Search On Numeric Field Is Not Working

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Ravi,

Customer Code is char 10 as I have mentioned so I can use * here.

Thanks and Regards,

Former Member
0 Kudos

Hi Amit,

I think you can use it with LIKE syntax in OVS query. Could you please check and let me know if you are having issue.

ramakrishnappa
Active Contributor
0 Kudos

Hi Amit,

Is your issue resolved ?

Regards,

Rama

Former Member
0 Kudos

Hi Rama,

No , Issue is still same

Regards,

Amit

ramakrishnappa
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi ,

In your OVS Code please use Conversion Routine FM  'CONVERSION_EXIT_ALPHA_INPUT' for Customer Id.

Regards,

Prachi

ramakrishnappa
Active Contributor
0 Kudos

Hi Amit,

Please find my answer in the below discussion.

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Hi Ramakrishnappa,

I have done same as You have told in your solution but it's not showing result.

when I put zero then it's working.

Thanks and Regards,

Amit

ramakrishnappa
Active Contributor
0 Kudos

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