Application Development and Automation 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: 
Read only

CASE SENSITIVE

Former Member
0 Likes
5,754

hi guys,

The parameter converts the value into UPPERCASE. Is it in Settings that I need to configure? Or is it in BASIS side? How?

I was able to handle this when I code

employee search. but when i used a standard bapi. it converts to uppercase and it doesn't return a record. Of course I can't edit the standard bapi and placed a select-option to ignore the case.

And there are some cases that they require lower case in modifying dbase.

Please guide me. Thanks!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,739

Thanks guys! but i can't apply this in function modules in creating a record

20 REPLIES 20
Read only

sridharreddy_kondam
Active Contributor
0 Likes
3,739

Hi Bayog,

Just declare the parameter as

PARAMETERS PROGRAM LIKE SY-REPID lower case.

Is this what u r looking for ?

and i doesnt think that Database updation will be case sensitive....

Regards,

Sridhar

Read only

Former Member
0 Likes
3,739

Hi,

This is the default setting when you parameters.

This can be overridden using the addition.

... LOWER CASE

<i>Effect</i>

The parameter allows case-sensitive input.

Ex:

PARAMETERS: snode      TYPE pvs_pnode LOWER CASE. 

Regards,

AS

Read only

dani_mn
Active Contributor
0 Likes
3,739

HI,

use the following function module to change your case from the upper to lower or lower to upper.

<b>EDITOR_LINE_TRANSLATE_CASE</b>

<b>data: a type RSTXP-TDLINE.
data: b type RSTXP-TDLINE.

a = 'ABDCCC'.

CALL FUNCTION 'EDITOR_LINE_TRANSLATE_CASE'
  EXPORTING
    I_LINE            = a
   WANTED_CASE       = 'LOWER'
 IMPORTING
   O_LINE            = b.

   write:/ b.</b>

Regards,

HRA

Read only

Former Member
0 Likes
3,739

Thanks guys! But the user's input is mixed-case. Like, Firstname Lastname Jr.

Read only

0 Likes
3,739

Hi Maui,

Hi,

The additon

... LOWER CASE

<i>Effect</i>

The parameter allows <b>case-sensitive</b> input.

Conisder this code,


REPORT  zztest_sdn_1                                                .


PARAMETERS: name(50) TYPE c LOWER CASE DEFAULT 'ArUn SaMbArGi'.


START-OF-SELECTION.


  WRITE : / name.

Output:

ArUn SaMbArGi

Regards,

<b>AS</b>

Read only

0 Likes
3,739

Hi Bayog,

Better use this statement

<b>parameters</b> p1 type matnr .

start-of-selection.

<b>TRANSLATE</b> p1 to lower case.

write p1.

This should work...

Regards,

Sridhar

Read only

Former Member
0 Likes
3,740

Thanks guys! but i can't apply this in function modules in creating a record

Read only

0 Likes
3,739

Hai Bayog,

Could u elaborate in detail what exactly u need..

Regards,

Sridhar

Read only

0 Likes
3,739

Hi Sridhar!

I'm doing a bapi where in you will create an employee record. But when I input a name in the parameter it automatically converts the name into UPPERCASE. They want an output of whatever case they input it would reflect in the database.

Read only

0 Likes
3,739

Hi Bayog,

It is possible u can insert into data base table the way user enters in the input...

If the Domain referring the field of the database table has an option as Lower Case .. then only it allows the way user entered will be updated into database...

First check whether the databse table u r inserting has

<b>SE11</b> --> <b>enter table</b> --> <b>F7</b> --> now for field <b>double click</b> the DataElement --> and <b>Double click the Domain</b> --

and <b>check Lower case check box is sele</b>cted...

If this is selected then whatever is entered in Parameters will be inserted into data base ...

If the domain has Lower case check box selected then u can insert as user enters ( say SaMplE)

Now this works as i tested

Report XYZ.

tables Ztest_1.

