BDC : Function Module to Upload Unicode text file

Hi Friends,
           Can anyone tell me how to upload data to internal table by taking it from unicode text file ?
at present i'm using FM - GUI_UPLOAD which do not support Unicode text file.
Sonal

Hi,
U Have to use CodePage Parameter to upload the data.
Check the Description
Character Representation for Output
Description
Use parameter CODEPAGE to specify the desired source codepage. If this parameter is not set, the codepage of the SAP GUI is used as the source codepage.
Value range
4-digit number of the SAP codepage. The function module SCP_CODEPAGE_BY_EXTERNAL_NAME provides the SAP codepage number for an external character set name, for example, "iso-8859-1". The function module NLS_GET_FRONTEND_CP provides the respective non-Unicode frontend codepage for a language.
The desired codepage can be determined interactively, if the parameter with_encoding of method file_open_dialog is set by cl_gui_frontend_services.
If the specified codepage is not suited for the Byte Order Mark of the file, an exception is triggered.
SPACE: Codepage of the frontend operating system
Default
SPACE

Similar Messages

  • Need Function module to upload an excel file to SAP

    Need Function module to upload more than 100 characters of excel file data into SAP internal table.
    Currently i have two function module
    1. ALSM_EXCEL_TO_INTERNAL_TABLE --32 characters max
    2. KCD_EXCEL_OLE_TO_INT_CONVERT --50 characters max
    Please let me know some pointers.
    Thanks in Advance,
    A.Karthikeyan.

    hi,
    use the FM GUI_UPLOAD
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = W_FILENAME
       FILETYPE                      = W_FILETYPE
       HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
       DAT_MODE                      = 'X'
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = wp_it_upload
    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.

  • Remote function module to download the text file

    Hi Experts,
                   I have a requirement of text file should be downloaded from RFC connection by which function module.Can you please tell me whether this method is used to download text file (CALL METHOD cl_gui_frontend_services=>gui_upload).

    Hi Jaswanth,
    FM used to upload the data from the non sap system to the SAP sytem is the GUI_UPLOAD ans GUI_DOWLOAD is downloading the data from SAP to the presentation server .This file can be xls,tab or space deliminatior ettxt fiel.
    I think this was your requirement.
    Pooja

  • How to read UNICODE text file

    Dear Guru,
    Are there any function module that we can use to upload/read UNICODE text file?
    Please advice.
    Regards,
    Ari

    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                = filenam
        filetype                = 'ASC'
        has_field_separator     = 'X'
      TABLES
        data_tab                = in_rec
      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.

  • Uploading a text file with unknown number of  texts

    Hi ,
    i have a flat file with around  10,000 record's.
    each material number  followed by  different  lengths & unknown number of text's separated by delimiter '$',
    that need to be saved using save_text function module.
    the file is as follows, 
    record 1 :     material1$text1$text2$text3
    record 2 :     material2$text1$text2$text3$text4$text5$text6$.....
    record 3 :     material3$text1$text2$text3$text4$text5
    record 4:      material3$text1
    - - - - - - - - - - - -  so on ....
    i created the following  structure ,  to split and save each text separated by '$'  , to save in TLINE  of save_text function module.
    types : begin of ty_file,
                  matnr type mara-matnr,
                  text1 type string,
                  text2 type string,
                  text3 type string,
                  text4 type string,
                  text20 type string,
               end of ty_file.
    i have uploaded the file and saved in table  it_file type ty_file.
    loop it_file into wa_file.
       split wa_file at '$' in to matnr text1 text2 text3 text4 ....... so on.
    endloop.
    please, suggest me an alternate way to reduce the code, instead of creating a structure like above, so that each splitted text
    stores in a single variable and is passed to TLINE of corresponding material, in save_text function module
    thanks
    viki

    Hi,
    The flat file contains , material No. followed by it's text , each text sepearted by '$' symbol.
    For each material  i have to get all lines of text, and passed to tables paramter of save_text.
    The Number of text' for each material is varying.
    Please kindly suggest me , how many variables i need to create to hold each splitted text and store it in Tline
    I wrote the below program assuming that the material number has  maximum of 20 texts, it's working fine. But, what if the number of texts exceeds 20.
    file :
    4907507$ Druckrolle$ Durchmesser: 218 mm$ Länge: 750 mm$ Rollenwerkstoff: 1.4301/1.4541$ Oberfläche: gummiert$ Stärke Gummierung: 10 mm$ Näscher    E 71224$$$$$$$$$$$$$$                              
    1149598$ Tragrolle$ mit Stützringen$ Norm: ähnlich DIN 22112$ Durchmesser: 89 mm$ Mantellänge: 800 mm$ Form der Achsenden: A2$ Achsdurchmesser: 25 mm$ Achsanflachung: SW 18$ Einlegelänge: 808 mm$ Achslänge: 834 mm$ Lagerbezeichnung: 6305$ Anzahl Stützringe Form A: 6$ Anzahl Stützringe Form B: 4$ Anordnung links: 4$ Anordnung mittig: 6$ Anordnung rechts: 4$ Qualität Stützringe: N$ Durchmesser Stützringe: 159 mm$ Anzahl Zwischenhülsen: 7$ Anzahl Schlussscheiben: 2$ Erbö   3111.800.05.68                                                                      
    file upload
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          static    = 'X'
        CHANGING
          file_name = p_infile.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME            = gd_file
          FILETYPE            = 'ASC'
         HAS_FIELD_SEPARATOR = 'X'
         HAS_FIELD_SEPARATOR = '$'
        TABLES
          DATA_TAB            = It_data.
      loop at it_data into wa_data.
        split wa_data-line at seperator into matnr_txt text1 text2 text3 text4 text5
                                                   text6 text7 text8 text9 text10 text11
                                                   text11 text12 text13 text14 text15
                                                   text16 text17 text18 text19 text20.
        move matnr_txt to wa_material-matnr.
        move text1 to wa_material-text1.
        move text2 to wa_material-text2.
        move text20 to wa_material-text20.
        append wa_material to it_material.
        clear wa_material.
      endloop.
      loop at it_material into wa_material.
        WA_LINE-TDFORMAT = '*'.
        WA_line-TDLINE = wa_material-text1.
        APPEND WA_LINE TO IT_LINE.
        WA_LINE-TDFORMAT = '*'.
        WA_line-TDLINE = wa_material-text2.
        APPEND WA_LINE TO IT_LINE.
        WA_LINE-TDFORMAT = '*'.
        WA_line-TDLINE = wa_material-text20.
        APPEND WA_LINE TO IT_LINE.
        G_THEAD-TDNAME   = wa_material-matnr. " material number
        G_THEAD-TDID     = pa_id.                           "  'GRUN',
        G_THEAD-TDSPRAS  = pa_langu.                "  EN
        G_THEAD-TDOBJECT = pa_obj.                   "  MATERIAL
        CALL FUNCTION 'SAVE_TEXT'
          EXPORTING
            CLIENT                           = SY-MANDT
            HEADER                        = G_THEAD
            SAVEMODE_DIRECT     = 'X'
          TABLES
            LINES           = IT_LINE
          clear : wa_line, g_matnr.
          refresh it_line.
      endloop.
    Edited by: jvsvijay on Jul 28, 2011 12:51 PM
    Edited by: jvsvijay on Jul 28, 2011 12:53 PM
    Edited by: jvsvijay on Jul 28, 2011 12:55 PM

  • How to upload Unicode encoding files from web?

    Hi everyone,
    I do not manage to upload Unicode encoding CSV files from web. Currently I use class CL_HTMLB_MANAGER to upload file from web. It works fine with ANSI encoding files, but file content is not uploaded correctly with Unicode encoding files. Especially I get innumerable characters u201C#u201D throughout the string that contains the file content (For example instead of u201CSAP CATALOG CSV 2.0u201D I get u201CÿþS#A#P# #C#A#T#A#L#O#G# #C#S#V# #2#.#0#u201D).
    I did not find in forums a solution to my issue that is why I am now asking for your help.
    How can I upload Unicode encoding files from web? Do you know another way to upload file from web that is Unicode compatible?
    Remark: I tried to upload Unicode encoding files from SAP GUI using function module GUI_UPLOAD and upload is successful.
    Here is the code that I currently used.
    DATA:     lr_event_ex     TYPE REF TO if_htmlb_data,
               fileupload      TYPE REF TO cl_htmlb_fileupload,
               lr_upload_model TYPE REF TO /ccm/cl_bsp_upload_model,
               lr_error        TYPE REF TO /ccm/cx_file_upload.
    lr_event_ex =  cl_htmlb_manager=>get_event_ex( runtime->server->request ).
    IF lr_event_ex->event_name = 'fileUpload' AND lr_event_ex->event_type = 'upload'.
      fileupload ?= lr_event_ex.
      FREE lr_event_ex.
    * get the model
      lr_upload_model ?= me->get_model( model_id = 'mupl' ).
      IF NOT fileupload->file_name IS INITIAL.
    *   upload data
        TRY.
            CALL METHOD lr_upload_model->upload_data
              EXPORTING
                iv_file_name = fileupload->file_name
              CHANGING
                cv_xcontent  = fileupload->file_content.
          CATCH /ccm/cx_file_upload INTO lr_error.
        ENDTRY.
        FREE fileupload.
      ENDIF.
    ENDIF.
    Thank you in advance for helping me.
    Best regards,
    Vanessa

    Hi There,
    Please check the details for the same.
    Link: http://helpx.adobe.com/creative-cloud/help/sync-files.html#Sync or upload files
    Troubleshoot sync:     
    Error: "Unable to sync files"
    Creative Cloud File Sync | Known issues
    Thanks,
    Atul Saini

  • Error while uploading standard text files for the Global rule set

    Hi all,
    As part of Post Installation Activities we have uploaded standard text files for business process, functions, risks and rule set obtained with the installable Software.
    While uploading the text files we have uploaded the Basis Functions Authorizations first and then R/3 text files.
    When we checked no actions are appearing in the rule architect under respective functions except for the BASIS Module.
    Is this because we have uploaded the Basis functions before the R/3 text files?If yes, how to replace the Basis with the R/3 ones.
    We tried to replace the Basis function authorizations by re-uploading the R/3 text files again but we got the below error message u201CORA-00001:unique constraint (SAPSR3DB.SYS_C004479) violatedu201D
    Can somebody please help in this regard how to get the standard rule set in our system?
    Thanks and Best Regards,
    Srihari.K

    Hi Sri,
    you should upload first the static text files and the authorization objects first and then the GRC standard rule set files following the instructions of the SAP Configuration Guide available in Service Market Place under http://service.sap.com/instguides .
    The GRC standard rule set contains files named Basis_functions_action.txt and R3_function_action.txt. The first one contains ONLY function definitions in terms of transcation codes for basis only, whereas the second one contains functions definition for basis AND ERP modules. The same holds for the *_function_permission.txt files. There are also function definition files for other SAP solutions such as APO, CRM, HR  etc.
    You can open a customer message and request a deletion script for the rule sets files you have uploaded already. After their application of this script all rule set data will be deleted from your database. If you have uploaded static text and authorization files correctly, you can then upload the GRC standard rule set files as needed again.
    best regards,
    Frank

  • Function module to upload Excel in version 3.1

    Hi,
           Please can anybody tell me what is the function module to upload Excel sheet in SAP version 3.1.its urgent
        And also the user-command in radio buttons is not working in version 3.1. Please suggest me the right code for radio buttons in 3.1 version.
    please find the following code for radio buttons
    SELECTION-SCREEN BEGIN OF BLOCK blck WITH FRAME TITLE text-001.
    PARAMETERS:  r_local radiobutton group g1 user-command ucomm,
                             r_app radiobutton group g1,
                             p_filename  LIKE  rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK blck.
    Thanks in Advance....
    Regards,
    Swapna
    Edited by: Alvaro Tejada Galindo on Feb 29, 2008 10:22 AM

    Hi,
    Use Ws_upload function module.
    Regards,
    Sunil

  • Function Module For Upload the Powerpoint Template in Webdynpro ABAP

    Hi,
      Can anyone tell me, is there any standard function module to upload the Powerpoint Template to Webdynpro ABAP.
    Regards,
    Saran

    Hello Saran,
    for uploading the powerpoint as file you could use the FileUpload ui element.
    Best regards,
    Thomas

  • How to upload a text file from a shared folder and provide an o/p

    how to upload a text file from a shared folder and provide an o/p  containing the details in each order in the text file

    Hi,
    Use <b>GUI_UPLOAD</b> to upload a text file from a shared folder.
    Use <b>GUI_DOWNLOAD</b> to download data in a file on the presentation server or use <b>OPEN DATASET, TRANSFER</b> and <b>CLOSE DATASET</b> statements to download data to the application server.
    Now, I hope the code for data fetching, if required, is already present in the report.
    Reward points if the answer is helpful.
    Regards,
    Mukul

  • 'No Upload Authorization' While Uploading a Text File from Multiple Select

    Hi all,
       The User is trying to upload a text file from Multiple Selection screen of a Query in BEx and it gives the error message of 'No Upload Authorization' (Error DB886).
       In 'Logon data' tab of Tcode SU01, it has 'User' for 'User Group for Authorization check' for this User.
       I could upload a text file from Multiple Selection screen with my User Id.
       An idea about this error, PLEASE ?
    Thanks,
    Venkat.

    Hi Ron,
       This User does not have the access to Tcode ST01.
       The user executed Tcode SU53 immediately following the authorization failure to see the authorization objects. The 'Authorization obj' is blank and under the Description it has 'The last Authorization check was successful' with green tick mark.
      Any further suggestions, PLEASE.
    Thanks.

  • Uploading a text file to FTP Loc

    Hi,
    Please guide me in the following query:
    While uploading a text file to FTP Loc by using FM 'FTP_R3_TO_CLIENT', all the data is coming in one line. Please guide me how can i insert the new line character after the end of each line.
    Please guide.
    Thanks and Regards

    Hi,
    When i make the character_mode = 'X', then no data is getting uploaded to FTP Loc, only a blank file is being created. Please guide.
    Thanks and Regards
    Edited by: MP Vashishth on Jan 12, 2010 10:34 AM

  • Upload a text file of values when run a query

    In SAP BW 3.x BEx Analyzer, we can import a text file with list of values for each variable.
    For example, you want to run a report for certain product numbers, but say the prod no list is of 3000 no's long, it'll take the user forever to select and enter them in the report entry variable, so instead you upload a text file, with all this list of 3000 prod no's and run the report.
    Does this option still exist anywhere for version 7.0? BI Analyzer is different than Bex Analyzer. Can anyone explain it? Thanks!

    Hi Qingbo,
    Not using any standard solution (i don't know any in 3.5) you can use an variable of type exit. Inside the variable value calculation, you can use a flat file stored in the application server to read the values of the variable.
    Another option is to store those values in a cube (mantained using flat file upload or a BPS layout) and use a replacement path variable using a query over this cube to run the query you need.
    Hope this helps.
    Regards,
    Diego

  • How to upload a text file to a webpage and process it using a Java app?

    Apologies if the question is off topic.
    I would like a user to upload a text file to a webpage and have a pre-existing Java application I created process the text file and return the results to the user. The Java application is fairly memory intensive. It is expected that multiple clients will be uploading at the same time. What is the simplest or most efficient method to achieve this?
    Thank you

    This might help you to get started: http://www.roseindia.net/jsp/file_upload/Sinle_upload.xhtml.shtml
    As done in this example, processing the uploaded file in the JSP itself may not be a good idea though. You're better off handling it in your controller servlet or action class.

  • Any function module to translate the text

    Hi all,
    I have a requirement like, in the report i have to display the headings according to languages chosen
    dynamically.
    let me know is there is any process or Function module to translate the texts.
    Regards,
    Madhavi

    Hi,
    you can use SE63 for translating
    or use
    FM 'TRANSLATE_TEXT_TEXTLOG'.
    And also 'SKTZ_TRANSLATE_TEXT_TEXTLOG'
    Regards,
    Flavya

Maybe you are looking for