FIle Creation in the Application Server With Unicode-8 and Byte-Order Mark

Hi Guys,
I've requirement of creating a file in the Application server with the Data.
The Data Format Should be in UTF-8 and Byte-Order Mark.
I need to supply this data from SAP to PRMS.
I'm able to create a file with Unicode, but any of the guys have worked on Umicode with Byte-Order Mark, please let me know.
Thanks,
Adi.

Hi Mathieu,
If you haven't found an aswer yet, you can check in transaction SE24 CL_ABAP_FILE_UTILITIES method CREATE_UTF8_FILE_WITH_BOM. You can check the code of the method (it's very short) so you can understand how it works. It's also a static method so you can call it directly in your program.
Ex:
CALL METHOD cl_abap_file_utilities=>create_utf8_file_with_bom(your_file_name).
I hope this helps.
Pax Vobiscum.
~ Eric

Similar Messages

  • Regarding the File Format on the application server

    Hi,
    I would like to know the file format (ANSI, UTF-8, UTF-16, UTF-32) of the file placed on the application server in my program. Can anyone help me with the Function Module or Class or any other way which will retrieve this information.
    Thanks
    Sarves S V K

    Hi
    You can try the standard class CL_ABAP_FILE_UTILITIES and the method
      CALL METHOD cl_abap_file_utilities=>check_utf8 
        EXPORTING 
         file_name = filename 
        IMPORTING 
         bom       = file_bom 
         encoding  = file_encoding. 
    Check the possible values returned by encoding and BOM:
    NO_BOM
    BOM_UTF8
    BOM_UTF16_BE
    BOM_UTF16_LE
    ENCODING_UTF8
    ENCODING_7BIT_ASCII
    ENCODING_OTHER

  • How to send the file contents in the application server to ftp server

    Hi,
    how to send the file contents in the application server to ftp server.
    regards,
    sree

    Test SAP FTP functions
    DATA: BEGIN OF MTAB_DATA OCCURS 0,
    LINE(132) TYPE C,
    END OF MTAB_DATA.
    DATA: MC_PASSWORD(20) TYPE C,
    MI_KEY TYPE I VALUE 26101957,
    MI_PWD_LEN TYPE I,
    MI_HANDLE TYPE I.
    START-OF-SELECTION.
    MC_PASSWORD = 'password'.
    DESCRIBE FIELD MC_PASSWORD LENGTH MI_PWD_LEN.
    *-- FTP_CONNECT requires an encrypted password to work
    CALL 'AB_RFC_X_SCRAMBLE_STRING'
         ID 'SOURCE' FIELD MC_PASSWORD ID 'KEY' FIELD MI_KEY
         ID 'SCR' FIELD 'X' ID 'DESTINATION' FIELD MC_PASSWORD
         ID 'DSTLEN' FIELD MI_PWD_LEN.
    CALL FUNCTION 'FTP_CONNECT'
         EXPORTING
           USER            = 'userid'
           PASSWORD        = MC_PASSWORD
           HOST            = 'servername'
           RFC_DESTINATION = 'SAPFTP'
         IMPORTING
           HANDLE          = MI_HANDLE
         EXCEPTIONS
           NOT_CONNECTED   = 1
           OTHERS          = 2.
    CHECK SY-SUBRC = 0.
    CALL FUNCTION 'FTP_COMMAND'
         EXPORTING
           HANDLE = MI_HANDLE
           COMMAND = 'dir'
         TABLES
           DATA = MTAB_DATA
         EXCEPTIONS
           TCPIP_ERROR = 1
           COMMAND_ERROR = 2
           DATA_ERROR = 3
           OTHERS = 4.
    IF SY-SUBRC = 0.
      LOOP AT MTAB_DATA.
        WRITE: / MTAB_DATA.
      ENDLOOP.
    ELSE.
    do some error checking.
    ENDIF.
    CALL FUNCTION 'FTP_DISCONNECT'
         EXPORTING
           HANDLE = MI_HANDLE
         EXCEPTIONS
           OTHERS = 1.
    Execute external commands (FTP Scripts)
    The following code shows the syntax of the FM 'SXPG_COMMAND_EXECUTE'. You pass it the external command created within transaction SM69 and it will execute it.
    DATA: ld_comline 
    LIKE sxpgcolist-name,
            ld_param    LIKE sxpgcolist-parameters,
            ld_status   LIKE extcmdexex-status,
            ld_output   LIKE btcxpm OCCURS 0 WITH HEADER LINE,
            ld_subrc    LIKE sy-subrc.
      REFRESH ld_output.
      MOVE 'FTP_DATA_IN' to ld_comline.         "Maintained using trans SM69
    Execute external command, contained in 'ld_comline'
      CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
           EXPORTING
                commandname                   = ld_comline
              additional_parameters   = ld_param  "Params passed to script
              operatingsystem              
    = 'UNIX'
           IMPORTING
                status                        = ld_status
           TABLES
                exec_protocol                 = ld_output
           EXCEPTIONS
                no_permission
                     = 1
                command_not_found
                 = 2
                parameters_too_long          
    = 3
                security_risk                
    = 4
                wrong_check_call_interface    = 5
                program_start_error           = 6
                program_termination_error     = 7
                x_error                       = 8
                parameter_expected            = 9
                too_many_parameters           = 10
                illegal_command               = 11
                wrong_asynchronous_parameters = 12
                cant_enq_tbtco_entry
              = 13
                jobcount_generation_error
         = 14
                OTHERS                       
    = 15.
      IF sy-subrc NE 0.
      ENDIF.

  • F4 help for file path in the Application server

    Hi All,
    i want to provide the F4 help so as to enable us to give the file path in the application server (AL11). I'm in version 4.0
    Regards
    Shekhar

    Hi
    Copy paste the following code and see the result
    Here you can see 2 types of open dialogs
    1. Directory View
    2. File View
    Use any one as per your requirement.
    DATA : l_filetable TYPE filetable,
           l_rc TYPE i.
    DATA: l_folder TYPE string,
          l_file TYPE string.
    PARAMETERS: p_folder(100) TYPE c,
                p_file(100) TYPE c.
    *Provide a Dialogue box for getting a folder path
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_folder.
      CALL METHOD cl_gui_frontend_services=>directory_browse
        EXPORTING
          window_title    = 'Select Folder Path'
          initial_folder  = 'D:\'
        CHANGING
          selected_folder = l_folder.
      p_folder = l_folder.
    *Provide a Dialogue box for getting a file path
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title      = 'Select a Text File'
          initial_directory = l_folder
        CHANGING
          file_table        = l_filetable
          rc                = l_rc.
    Reward points generously
    Regards
    Akshay Chonkar
      READ TABLE l_filetable INTO p_file INDEX 1.
      CHECK sy-subrc <> 0.

  • I messed up badly by trying to restore my brand new macbook pro by doing restart then command R and choose disc utility repair now when I start ,all I get is the white screen with a folder and a question mark,What can I do???help please

    I messed up badly by trying to restore my brand new macbook pro by doing restart then command R and choose disc utility repair now when I start ,all I get is the white screen with a folder and a question mark,What can I do???help please

    Can you still boot to the Recovery partition using Command and R whilst booting? Or did you wipe the Recovery partition as well?
    If your Recovery partition is still intact, you can simply boot to it and reinstall the OS via the Internet. If you wiped the Recovery partition, you can hold down Command, option and R keys whilst booting and boot into true Internet Recovery mode. You'll be able to reformat the hard drive, erasing all partitions (format it as "Mac OS Extended (Journaled)" with a dingle GUID partition) and then reinstall the OS that shipped with your machine.
    Note that you should use a physical Ethernet connection when restoring over the Internet - it's three times slower if you use wifi.
    Try your Recovery partition first and if that doesn't work, use Internet Recovery.
    Clinton

  • Working with File Properties on the Application Server

    Hi,
    I am looking for a way to get the size of a file existing in a directory in the application server without reading it.
    Is there a function module or a static method that returns a file properties exists in the application server?
    Thanks,
    Eyal.

    hi Eyal,
    fm <b>EPS_GET_FILE_ATTRIBUTES   </b>
    regards Andreas

  • To upload excel file directly to the application server using OLE concept

    hi experts
    i have done a coding in OLE to download excel with graph to presentation server, is it possible to upload excel with graph directly to the application server  , the excel should have graph while downloading to presentation server fom app server.
    Moderator message - duplicate post locked
    Edited by: Rob Burbank on Jun 25, 2009 9:49 AM

    HI,
    have a look at tcode cg3z and then FM 'C13Z_FILE_UPLOAD_ASCII'.
    What you can do is, first create the file on presentation server using OLE automation, and then using this FM, write the file to Application server

  • How to delete the record in the file present in the application server?

    Hi,
      I have two questions.
      i) How can I delete a record based on some condition in the recordx in the file that is present in the application server?
      ii) How can I lock the users whiel one user is accessing the file on the application server?
    Thanks in advance.
    Suvan

    Hi,
    If u want a frequent deletion this approach to delete a record from a file will havee unnecesary copy of records from one file to another and deletion of one file and renaming activities.
    Instead what u can do is Add and field del_flag to ur record structure.
    If u want to delete the record from a file just mark this del_flag as 'X'.
    While processing u can have a loop like
    loop at it_XXX where del_flag <> 'X'.
    endloop.
    This will logically delete the record.
    When u r to finish the application at that time only perform this copying / deleting / and renaing activity
    Hope this helps.
    Cheers,
    Nitin

  • Copying dependent files, Where is the application server icon?!?

    I have looked at the Dreamweaver help sites and I cannot figure out where the application server icon is! I am currently running CS3 on a mac thats running OSX 10.4, and I'm trying to upload my site from a different computer than I originally had the files. First I expand my files window in the window>files menu. But then I have no idea where the 'application server icon' is which is supposed to re-link all my dependent files I think? Please, anyone can you give me the co-ordinates of this icon?? I will love you forever!
    -Thanks,
    Dylan
    feel free to contact me at [email protected]!

    Sounds to me like they are talking about the Connect to Server Icon,

  • How can I create files in unicode format without "byte order mark"?

    Hello together,
    I have to export files in UTF-8 format and have to send them to another partner system which works with linux as operating system.
    I have tried the different possibities to create files with ABAP. But nothing works 100% how I want.
    Some examples:
    1.)
    OPEN DATASET [filename] FOR OUTPUT IN TEXT MODE ENCODING UTF-8.
    If I create a file in this way and download it from application server to local system the result for file format in a unicode text edior like NotePad is "ANSI AS UTF-8". This means I have no BYTE ORDER MARK inside.
    But it is also possible that the file format is only ANSI if the file contains no "special characters", isn't it?
    In my test cases I create 3 files. 2 of them has format "ANSI AS UTF-8", and one only "ANSII".
    After transfer to Linux I get as result 2 times UTF8 and one time ASCII as file format.
    2.)
    OPEN DATASET [filename] FOR OUTPUT IN TEXT MODE ENCODING UTF-8 WITH BYTE ORDER MARK.
    With this syntax the result in local editor looks like ok. I get as format really "UTF-8".
    But I get problems with the system which receives the files.
    All files has the file format UTF-8 on Linux but the interface / script can not read the file with BYTE ORDER MARK.
    This is a very big problem for me.
    Do anybody of you know if it possible to force creation in UTF-8 without a BYTE ORDER MARK?
    This means more or less the first example but all files should have UTF-8 format!
    Thanks in advance
    Christian

    This means it is not possible to create a pure unicode file without the byte order mark?
    You wouldn't happen to know how a file with byte order mark should read on a Linux system?
    Or if this possible or not?
    Regards
    Christian

  • Weblogic and byte order mark in files

    We have web application with static content - html files, js files, images, etc.
    There are byte order mark at the beginning of all html files.
    These files were genereted by some tool. So I cannot modify them.
    We deploy this application on Weblogic.
    When I try to access this web application via direct link to Weblogic, then I have a lot of javascript errors.
    But in case when I try to access this page via Apache proxy - then all is ok.
    But Apache forwards all request direct to Weblogic.
    And I do not have such errors in case if application was deployed on JBoss.
    In this case I can access application both via direct link to JBoss and via proxy.
    Anybody have some assumptions - why I cannot access application via direct link to Weblogic?

    I have found a solution for this problems.
    I've just added following mime mapping to web.xml:
    <mime-mapping>
    <extension>xml</extension>
    <mime-type>text/xml</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>js</extension>
    <mime-type>text/javascript</mime-type>
    </mime-mapping>

  • Problem with the creation of the date server with the technology Mysql

    Hi,
    I have installed date integrator 11.1.1.5.
    I have installed oracle database 11.2
    I have installed mysql 5.1.41 with xamp
    I have created the repository master and work.
    I have created data server for oracle .
    ok all correct
    I have created the date server for mysql but I cannot insert the data for jdbc (why ? where insert data ?) when except it creates me the date server.
    but when I try to add a physical schema me from this error and I don't see the list of the schema.
    java.lang.NoClassDefFoundError: bsh/EvalError
         at com.sunopsis.jdbc.driver.JavaDriver.connect(JavaDriver.java:80)
         at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:409)
         at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:385)
         at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:352)
         at oracle.odi.jdbc.datasource.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:331)
         at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter$ConnectionProcessor.run(LoginTimeoutDatasourceAdapter.java:217)
         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
         at java.lang.Thread.run(Thread.java:662)
    how can I resolve my problem?
    thank you for help and cooperation.
    gabriele

    Hi,
    A sub asset master can be created with AS11 only.
    You cannot create a asset sub number under a main asset number, in the case, where different set of dep areas needs to be maintained.
    When you create a sub asset, all the dep areas will be copied to sub asset's master from main asset master. Since this set of dep areas cannot be different from main asset to sub asset.
    Hopw you understood this.
    Thanks,
    Srinu.

  • What is the Application Server with less errors in the installation phase?

    Hi all!
    According to your experience, what is the trial version that has less problems to install? Is it for Windows or Linux?
    thanks!

    Hi
    Unfortunately i haven't tried installing any trial version yet and iam not sure about installation errors
    they are not campatible with home PCs
    Yes i would agree to this i have seen lot of post in SDN there is some problem with vista home edition on Trial versions
    I would always recommand to use JDK1.4.2_16 which is more compatable,with 1.4.2_18 and 1.4.2_19 we are currently having massive stack overflow
    http://java.sun.com/j2se/1.4.2/SAPsite/download.html
    Note 716604 - Access to Sun J2SE and recommended J2SE options
    when it get in the Import ABAP phase, it took more than 8 hours waiting for it to be concluded and it didn't! It cannot be normal!
    It again depends upon the RAM and the virtual Memory you have and provided
    Regards
    Uday

  • Function Module to find the Path of the file in the Application Server

    Hi All,
            Any function module available to find the path of the file stored in the application server. Please let me know.
    Thanks.

    Check this code:
      DATA: dl_file TYPE ibipparms-path.    " File name
      CONSTANTS: c_dir       TYPE  rlgrap-filename.
    * F4 filename for Application server
        CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
          EXPORTING
            directory        = c_dir
            filemask         = ' '
          IMPORTING
            serverfile       = dl_file
          EXCEPTIONS
            canceled_by_user = 1
            OTHERS           = 2.
        IF sy-subrc <> 0.
          MESSAGE e000 WITH 'Error while getting the file name'(006).
          EXIT.
        ELSE.
          p_file =  dl_file.
        ENDIF.
    Thanks & Regards,
    Siri.
    Message was edited by:
            Srilatha T

  • Process Chain to do nothing if file does not exist in the application serve

    Hi All,
    We have a process chain that flows to different data targets daily if files delivered in the application server.
    Process chain does works fine.  But my question is do we have anyway to stop the process chain or do not run process chain if it does not find the file available any days during this time range instead of failing.*
    Is there any settings to enable the check if file available then run or else do not run at all.  Please help!!!
    Thanks,

    Follow the function modules listed in :
    http://wiki.sdn.sap.com/wiki/display/ABAP/Workingwithfiles
    with these function modules - you can get a list of files available in the application server directory.
    Pseudo code :
    1. Generate the automated fiel name you want
    2. Get the list of files in the directory
    3. Search the list of files to see if your file exists
    4. If the file exists then load the file , else load an empty file .
    The code is unfortunately in a different BW system that I do not have access to at this moment... but then the procedre is the same as detailed above.

Maybe you are looking for