Unicode Open Dataset Question

We are beginning to prepare for the Unicode enabling of our custom ABAP programs and I have a question about the new OPEN DATASET statement.  We have programs that write sequential files for use by the following:
1) ABAP programs that execute on our own SAP system
2) Non-SAP programs that execute in our data center
3) Programs (which may or may not be SAP) that execute in the data centers of other completely independent companies.
Conversely, we have programs that read files supplied by those systems. 
After reading through a lot of information, I am reaching the conclusion that for our files that contain only character data, it would be safe for us to modify our OPEN DATASET statements simply to use u201COPEN DATASET IN TEXT MODE ENCODING DEFAULT IGNORING CONVERSION ERRORSu201D without attempting to be more explicit with some of the other options that are available. 
Can any of you confirm that this is (or is not) a valid assumption?

yes you can go ahead with that..for the text files and chardata files
OPEN DATASET IN TEXT MODE ENCODING DEFAULT IGNORING CONVERSION ERRORSu201D

Similar Messages

  • Open Dataset non-unicode & default

    Currently im using the open dataset with default then it hit a codepage error. I found out that the file contained characters that is not UTF-8 so when i changed the open dataset to non-unicode the codepage error goes away. Im wondering if there is any effect of changing from default to non-unicode.

    OPEN DATASET P_AFILE FOR INPUT IN TEXT MODE ENCODING DEFAULT ignoring conversion errors.
    ADD ignoring conversion errors to ur prg
    and should be unicode.
    hope it will help you.
    Regards,
    sinagam.
    Edited by: Venkata Pavan Sinagam on Sep 23, 2011 5:50 PM

  • File transfer Open dataset CSV file Problem

    Hi Experts,
    I have an issue in transferring Korean characters to a .CSV file using open dataset.
    data : c_file(200) TYPE c value '
    INTERFACES\In\test8.CSV'.
    I have tried
    open dataset  c_file for output LEGACY TEXT MODE CODE PAGE '4103'.
    open dataset  c_file for output    in TEXT MODE ENCODING NON-UNICODE.
    open dataset  c_file for output    in TEXT MODE ENCODING Default.
    Nothing is working.
    But to download to the presentation server the below code is working. How can the same be achieved for uploading the file to application server.
    CALL METHOD cl_gui_frontend_services=>gui_download
          EXPORTING
            filename                = 'D:/test123.xls'
            filetype                = 'ASC'
            write_field_separator   = 'X'
            dat_mode                = 'X'
            codepage                = '4103'
            write_bom               = 'X'
          CHANGING
            data_tab                = t_tab
          EXCEPTIONS
            file_write_error        = 1
            no_batch                = 2
            gui_refuse_filetransfer = 3
            invalid_type            = 4
            no_authority            = 5
            unknown_error           = 6
            header_not_allowed      = 7
            separator_not_allowed   = 8
            filesize_not_allowed    = 9
            header_too_long         = 10
            dp_error_create         = 11
            dp_error_send           = 12
            dp_error_write          = 13
            unknown_dp_error        = 14
            access_denied           = 15
            dp_out_of_memory        = 16
            disk_full               = 17
            dp_timeout              = 18
            file_not_found          = 19
            dataprovider_exception  = 20
            control_flush_error     = 21
            not_supported_by_gui    = 22
            error_no_gui            = 23
            OTHERS                  = 24.

    Hi,
    I would recommend to use OPEN DATASET ... ENCODING UTF-8 ...
    If your excel version is unable to open this format, you can convert from 4110 to 4103 with report RSCP_CONVERT_FILE.
    Please also have a look at
    File upload: Special character
    Best regards,
    Nils Buerckel

  • Open dataset in UTF8. Problems between Unicode and non Unicode

    Hello,
    I am currently testing the file transfer between unicode an non unicode systems.
    I transfered some japanese KNA1 data from non unicode system (Mandt,Name1, Name2,City) to a file with this option:
    set local language pi_langu.
      open dataset pe_file in text mode encoding utf-8 for output with byte-order mark.
    Now I want to read the file from a unicode system. The code looks like this:
    open dataset file in text mode encoding utf-8 for input skipping byte-order mark.
    The characters look fine but they are shifted. name1 is correct but now parts of the city characters are in name2....
    If I open the file in a non unicode system with the same coding the data is ok again!
    Is there a problem with spaces between unicode an non-unicode?!

    Hello again,
    after implementing and testing this method, we saw that the conversion is always taken place in the unicode system.
    For examble: we have a char(35) field in mdmp with several japanese signs..as soon as we transfer the data into the file and have a look at it the binary data the field is only 28 chars long. several spaces are missing...now if we open the file in our unicode system using the mentioned class the size is gaining to 35 characters
    on the other hand if we export data from unicode system using this method the size is shrinking from 35 chars to 28 so the mdmp system can interprete the data.
    as soon as all systems are on unicode this method is obselete/wrong because we don't want to cut off/add the spaces..it's not needed anymore..
    the better way would be to create a "real" UTF-8 file in our MDMP system. The question is, is there a method to add somehow the missing spaces in the mdmp system?
    so it works something like thtat:
          OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING UTF-8 WITH BYTE-ORDER MARK.
    "MDMP (with ECC 6.0 by the way)
    if charsize = 1.
    *add missing spaces to the structure
    *transfer strucutre to file
    *UNICODE
    else.
    *just transfer struc to file -> no conversion needed anymore
    endif.
    I thought mybe somehow this could work with the class CL_ABAP_CONV_OUT_CE. But until now I had no luck...
    Normally I would think that if I'am creating a UTF-8 file this work is done automatically on the transfer command

  • OPEN DATASET...  in a Unicode system

    I'm discussing with a developer @ SAP about the correct use of OPEN DATASET in a Unicode system. I'm not sure I'm correct with my opinion so maybe someone could shed a light on it.
    The source of discussion is the (SAP standard) program RSQUEU01. This program is used to download data from the TemSE; in our case we use it to produce a file that is to be sent to auditors (component FI-AIS).
    Our system is a little endian Unicode system (codpage 4103). If we download the created data using that program we get a dump with "CONVT_CODEPAGE" because a character could not be converted from 4103 to 1100.
    The proposed correction by the developer is changing
    OPEN DATASET EXP_FILENAME FOR OUTPUT IN legacy BINARY MODE.
    to
    OPEN DATASET exp_filename                              
    FOR OUTPUT IN LEGACY BINARY MODE                     
    IGNORING CONVERSION ERRORS.
    I think, that correction is wrong. Since we have 12 languages in the system including some Asian the output might get corrupted.
    When I asked him about that I was told use an application server with a "correct codepage" then - I'm not sure what that means since I can't connect an ASCII application server to a Unicode system.
    I guess the statement should be
    OPEN DATASET EXP_FILENAME FOR OUTPUT IN BINARY MODE ENCODING DEFAULT.
    This makes sure that no data is cut (like doublebyte) and makes sure, the appropriate codepage (LE/BE) is used.
    Are my assumptions right?
    Markus
    (OSS 323320/2010)

    Hi Markus,
    Let's first clarify the difference ways for writing files:
    <ul style="list-style:circle!important;">
    <li>BINARY MODE: Means that we essentially dump a sequence of bytes, which isn't necessarily related to any code page (and characters). I.e. if I'd want to save for example an executable program, the individual bytes have no meaning when interpreted as characters (unless we look at strings stored in the program). Note that legacy binary mode actually allows you to specify a code page though, but in general the recommendation is not to use the legacy option.</li>
    <li>TEXT MODE: Here we have text information that has to be interpreted using a specific code page; thus usually the additional parameter ENCODING should be given, which specifies which code page is used.</li>
    </ul>
    Now, let's clear up a small typo in Ajay's response:
    Yes you are right if you want to have all double byte characters too then you need to use ENCODING DEFAULT which would use 4103 in Unicode system.
    That is incorrect. In a Unicode system [encoding default|http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_ENCODING.htm] corresponds to UTF-8, not UTF-16.
    Back to your problem. Your suggestion doesn't work, because you cannot specify encoding default for a binary output (the legacy binary mode allows you to specify a code page, but that's misleading and I wouldn't use any legacy mode). So when you try to use the syntax you proposed, you'd get a syntax error.
    Generally the recommendation is for Unicode enabled applications to use UTF-8 files with byte order mark, i.e. something like
    open dataset EXP_FILE in text mode encoding utf-8 with byte-order mark.
    However, the real question is what your external audit application expects and it sounds as if it's not Unicode enabled...
    Enough blabber, here's what I'd do: Since you're having issues with a audit-related standard SAP program I'd post the question in forum - other people must have run into that problem. Also, I checked OSS, but couldn't make much sense out of the few notes I've found (and nothing seemed relevant). Check what the expected input format is in the external audit system; possibly post a message to OSS.
    Cheers, harald

  • Open dataset twice once for input and once for output in unicode system

    Hi All,
    In a program
    I used a open dataset to read the data from the file.
    OPEN DATASET cmp_file FOR INPUT IN TEXT MODE
          ENCODING NON-UNICODE.
    Then i closed the file.
    Again later in the program,
    I used a open dataset to transfer the data.
    OPEN DATASET cmp_file FOR OUTPUT IN TEXT MODE
          ENCODING NON-UNICODE.
    But this time I get sy-subrc = 8.
    Unable to open the file and subsequent TRANSFER is leading to the runtime error.
    Note : I am using a unicode system
    I could run the same program well in non-unicode system..
    ->
    Is it that if a file contains data already
    1.I need to delete the data and open it
    or
    2.I need to open in APPENDING mode manadatorily...
    in case of UNICODE system..
    Kindly suggest..

    Hi,
    IF you have write permission al S.O. Level you need to check your DATASET rigths using AUTHORITY_CHECK_DATASET, this validate your rigths with S_DATASET object.
    Example
    TYPE-POOLS SABC.
    CALL FUNCTION 'AUTHORITY_CHECK_DATASET'
    EXPORTING PROGRAM = 'ZDATASET'
    ACTIVITY = SABC_ACT_READ
    FILENAME = '/tmp/sapv01'
    EXCEPTIONS NO_AUTHORITY = 1
    ACTIVITY_UNKNOWN = 2.
    See SABC type pool to know wich activities are aviable.
    Hope this help.
    Regards

  • OPEN DATASET file FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE

    Hi There,
    I also have the similar issue. I am able to write the data into appliaction server in Chinese Characters using :OPEN DATASET datei FOR OUTPUT IN TEXT MODE ENCODING DEFAULT or OPEN DATASET datei FOR OUTPUT IN TEXT MODE ENCODING UTF-8. But when i save that file into my presentation server manually, all the chinese characters are showing as Junk.
    When i use OPEN DATASET datei FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE, giving runtime error and when i use OPEN DATASET datei FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE IGNORING CONVERSION ERRORS, No error but application server output itself showing as Junk characters.
    Could you please suggest me what you have done?
    Regards,
    Chaitanya A

    Hi,
       Use this
      OPEN DATASET File_path  FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE
      WITH SMART LINEFEED
    it will definitely work.
    Regards,
    Manesh. R

  • Open Dataset - unicode system ECC 6.0,special characters

    Hi,
    we have upgraded our system from 46b to ecc 6.0 unicode. We face following problem in file download to application server(solaris) using open dataset.
    in output file hyphen(-) character is by special character â.
    eg. if data in table is  'BANGALORE - 560038' is displayed as 'Bangalore â 560034' in application server file. if we download the same file to windows it shows proper data.
    only when we open file in vi editor on application server , system shows this special character.
    Kindly help.
    Regards,
    Sidhesh S

    OPEN DATASET G_APFILE FOR INPUT IN TEXT MODE.in 4.6                                                                                                    
        OPEN DATASET G_APFILE IN LEGACY TEXT MODE FOR INPUT in ECC6.0
    regards
    Giridhar

  • Open dataset (UNICODE) for english en polish characters

    Hi,
    I have a problem on my multi language project on where I need to manage English language and polish language.
    I have a table (that we can call TABLE) I manage the translation on it. When I am connected in English I can see some squares instead some polishes characters. When I am connected in polish, I have the right characters. Any way I don&#8217;t think it&#8217;s a problem, cause if I copy/paste the square on Word, I find back the corrects characters.
    My problem is after.
    I have a structure with the collon name and an internal table with data.
    I use the module function DDIF_TABL_GET on my table TABLE to have the collon name corresponding to the language wanted.
    I am building a string with that and some carry return.
    (Here in English I have again some square, but always the good character if I paste it on Words.)
    Now I would like to put this string in a file using the good encoding.
    I have tried lot of &#8216;opening dataset&#8217; and lot of &#8216;encoding&#8217;.
    I have a file on SAP (transaction FILE)
    (Here in English I have again some square, but always the good character if I paste it on Words.)
    If I download this file on my computer, I have wrong characters.
    Could I have help?
    My wrong code:
      OPEN DATASET lv_filename FOR OUTPUT IN TEXT MODE ENCODING UTF-8.
      TRANSFER u_contenu TO lv_filename.
      CLOSE DATASET lv_filename.

    Hi,
       Use this
      OPEN DATASET File_path  FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE
      WITH SMART LINEFEED
    it will definitely work.
    Regards,
    Manesh. R

  • Truncated record in OPEN DATASET ENCODING NON-UNICODE

    Hi,
    I have to read a Unicode created file into a non-unicode SAP System, version 4.7.
    When I make the OPEN DATASET using ENCODING UTF-8 y get a CONVT_CODEPAGE dump. That´s odd cause my system is non-unicode. I don´t wanna use IGNORING CONVERSION ERRORS attribute, the output will be corrupt.
    But when I use ENCODING NON-UNICODE or ENCODING DEFAULT the READ DATASET mysteriously truncate the record which try to read from real 401 characters to 361 characters. Variable is string.
    I can see full records through AL11.
    Any ideas?
    Thanks,
    Pablo.

    Hi,
    Try using:
      open dataset filename in text mode encoding default for input
                                  ignoring conversion errors.
    As said in AL11 its coming so the above code is used for that.
    Hope this will surely help you !!!
    Regards,
    Punit

  • Unicode file formats ( open dataset)

    Hi,
    We are sending Unicode file with encoding as UTF-8( open dataset) containing Greek character to Legacy system. Legacy system( Sql server) is not able to understand this file format. As a workaround legacy side team coverts the file to Unicode UCS-2 using notepad ( by selecting encoding option as Unicode) and then uploading it to SQL server..
    Is there anyway to convert the UTF-8 file to other Unicode file format ( say UCS-2 )within SAP or generate the desired file format.

    Hi Martin,
    Thanks for the help!!!
    I tried  to convert the file format from UTF-8 to UCS-2  using the methods of the class mentioned but it didn't fulfill my requirement.  I have Greek character in UTF-8 format and when I convert it to any other other format then Greek character are displayed as #.
    Problem is legacy SQL server don't support UTF-8 format.  I tried open data set with binary mode & also legacy text mode with all available code pages but result were not fruitful.
    ( Program RSCP_CONVERT_FILE to convert code page - I used target code page as all possible UTF* , UCD* & Greek code page but no luck ).
    I am just wondering whether SAP can convert UTF-8 to UCS-2 or not. Other option I am thinking is to have the file converted by Unix script  that is application server external command which can be executed via FTP.

  • Question re ENCODING cp option of OPEN DATASET statement

    I'm working on a 6.0 system with 4.6 data that I've downloaded from the 4.6 system and uploaded to the 6.0 system.
    The 4.6 data has "umlauts" in it (like when "o's" have two dots above them in Scandinavian names), and  when my READ DATASET executes on the 6.0 server, my try block is catching  a CX_SY_CONVERSION_CODEPAGE error.
    I'm assuming that to solve this, I will need to specify the codepage of the 4.6 server in the ENCODING codepage option of the OPEN DATASET statement that's exceuting on the 6.0 server.
    Will this solve the problem?  If not, what do I try next ?
    Also, how can I determine the system codpage of my current ABAP "text environment"?  I know all the possibilities are in table TCP0P, but how do I know which one is "active" ???
    Thanks guys.

    Hi,
    Refer this OPEN DATASET in ECC6.0 solves your problem and also check the abap documentation for system codepage and text environment.
    For unicode systems,system code page is UTF-16.
    Thanks.
    Ramya.

  • Open dataset - Lines getting truncated-Question cancelled

    Question cancelled
    Message was edited by:
            Arjun Puthuruthy

    Walter -   I ultimately removed the line feed statement Removed the other additions too.
    open dataset dset for output in legacy text mode message msg_tab.
    '#' is gone. Waiting to hear back from the legacy system team.
    Aparna - You are right.. We have been noticing the same issue for other programs as well. But users are used to checking in notepad (very difficult convincing them).. Was there any problem @ the Unix end in your project? I am yet to check with the legacy system team if it's fine at their end..
    Hope all goes well
    Else I will re-visit this thread.
    Thanks to all.
    Regards,
    DS
    Edited by: D S on Jun 12, 2008 4:02 PM

  • 'Open Dataset' command - add ASCII code in a unicode system

    Hi,
    I use following comand in order to save a file on an application server. 
    open dataset <path> for output in text mode encoding default.
    Is it possible to convert file to ASCII code instead of the system setting unicode and to ignore conversion errors? If yes, please tell me how.
    Thanks!

    problem exporting text in hebrew
    Similar kind of problem has been solved here.. check that link first
    Use the class CL_ABAP_CONV_OUT_CE and use it to convert file from unicode to ascii.

  • Open dataset and close dataset

    Hi
    I need to write log file in fileshare.
    I am using the following FM to create the file.
    Z_FILE_OPEN_OUT_UNICODE'
    I have following qns
    1. do i need to use open dataset and close dataset stmts, even I create the files with the FM?

    Hi,
    you can fill in the name of the FM in transaction SE37, then click 'Display' and look at the source code and the 'Tables' tab.
    It's a custom build FM, so you might have to look at the import parameters it needs... ( Tab 'Import' and 'Tables' ).
    To answer your question, as the name of the FM suggests it will write the file for you, so no open/close dataset. Please doublecheck tab 'Source code' and you might find these statements there...
    hope that helps,
    Rolf

Maybe you are looking for