Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with upper/ lower case in HR report...

Former Member
0 Kudos

Hello,

I am working on a HR report. Based on last name on selection screen, I am fetching some data

from intotables.

The problem is, for example in case of last name, the system expects the user to type the

last name in exact case as its stored in database table.

So for example, if last name is "Anja" in database table, then if user types "ANJA" or "anja" or aNja, the

select query does not fetch the data.

How can I modify the query so that, even if user types last name in any case, it should still fetch the

record.

SELECT aPERNR bNACHN b~VORNA

INTO TABLE itab_data

from PA0001 as a

inner join PA0002 as b

on apernr = bpernr

where a~PERNR in S_PERNR

and a~BUKRS in S_BUKRS

and a~KOSTL in S_KOSTL

and a~PERSG in S_EMPGP

and a~PERSK in S_SUBGP

and b~NACHN in S_LAST.

Please help.

Regards,

Jainam.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use NCHMC instead of NACHN as NCHMC stores last name in upper case.

Convert contents of S_LAST to uppercase before using in where clause..

SELECT a~PERNR b~NACHN b~VORNA
INTO TABLE itab_data
from PA0001 as a
inner join PA0002 as b
on a~pernr = b~pernr
where a~PERNR in S_PERNR
and a~BUKRS in S_BUKRS
and a~KOSTL in S_KOSTL
and a~PERSG in S_EMPGP
and a~PERSK in S_SUBGP
and b~NCHMC in S_LAST.  " >> Change

2 REPLIES 2

JozsefSzikszai
Active Contributor
0 Kudos

you have to use PA0002-NCHMC and VNAMC. In these fields the first and the last name of the employee will be saved in capitals (these are the fields, which are used by the standard search helps as well)

Former Member
0 Kudos

Hi,

Use NCHMC instead of NACHN as NCHMC stores last name in upper case.

Convert contents of S_LAST to uppercase before using in where clause..

SELECT a~PERNR b~NACHN b~VORNA
INTO TABLE itab_data
from PA0001 as a
inner join PA0002 as b
on a~pernr = b~pernr
where a~PERNR in S_PERNR
and a~BUKRS in S_BUKRS
and a~KOSTL in S_KOSTL
and a~PERSG in S_EMPGP
and a~PERSK in S_SUBGP
and b~NCHMC in S_LAST.  " >> Change