cancel
Showing results for 
Search instead for 
Did you mean: 

Ignoring case.................

Former Member
0 Kudos

Hello Experts ,

I am trybin to read data from infotype table pa0002 . I am accepting the Last name ( vorna ) as input .

I am trying to fetch matching records in internal table USING SELECT QUERY .

But the name (vorna ) is *case sensitive* so in table name can be stored as

Rahul

RAHUL

rahul

If user input is RahuL . Query return zero number MATCHING of records .

My requirement is Query should return all three matching records .

How can i do the comparison of name to retrive all matching records IGNORING THE CASE .

i tried following query

SELECT PERNR VORNA NACHN GBDAT FROM PA0002

INTO CORRESPONDING FIELDS OF TABLE ITAB

WHERE upper( VORNA ) = upper( STRU_USERIP-VORNA )

AND ENDDA >= SY-DATUM

AND BEGDA <= SY-DATUM .

But wont work since UPPER is not allowed ,

can anyone provide solution to this problem .

Your Help will be appericiated .

thks ,

Rushi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

when you get the value in lv_value using get_attribute method of if_wd_context_node.

translate lv_value to upper case.

now pass this to SELECT query.

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha ,

The value stored in pa0002-vorna column are not in upper case .

when i check records in pa0002-vorna in se11 i can see records as

Rahul

Adam

SHRMA

shReya

domain use for the field has Lowercase property check boxe as TICKED .

Former Member
0 Kudos

Hi,

If you want to have an exact match for user's entry then you need to use the EQ query.

otherwise you need to use the Search patterns(like CN,CP etc).

What is the data type you have used for context attribute..Use the same type as VORNA....

What exactly you want.

Regards,

Lekha.

Former Member
0 Kudos

Thanks Lekha for replying ,

I am trying to develop Employee Search application ,

On one view i hv 2 ip fields first name , last name ., one button ,

and table to display employee number ( pernr ) , employee first name ( vorna ) , last name ( nachn ) .

user enter s fname , last name . and click on button .

nopw i want to display records from table pa0002 whose fname (nachn ) , last name ( vorna ) matches with fname , last name just entered by the user .

now in table name information is stored in mixed format . means some of names are in yupper case ,some are in lower case ,

like name rahul can be present intable any of the following format .

suppsoe table has 4 records

rahul

Rahul

RAHUL

rAHul

now in my application when user enters RAHUL as ip .then only third record in above list get displayed as result .

if user enters rahul as input i want all 4 records to be displayed as result .

I just want to ignore the case of name . of both name present in database table and of name entered by the user as input .

or simplay tell me the query which will work in abap and have functionality as that of following query

SELECT PERNR VORNA NACHN GBDAT FROM PA0002

INTO CORRESPONDING FIELDS OF TABLE ITAB

WHERE upper( VORNA ) = upper( STRU_USERIP-VORNA )

AND ENDDA >= SY-DATUM

AND BEGDA <= SY-DATUM .

Thks ,

Rushi

Former Member
0 Kudos

HI,

As you have explaiend above, the decision of fecthing records is upto you..

RAHUL = exact match

rahul= all records

hope your context attribute is using the domain as vorna..or else consider the string.

Please refer this thread for my reply...I have some similar test case as yours...

Regards,

Lekha.

Edited by: Lekha on Nov 2, 2009 4:55 PM

Former Member
0 Kudos

Hello Lekha ,

I tried both domain vorna as type of the attribute as well as string . but in both cases it gives me the result for exact match .

But i wnat result for all records and not exact match .

.

Edited by: RUSHI123 on Nov 2, 2009 1:05 PM

Sm1tje
Active Contributor
0 Kudos

what about the field VNAMC in which the (first) name is stored in upper case. These fields are used in the search help, and are especially useful for selecting data withouth having to take the case sensitivity in account. Whether one enters RAHUL, or RAhul, or raHUL, all names are stored as RAHUL.

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

There are few ways to ignore case while selecting values :

1. Have all the records in either Capitals or Small Letters in DataBase Table.

2. Have one extra column with either Capitals or Small Letters to do search.

3. Declare Range Tables.

An Example of Ranges :

a. Range declared for which search criteria is there.

Data : lr_name TYPE RANGE OF fmfint-bezeich,

lr_name_line LIKE LINE OF lr_name.

Data lt_rfc type table of fmfint,

wa_rfc type fmfint,

w_output type fmfint,

t_output type table of fmfint.

b. i_name is the value entered by user in Search Criteria.

if i_name is not initial.

lr_name_line-sign = 'I'.

lr_name_line-option = 'CP'.

lr_name_line-low = i_name.

APPEND lr_name_line to lr_name.

ENDIF.

c. Select all records.

select * from fmfint into table lt_rfc.

d. Filter records using Loop and where condition

loop at lt_rfc into wa_rfc where

bezeich IN lr_name.

MOVE-CORRESPONDING lw_rfc TO w_output.

APPEND w_output TO t_output.

CLEAR: w_output,lw_rfc.

endloop.

.

now finally you have all records based on input entered in table t_output.

Former Member
0 Kudos

Thks to all those who replied ,

problem is solved and so thread is closed .

thks ,

Rushi

Former Member
0 Kudos

Hi Rushi ,

I have seen that you have solved the issue of ignoring upper case ..

I am facing same issue here.. I have an input field in which I will enter the value in any case and values in the data base are also in mixed cases. eg: Activity, Some are in Upper like ACTIVITY.. When I translate the input field value to Upper case and search then I am able to get only Upper case values but not mixed case values..

Please suugest me what to do to solve this...

Thanks in advance!

Misbah ..