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

Uppercase conversion

Former Member
0 Likes
2,765

Hi all,

i have a requirement wherin the user enters the values in lowercase letters for the address fields in the customer creation which needs to be converted to the uppercase.i tried using the command TRANSLATE (in the user exit include).but when i displayed the customer details using VD03 the details were in lowercase letters.

Is there any way to save them in the uppercase letters so that the details are displayed in the uppercase.or when i press enter the details should get converted to the uppercase.

Thanks in advance

Sandeep.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,897

This kind of thing is usually handled by the DOMAIN which is tied to the DATA ELEMENT of the field in question. Conversion is usually done automatically. It can however be done explicitly using the TRANSLATE statement.

For example, take this program.



report zrich_0001.


parameters: p_file type localfile.

write:/ p_file.

The dataelment here is localfile which uses the domain LOCALFILE which has the "Lowercase" checkbox checked.

Now lets take the same progam and change the type.



report zrich_0001.


parameters: p_file(100) type c default 'C:text.xls'.



write:/ p_file.




Notice when running this program, the value is translated to uppercase automatically.

So, first make sure that the parameter on the selection screen does not have the "Lower case" extension. NExt check the domain of the data element which the parameter is typed like, if lowercase is checked, then this is why it is not being automatically translate to uppercase.

You can use the TRANSLATE statement to translate it to uppercase, but probably not in a user exit.

Regards,

Rich Heilman

10 REPLIES 10
Read only

rahulkavuri
Active Contributor
0 Likes
1,897

TRANSLATE Tablename-Fieldname TO UPPER CASE

check this forum

something to add, goto SE37 search enter this string UPPERCASE* and press F4 u can find some Function modules which can help you to convert

please reward points if found helpful

Message was edited by: Rahul Kavuri

Read only

Former Member
0 Likes
1,897

Hi,

Use this FM AIPC_CONVERT_TO_UPPERCASE Which will take care of local language also.but pass the same parameter in the input and output , so that the field value will be changes to Uppercase.

Or post your part of code where you are doing transalation.

Regards,

Raghav

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,898

This kind of thing is usually handled by the DOMAIN which is tied to the DATA ELEMENT of the field in question. Conversion is usually done automatically. It can however be done explicitly using the TRANSLATE statement.

For example, take this program.



report zrich_0001.


parameters: p_file type localfile.

write:/ p_file.

The dataelment here is localfile which uses the domain LOCALFILE which has the "Lowercase" checkbox checked.

Now lets take the same progam and change the type.



report zrich_0001.


parameters: p_file(100) type c default 'C:text.xls'.



write:/ p_file.




Notice when running this program, the value is translated to uppercase automatically.

So, first make sure that the parameter on the selection screen does not have the "Lower case" extension. NExt check the domain of the data element which the parameter is typed like, if lowercase is checked, then this is why it is not being automatically translate to uppercase.

You can use the TRANSLATE statement to translate it to uppercase, but probably not in a user exit.

Regards,

Rich Heilman

Read only

0 Likes
1,897

Hi Rich,

Thanks a lot for your valuable answer.

I have only one option left wherein i need to uncheck the lowercase checkbox for the domain.

But if I want to use The TRANSLATE command where can I use it in this case(customer creation).

Thanks

Sandeep

Read only

0 Likes
1,897

Need more information, are you working with a custom program with a selection screen? IF so, then you can just translate the values in the AT SELECTION SCREEN event or in the begining of the START-OF-SELECTION event.

Regards,

Rich Heilman

Read only

0 Likes
1,897

Hi Rich,

I am not using a custom program for this.i think i need to make changes in the standard program to achieve this which may not be suggested.Any other solution?

Norman-> i am using the user exit ZXF04U01. Ihis could see the address fields in the user exit.

Thanks

Sandeep

Read only

0 Likes
1,897

The INCLUDE ZXF04U01 is part of enhancement SAPMF02D. You cannot change the KNA1 fields in this user exit.

Read only

0 Likes
1,897

I was looking for other user exits and BAdI's.

My first thought is BAdI CUSTOMER_ADD_DATA with method CHECK_ALL_DATA.

It passes KNA1 as an import parameter. You cannot change the data, but...

You could translate the address to upper case and save in Z variables.

Compare the KNA1 address to the saved Z address.

If different, display an error message and make the user change the address to upper case. The BAdI method allows you to pass a message back to the user.

Read only

Former Member
0 Likes
1,897
Read only

0 Likes
1,897

You tried in a user exit and it did not work?

Or the fields were not available for you?

In some of the customer and vendor master data user exits, only the master table fields are passed. For instance, KNA1-NAME1, etc.

If the user maintains the address with the "envelope" icon, some user exits do not pass these address fields. I do not know which user exit you tried.

You can try the user exit for maintaining address fields. In CMOD or SMOD, look at enhancement SZAD0001 and function module EXIT_SAPLSADR_001. If you check for the customer transactions codes in this user exit (sy-tcode is XD01 or XD02), you might be able to TRANSLATE to UPPER CASE here.