PARAMETERS name1 type ZTEST_1-ename lower case.

  • entered SaMplE

ztest_1-ename = name1.

Insert ztest_1

      • try once by createin ZTest_1 with files ename and Dataelement and Domain as mentioned

    • ename refers Dataelement ZXYZ and Lowercase option selected for domain of DE

This definitely will solve u r problem...

if not u r welcome ....

Regards,

Sridhar

Read only

0 Likes
3,739

Thanks sridhar!

But can I use this in a function module? the name is in the import param.

Read only

0 Likes
3,739

Hi Bayog,

Yes u can use this in Function module also...

Try this ...which has successfully done according to u r req.

REPORT ZSDFSD .

tables Ztest_1.

PARAMETERS name1 type ZTEST_1-ename lower case.

  • entered SaMplE

CALL FUNCTION 'ZTEST125'

EXPORTING

NAME = name1

EXCEPTIONS

RECORDEXISTS = 1

  • OTHERS = 2

.

IF SY-SUBRC = 1.

write:/ 'The name already exists'.

ENDIF.

**in FM ZTEST125 source code is

tables ZTESt_1.

ztest_1-ename = NAME.

Insert ztest_1.

if sy-subrc <> 0.

RAISE recordexists.

endif.

Regards,

Sridhar

Read only

0 Likes
3,739

Thanks sridhar,

But in a function module, we declare parameter in the import tab where you specify the data type not in codes. And from there, it converts to UPPERCASE. How will I include lower case in the data declaration?

Read only

0 Likes
3,739

Thanks sridhar,

But in a function module, we declare parameter in the import tab where you specify the data type not in codes. And from there, it converts to UPPERCASE. How will I include lower case in the data declaration?

I can't use your code 'coz it is already declared in the import parameter.

PARAMETERS name1 type ZTEST_1-ename lower case.

Read only

0 Likes
3,739

Hai Bayog,

U can declare in the FM also ...

In se37 --> Import parameters --> parameter name --> name ,type type and asscociated type ZTEST_1-ENAME..

And if not solved pls. do elaborate more what actual u need from the program by calling FM...

Regards,

Sridhar

Read only

0 Likes
3,739

ei sridhar,

Actually I'm doing a FM wherein the import parameter: Name must be entered in LOWERCASE. But then once I hit F8 it conerts to UPPECASE. Is there a data element that I can put in the associated type that it doesn't convert the value into UPPERCASE and will append in the table in LOWERCASE?

Read only

0 Likes
3,739

Hi Mayog,

Eventhough we assigh to the domain lowercase option it doesnt work...so better option is to use translate statement within the FM..

Try this within the source code of FM...

tables ZTESt_1.

ztest_1-ename = NAME.

translate ztest_1-ename to lower case.

Insert ztest_1.

if sy-subrc <> 0.

RAISE recordexists.

endif.

Regards,

Sridhar

Read only

0 Likes
3,739

Im sorry.Not just a lowercase but I want to consider the mixed-case. Like in the Import parameter:

Name: Firstname Lastname.

but when I hit F8.

Name: FIRSTNAME LASTNAME.

Read only

0 Likes
3,739

Hi Bayog,

That is not possible..

Reason >> the FM internally converts the data entered into caps...

and one thing u will call the Function module from the Program (SE38-- so here pass the values as mentioned previously) and then only it works.according to ur req..and we will never execute the FM directly in Real time Scenarios(only in test cases)

But when u directly execute the FM in SE37 this doesnt work and will never work..

SO be clear Try calling the FM from the Program itself(always this is standard)... and as mentioned in earlier mail pass the parameters value or field referring to the DataElement...

Regards,

Sridhar

Read only

Former Member
0 Likes
3,739

Hey,

Let`s say your fm updates a certain table ZNAMES and field NAME1 has to accept lower cases, then at the domain level check the check box lowercase. This will set the values to be updated in the database table without any conversion of Case as supplied by the FM.

Reward if helpful.

Regards