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

Lower case to UPPER CASE

Former Member
0 Likes
3,503

Hi,

I've one .csv file. Few of the columns in file have lower case letters.

Can I convert all lower case letters into upper case using a ABAP? But I do not want to change any column settings etc i.e. column sequence should remain same.

Is it possible? Please let me know.

Regards,

Vikrant.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,175

Hi vikrant,

1. TRANSLATE itab-fieldname to UPPERCASE.

regards,

amit m.

Hi,

I've one .csv file. Few of the columns in file have lower case letters.

Can I convert all lower case letters into upper case using a ABAP? But I do not want to change any column settings etc i.e. column sequence should remain same.

Is it possible? Please let me know.

Regards,

Vikrant.

10 REPLIES 10
Read only

Former Member
0 Likes
2,176

Hi vikrant,

1. TRANSLATE itab-fieldname to UPPERCASE.

regards,

amit m.

Read only

Former Member
0 Likes
2,175

upload file to internal table

Then u can LOop at the output table and convert the lowercase to uppercase using

TRANSLATE wa1 TO UPPER CASE.

Read only

Laxmana_Appana_
Active Contributor
0 Likes
2,175

Hi,

Use TRASLATE option.

Ex : Traslate x_text to Upper Case.

Regards

Appana

Read only

Former Member
0 Likes
2,175

U can use translate to uppercase and translate to lower case. u can read that file to an internal table.

Why do u think that sequence will change?

Read only

Former Member
0 Likes
2,175

Hi,

Use this FM 'AIPC_CONVERT_TO_UPPERCASE' to convert a string from lower case to upper case while processing your data.

Thanks,

If this helps you reward with points.

Read only

abdul_hakim
Active Contributor
0 Likes
2,175

hi

use TRANSLATE <field name> TO UPPERCASE.

Cheers,

Abdul Hakim

Read only

Former Member
0 Likes
2,175

hi vikrant

TRANSLATE Tablename-Fieldname TO UPPER CASE.

if u hv multiple records,

Loop at table.

TRANSLATE workarea-Fieldname TO UPPER CASE.

endloop.

Naveen

Read only

Former Member
0 Likes
2,175

You have to use

TRANSLATE <c> TO UPPER CASE.

Read only

Former Member
0 Likes
2,175

Hi,

after uploading the Data to itab, then loop that itab and use TRANSLATE to convert the fieldvalue to Uppercase.

Loop at itab.

TRANSLATE ITAB-FIELD TO UPPER CASE.

endloop.

Regards

vijay

Read only

Former Member
0 Likes
2,175

Hi Vikrant,

Can try out the following logic:-


loop at <internal_table> into <work_area>.
  TRANSLATE <work_area-field_name> to UPPER CASE.
  MODIFY <table> from <work_area>.
endloop.

Can check out the following example code :-


REPORT  ztest_file                                 .

TYPES : BEGIN OF tp_tab,
         col1(50) TYPE c,
         col2(50) TYPE c,
        END OF tp_tab.

DATA : int_tab TYPE STANDARD TABLE OF tp_tab,
       wa_tab TYPE tp_tab.

START-OF-SELECTION.

  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                      = 'C:FLAT_FILE.TXT'
      filetype                      = 'ASC'
      has_field_separator           = 'X'
    TABLES
      data_tab                      = int_tab
   EXCEPTIONS
     file_open_error               = 1
     file_read_error               = 2
     no_batch                      = 3
     gui_refuse_filetransfer       = 4
     invalid_type                  = 5
     no_authority                  = 6
     unknown_error                 = 7
     bad_data_format               = 8
     header_not_allowed            = 9
     separator_not_allowed         = 10
     header_too_long               = 11
     unknown_dp_error              = 12
     access_denied                 = 13
     dp_out_of_memory              = 14
     disk_full                     = 15
     dp_timeout                    = 16
     OTHERS                        = 17
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  ELSE.
    LOOP AT int_tab INTO wa_tab.
      translate wa_tab-col1 to Upper case.
      WRITE : wa_tab-col1,
              wa_tab-col2.
    ENDLOOP.
  ENDIF.

Hope this helps you.

Regards,

Anirban.