SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Convert string to Uppercase



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Programming Techniques | Приемы программирования -> Conversion
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Sat Jan 31, 2009 7:22 pm    Post subject: Convert string to Uppercase Reply with quote

Using FM AIPC_CONVERT_TO_UPPERCASE

Code:
REPORT zcreate_report.
 
* TYPES
TYPES: BEGIN OF ty_code,
         line TYPE char255,
       END OF ty_code.
 
* CLASSES
CLASS cl_gui_frontend_services DEFINITION LOAD.
 
* INTERNAL TABLES
DATA: data_tab TYPE STANDARD TABLE OF file_info.
DATA: wa TYPE file_info.
DATA: ti_code TYPE STANDARD TABLE OF ty_code.
 
* VARIABLES
DATA: name TYPE PROGNAME.
DATA: count TYPE i.
DATA: bytecount TYPE i.
DATA: filename TYPE string.
 
* SELECTION-SCREEN
PARAMETERS: p_dir TYPE string OBLIGATORY DEFAULT 'C:\test\'.
 
*** START-OF-SELECTION
START-OF-SELECTION.
 
  CLEAR count.
  CALL METHOD cl_gui_frontend_services=>directory_list_files
    EXPORTING
      directory        = p_dir
      files_only       = 'X'
      directories_only = space
    CHANGING
      file_table       = data_tab
      count            = count.
  IF count EQ 0.
    MESSAGE i000(zsd1) WITH 'No files found'.
    EXIT.
  ENDIF.
 
  LOOP AT data_tab INTO wa.
 
    CALL FUNCTION 'AIPC_CONVERT_TO_UPPERCASE'
      EXPORTING
        i_input  = wa-filename
      IMPORTING
        e_output = wa-filename.
 
    CONCATENATE p_dir wa-filename INTO filename.
 
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                = filename
        filetype                = 'ASC'
      IMPORTING
        filelength              = bytecount
      TABLES
        data_tab                = ti_code
      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.
    CHECK sy-subrc EQ 0.
    READ TABLE ti_code TRANSPORTING NO FIELDS INDEX 1.
    CHECK sy-subrc EQ 0.
 
    name = wa-filename.
    INSERT REPORT name FROM ti_code.
 
  ENDLOOP.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Programming Techniques | Приемы программирования -> Conversion All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.