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: 

field should fetch lower & upper case in select options

Former Member
0 Kudos

Hi,

I have one field in select option if i give input 'post'  its fetching only small letters.in this case i need to fetch both Upper and Lower cases.in domain for this field lower case button in cheked with mark.so dont want to change that.pls do needful.

6 REPLIES 6

former_member197916
Active Participant
0 Kudos

hi,

you will need to fetch the relevant records into an internal table and do as much filtering as possible to fetch only relevant data.Convert the  field to UPPERCASE by using TRANSLATE statement and do your comarparison in uppercase.


you can also check if the domain of field has characteristic 'lower case' as flagged,if it is not then you would not need to use additional logic.

hope it helps

0 Kudos

can u send me any sample code for this

0 Kudos

can you explain which fields are you trying to compare and how because when you enter and save data sap translates it to uppercase and then saves it.So this issue is not faced everyday.

If you  are keen on using this text field as both uppercase and lowercase and i think it is a custom develpoment then you can have a key field in your table and you fetch on that field and not on its description like

key            desc

NA            NAME

NA            Name

NA            NaMe

so you fetch on key only.

Other option is that if your data is not very large then you can fetch all the data and loop over it and check if the string contains your data or not like

p_name = 'name'

loop at itab into wa.

  IF wa CS p_name.

your logic

else.

your deletion logic.

endif.



hope it helps

Former Member
0 Kudos

Hi Ramu,

In case if it is character field use the field MAKT-MAKTX in select options. It will not translate any text.

If you want a specific character length create a domain and data element and specify as like as MAKTX or find in se11 using text + length.

EX: if you want 20 characters , se11 --> data type --> text20

0 Kudos

hi sabareesh,

for example in selection screen i am giving in customer name field as RAMU in this case i am getting output with capital RAMU Cust Details but i need Small letter ramu details also..PLs do need full.

0 Kudos

Hi Ramu

Ultimately you will have to code the search to look-up the values as entered.

If the value is entered as RAMU, ramu or RaMu...you'll need to figure that out as per the content from the rest of the community above.

One way that SAP deals with this is that some search fields are stored twice. So 'RaMu' is entered into Field01...On saving Field01 has a matched field being of Uppercase only...so Field01Search for example save RaMu as RAMU.

Now when the someone searches for RaMu... the search translates this to 'RAMU' and then search field Field01Search and gets a hit.

Hope this helps

Regards

Arden