The use of CL_ABAP_CONV_OUT_CE to create an unicode-16 (UTF-16) file

Hello,
I have to create a file iwth normal text in UTF-16 format. In ABAP the creation of an UTF-8 file is very easy (open dataset for output in UTF-8).
However UTF-16 is barely documented. and the normal open dataset does not support utf-16.
The only thing i could find out that you have to use class CL_ABAP_CONV_OUT_CE for it and open it as BINARY.
But i don't know how to do it. Could someone help. an small example would be perfect.
Thanx in advance.
Regards, Frank

Hi,
Please check this piece of code
DATA conv TYPE REF TO cl_abap_conv_in_ce.
DATA buffer(4) TYPE x.
DATA text(100) TYPE c.
buffer = '41424344'.
conv = cl_abap_conv_in_ce=>create(
encoding = 'UTF-8' ).
conv->convert(
EXPORTING input = buffer
IMPORTING data = text ).
write: / text.
Example for class cl_abap_conv_out_ce.
data: text(100) type c value 'ABCD',
conv type ref to cl_abap_conv_out_ce,
buffer type xstring.
conv = cl_abap_conv_out_ce=>create(
encoding = 'UTF-8'
endian = 'L'
call method conv->write( data = text n = 4 ).
buffer = conv->get_buffer( ).
write:/ buffer.
Also
you do not need to replace TRANSLATE ... TO UPPER/LOWER CASE in Unicode systems.
You just need to take care that the arguments fit:
The arguments of these instructions must be single fields of type C, N, D, T or STRING or structures of character-type only.
Regards
Hiren K.Chitalia

Similar Messages

  • I was told of an application that will allow the use of a second screen to view my data and files, but I forgot its name. I'd like to make the connection because my LCD is broken.

    I was told of an application that will allow the use of a second screen to view my data and files, but I forgot its name. I'd like to make the connection because my LCD is broken.

    You don't need an application, just plug a compaitble monitor into the display port of your MacBook Pro, set the screen up in System Preferences>Displays

  • What happened to the feature enabling me to create a signature from my own files?

    I have been able to sign my PDF forms from my own files now I cannot do this where or when did this feature disappear ??

    Some menu entries in the main menu bar are hidden if you use the mouse and only appear if you use the keyboard to open the menu (Bug 626825).
    You can see the difference if you use Alt+F to open the File menu or other menus like the Edit menu (Alt+E) and Bookmarks menu (Alt+B) and compare that to what you see if you use the mouse to open the menu after you have made the menu bar visible by tapping Alt or by pressing F10.
    * "Bookmark All Tabs" (Shift+Ctrl+D) no longer shows in the Bookmarks menu unless you open the Bookmarks menu via the keyboard (Alt + B).
    * "Bookmark All Tabs" can be accessed via the right-click context menu of a tab on the tab bar.
    See also:
    * https://support.mozilla.com/kb/how-do-i-use-bookmarks
    * Bookmark All: https://addons.mozilla.org/firefox/addon/bookmark-all/

  • What is the use of joiner that is only for combining tow flat file or other

    hi all
    joiner is use full for only combining tow or more flat files
    that purpose only or any other scenario is the for joiner transformation
    Thanks
    Sreedhar

    http://www.scribd.com/doc/24360471/Joiner-Transformation-Overview
    Please refer this.

  • Is it possible to create a uncode compliant (UTF-8)  XML in 4.6C ?

    Hello,
    Is is possible to create a unicode compliant (UTF-8) XML document in SAP 4.6c ?.
    Regards,
    Jay

    Yes - quite possible.  Use the iXML libraries just like normal.
    However before you render the XML into the output stream (IF_IXML_OSTREAM), tell the OSTREAM that you want to use UTF-8 encoding.
    *  Encoding is type ref to IF_IXML_ENCODING.
    *  ENCODING_TYPE is a constant set to value 'UTF-8'.
      data: s_encoding_type type string.
      clear streamfactory.
      streamfactory = ixml->create_stream_factory( ).
      s_encoding_type = encoding_type.
      encoding = ixml->create_encoding( character_set = s_encoding_type
                                        byte_order = 0 ).
    * b_xml is type XSTRING
      ostream =
        streamfactory->create_ostream_xstring( b_xml ).
      call method ostream->set_encoding
              exporting  encoding = encoding.
      call method document->render
           exporting ostream = ostream
                     recursive = 'X'.

  • Perform unicode to UTF-8 conversion on F110 bacs payment file in ABAP

    Hi,
    I am facing a conversion issue for the UK BACS payment files.
    The payment run tcode F110 creates a payment file but the file when created on the application server has soem sort of code conversion. If I removed the # value, i can read most of the data.
    The data example is as below-
    #V#O#L#1#0#0#1#5#8#8# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #2#4#3#3#0#9#
    #H#D#R#1#A#2#4#3#3#0#9#S# # #1#2#4#3#3#0#9#0#0#0#0#0#2#0#0#0#1#0#0#0#1# # # # # # # #1#0#1#1#2#
    #H#D#R#2#F#0#2#0#0#0#0#0#1#0#0# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    #U#H#L#1# #1#0#1#1#3#9#9#9#9#9#9# # # # #0#0#0#0#0#0#0#0#1# #D#A#I#L#Y# # #0#0#0# # # # # # # #
    This is then transferred to the bank via the FTP UNIX Script but after the conversion which is happening as-
    #Perform unicode to UTF-8 conversion on bacs file
    $a = "iconv -f UNICODE -t UTF-8 $tmpUNI > $tmpASC";
    The need going forward is to bring the details via the interface and then make an uplaod.
    The ABAP code should be able to make the conversion, remove the additional chracters and then send the file across.
    I have searched everywhere but I am not able to find out how to make the same conversion in ABAP.
    We are on ECC6.
    Can someone please help me?
    Regards,
    Archana

    Hi Archana,
    can  you please check SAP notes 1064779 and 1365764 (including the attachment) and see if this helps you ?
    Best regards,
    Nils Buerckel
    SAP AG

  • Sql Plus and Unicode (or utf-8) characters.

    Hello,
    i have problem with Sql Plus and unicode files. I want to execute Start {filename}, where {filename} is file in unicode format (this file have to contains german and polish characters). But i receive error message. It is possible to read from unicode (or utf-8) file and execute commands from this file)?
    Thanks in advance.
    Pawel Przybyla

    What is your client operating system characterset?

  • Creating XML-files in ABAP with format ISO-8859-1 after the use of unicode

    Hello,
    We have a problem with XML-files created in z_abap-programma.
    Before the use of unicode the XML-file was of the format: ISO-8859-1.
    After the introducting of unicode the format is UTF-16.
    In the abap-program we are using:
            CALL TRANSFORMATION xls-program
             SOURCE t_vbak = it_vbak
             RESULT XML xmlstring.
            CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
              EXPORTING
                text     = xmlstring
              IMPORTING
                buffer   = lx_xml_as_string.
            CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
              EXPORTING
                buffer        = lx_xml_as_string
              IMPORTING
                output_length = li_xml_size
              TABLES
                binary_tab    = ltb_xml_table.
            CALL METHOD cl_gui_frontend_services=>gui_download
              EXPORTING
                bin_filesize = li_xml_size
                filename     = lc_filename
                filetype     = 'BIN'
              CHANGING
                data_tab     = ltb_xml_table
              EXCEPTIONS
                OTHERS       = 24.
    Is it prossible to create the XML-file with the format ISO-8859-1 after the unicode, please can you explane how to solve this problem.
    Regards,
    Theo Pijlman

    hi theo,
    did you read my thread i wrote some days before ? have a look in my sample coding find   " if_ixml_encoding ..... " there you can set the encoding of character .
    greetz
    tony
    thread:
    Re: abap to xml
    SAP Explanation for Interface if_ixml_encoding :
    http://help.sap.com/saphelp_nw04/helpdata/de/bb/5766a6dca511d4990b00508b6b8b11/content.htm

  • How can I Publish to a Folder just one of the several websites I have created using iWeb?

    How can I Publish to a Folder just one of the several websites I have created using iWeb?
    it drives me nuts having to emove all the other websites when I want to upload one. 
    Sparrow

    For iWeb, I like to do only one site per domain file.  I move domain files out of the Application Support folder and place them inside project or client folders, or in DropBox. Once you duplicate a domain file and begin customizing it, it will load and behave as a separate project/site.
    I publish each iWeb domain/project direct to a server via FTP. Sometime I publish to a folder, then upload via FTP manually.
    iWeb is a remarkable tool, especially when you work from scratch with blank tamplates
    Here are a few of my iWeb sites:
    http://www.newcovenant.org
    http://www.visionmultimedia.org
    http://www.visioncomsolutions.com

  • I need your help with a decision to use iPhoto.  I have been a PC user since the mid 1980's and more recently have used ACDSee to manage my photo images and Photoshop to edit them.  I have used ProShow Gold to create slideshows.  I am comfortable with my

    I need your help with a decision to use iPhoto.  I have been a PC user since the mid 1980’s and more recently have used ACDSee to manage my photo images and Photoshop to edit them.  I have used ProShow Gold to create slideshows.  I am comfortable with my own folder and file naming conventions. I currently have over 23,000 images of which around 60% are scans going back 75 years.  Since I keep a copy of the originals, the storage requirements for over 46,000 images is huge.  180GB plus.
    I now have a Macbook Pro and will add an iMac when the new models arrive.  For my photos, I want to stay with Photoshop which also gives me the Bridge.  The only obvious reason to use iPhoto is to take advantage of Faces and the link to iMovie to make slideshows.  What am I missing and is using iPhoto worth the effort?
    If I choose to use iPhoto, I am not certain whether I need to load the originals and the edited versions. I suspect that just the latter is sufficient.  If I set PhotoShop as my external editor, I presume that iPhoto will keep track of all changes moving forward.  However, over 23,000 images in iPhoto makes me twitchy and they are appear hidden within iPhoto.  In the past, I have experienced syncing problems with, and database errors in, large databases.  If I break up the images into a number of projects, I loose the value of Faces reaching back over time.
    Some guidance and insight would be appreciated.  I have a number of Faces questions which I will save for later. 

    Bridge and Photoshop is a common file-based management system. (Not sure why you'd have used ACDSEE as well as Bridge.) In any event, it's on the way out. You won't be using it in 5 years time.
    Up to this the lack of processing power on your computer left no choice but to organise this way. But file based organisation is as sensible as organising a Shoe Warehouse based on the colour of the boxes. It's also ultimately data-destructive.
    Modern systems are Database driven. Files are managed, Images imported, virtual versions, lossless processing and unlimited editing are the way forward.
    For a Photographer Photoshop is overkill. It's an enormously powerful app, a staple of the Graphic Designers' trade. A Photographer uses maybe 15% to 20% of its capability.
    Apps like iPhoto, Lightroom, Aperture are the way forward - for photographers. There's the 20% of Photoshop that shooters actually use, coupled with management and lossless processing. Pop over to the Aperture or Lightroom forums (on the Adobe site) and one comment shows up over and over again... "Since I started using Aperture/ Lightroom I hardly ever use Photoshop any more..." and if there is a job that these apps can do, then the (much) cheaper Elements will do it.
    The change is not easy though, especially if you have a long-standing and well thought out filing system of your own. The first thing I would strongly advise is that you experiment before making any decisions. So I would create a Library, import 300 or 400 shots and play. You might as well do this in iPhoto to begin with - though if you’re a serious hobbyist or a Pro then you'll find yourself looking further afield pretty soon. iPhoto is good for the family snapper, taking shots at birthdays and sharing them with friends and family.
    Next: If you're going to successfully use these apps you need to make a leap: Your files are not your Photos.
    The illustration I use is as follows: In my iTunes Library I have a file called 'Let_it_Be_The_Beatles.mp3'. So what is that, exactly? It's not the song. The Beatles never wrote an mp3. They wrote a tune and lyrics. They recorded it and a copy of that recording is stored in the mp3 file. So the file is just a container for the recording. That container is designed in a specific way attuned to the characteristics and requirements of the data. Hence, mp3.
    Similarly, that Jpeg is not your photo, it's a container designed to hold that kind of data. iPhoto is all about the data and not about the container. So, regardless of where you choose to store the file, iPhoto will manage the photo, edit the photo, add metadata to the Photo but never touch the file. If you choose to export - unless you specifically choose to export the original - iPhoto will export the Photo into a new container - a new file containing the photo.
    When you process an image in iPhoto the file is never touched, instead your decisions are recorded in the database. When you view the image then the Master is presented with these decisions applied to it. That's why it's lossless. You can also have multiple versions and waste no disk space because they are all just listings in the database.
    These apps replace the Finder (File Browser) for managing your Photos. They become the Go-To app for anything to do with your photos. They replace Bridge too as they become a front-end for Photoshop.
    So, want to use a photo for something - Export it. Choose the format, size and quality you want and there it is. If you're emailing, uploading to websites then these apps have a "good enough for most things" version called the Preview - this will be missing some metadata.
    So it's a big change from a file-based to Photo-based management, from editing files to processing Photos and it's worth thinking it through before you decide.

  • What is the use of creating a detail object on a measure.

    Hi Experts,
    In BI 4.X business layer, we can create a detail object of a dimension and as well as measure.
    Can you please let me know what could be the use of the detail object of a measure object?
    In the business layer, it is showing like this...
    <Measure object>
    -><Detail Object>
    Dimensions have attributes, we create those attributes as details objects.
    when we want to see the different grains of the measure in one report. we will use these details objects.
    Example:
    1. Query 1 returns country, sales revenue
    2. Query 2 Returns Country,State,Sales revenue.
    But in the report if we want to show the State wise Revenue. It is not possible bcz both the quires are returning different grain.
    state object is incompatible object, so you can't drag the object into report.
    in this scenario we will merge the Country dimension , create the state object as details with merged dimension, then you can drag the state details detail object.
    this will give expected results Country and State wise revenue.
    Normally Dimensions and details objects will drives the measures values in report.
    So, Detail object on measure not helpful in case of relational database(Please correct me if i am wrong). It is useful only for OLAP database because when I have created a webi report on top of BEx query then it is automatically created a detail object on measure object.
    As far I know, 'Measure attribute' introduced for OLAP based business layer. which can provides information for the formatted value like unit, currency or value.
    For example:-
    Amount is key figure in BEx query and when I have created Webi report on top of that then it will create three object.
    1. Amount as meausre.
    ->2. Amount currency(detail).
    ->3. Amount formatted value(detail).
    Below is the output after running the report.
    Amount || Amount currency || Amount formatted value
    30 || $ || 30.00
    8 || $ || 8.00
    I have found one difference, We can't implement the index awareness on detail object which we have created on measure object although we can implement the index awareness on detail object which we have created on top dimension object.
    But Still I am looking for good example of Detail object on measure object..
    Any thought would be welcome...
    Thanks,
    Sachin

    I moved this to the Semantic Layer space for faster response.

  • HOw to create a text file in the given path and delete it after the use?

    Hi all,
    I am trying to create a text file at the given path and delete the created file after the use.
    I am using following code.:
    import java.io.*;
    // write binary data as characters
    public class RanIO {
                                            public static void main(String f[])
                                                      // First illustrate append
                                                      String lineSep = "\n";
                                                      try {
                                                                     File temp= new File("C:/Ash","cute.txt");
                                                      boolean ch=temp.createNewFile();
                                                      if(ch)
                                                           System.out.println("file created");
                                                      else
                                                      System.out.println("file Not created");
                                                      //writing to file
                                                 /*     PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter("cute.txt",true)));
                                                      p.print("Emp NO");
                                                      p.close();*/
                                                                // Open fileWriter in append mode
                                                                               FileWriter fos = new FileWriter(temp, true);
                                                                               BufferedWriter bw = new BufferedWriter(fos);
                                                                               PrintWriter pw = new PrintWriter(fos);
                                                                               double d=550;
                                                                          // lineSep = System.getProperty("line.separator");
                                                                          pw.print("Hello");
                                                                          //pw.print( lineSep );
                                                                          pw.print( d );
                                                                          pw.close();
                                  boolean det=temp.delete();
                                                 if(det)
                                                      System.out.println("File deleted");
                                                 else
                                                      System.out.println("File not deleted");
                                                 } catch (IOException ioe)
                                                                System.out.println( "Append IO error:" + ioe );
    My problem:
    1)
    I am not able to write to the file. I want to know, where i am going wrong.
    It is giving error message like
    "Canot resolve Symbol: temp,"
    But, FileWriter Constructor should accept a File type parameter.
    here temp is a file parameter.
    If i am not using file=new file();
    i can't delete the file after the use. i.e if i use
    PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter("cute.txt",true)));
    how can i delete cute.txt after the use?
    2)
    I am not able to write to the text file. file is created but, a blank file.
    "Hello" is not written into the text file.
    can anyone help me in this regard
    Thanks in advance
    Ashvini

    Thank you Ram,
    But, i want to create a text file in Append mode.
    for that i used
    FileWriter fos = new FileWriter(temp,true); But, it is not accepting FileWriter constructor in
    this format. if i use
    FileWriter fos = new
    FileWriter("c:/ash/cute.txt",true); it works fine. !!!!!Here's the javadoc
    public FileWriter(File file,
    boolean append)
    throws IOExceptionConstructs a FileWriter object given a File object. If the second argument is true, then bytes will be written to the end of the file rather than the beginning.
    Parameters:
    file - a File object to write to
    append - if true, then bytes will be written to the end of the file rather than the beginning
    Throws:
    IOException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
    Since:
    1.4
    Are you using jdk.13 or lower ?
    >
    ONe more doubt, Does flush method deletes a file?
    if not, then i need to use
    File temp=new File("c:/ash/cute.txt");
    FileWriter fos = new FileWriter(temp,true); //which
    is again a problem
    if(temp.delete())
    out.println("File is deleted");
    }I don't know whether i am taking it wrong ! or
    anything wrong with my coding ! but, after creating
    and writing data into a text file. I must delete it
    as it contains confidential informations.
    Regards,
    Thanks.'flush' writes to a file immediately. Else you should explicitly call 'flush' to write contents from buffer to underlying source.
    javadoc again
    PrintWriter
    public PrintWriter(Writer out,
    boolean autoFlush)Create a new PrintWriter.
    Parameters:
    out - A character-output stream
    autoFlush - A boolean; if true, the println, printf, or format methods will flush the output buffer
    cheers,
    ram.
    Question; What do you gain by opening a file, writing to it and deleting it in the same program ?

  • I recieved an Adobe Master Collection License number from my school (Stevens Institute of Technology) and I can't figure out how to use it in order to get the product. I've created a username and that's as far as I've gotten.

    I recieved an Adobe Master Collection License number from my school (Stevens Institute of Technology) and I can't figure out how to use it in order to get the product. I've created a username and that's as far as I've gotten. I need to download the product and I can't figure out where to begin.

    Ask someone at your school... Do you have a Cloud redemption code, or a CS6 serial number?
    If Cloud, Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html and
    http://www.adobe.com/products/creativecloud/faq.html
    http://helpx.adobe.com/creative-cloud/help/install-apps.html to install or uninstall
    http://forums.adobe.com/community/download_install_setup/creative_cloud_faq
    What it is http://helpx.adobe.com/creative-cloud/help/creative-cloud-desktop.html
    Cloud Getting Started https://helpx.adobe.com/creative-cloud.html
    If CS6, download at Other downloads and enter your serial number when prompted
    Again... your 1st resource is your school

  • I got this iphone from a guy and everytime i tried to update the applications stored in this phone it keeps asking me the password that the guy used to use, even thou i created a new apple ID of my own and updated the account of icloud and everything in t

    I got this iphone from a guy and everytime i tried to update the applications stored in this phone it keeps asking me the password that the guy used to use, even thou i created a new apple ID of my own and updated the account of icloud and everything in this iphone with the new apple ID, it still asks me the password of the account that the guy used to use whenever i tried to update the applications, and i cant find the guy who gave me this iphone...wt should i do???

    Apps are permanently tied to the AppleID that downloaded them and cannot be transferred to another.  Best thing to do is delete the apps and download those you want or need under your AppleID.

  • I use migrate assistant to move files from my old pc to the new Mac , but it creates the user account. How can i delete the unwanted user account.

    i use migrate assistant to move files from my old pc to the new Mac , but it creates the user account. How can i delete the unwanted user account.

    Welcome to Apple Support Communities
    That's the classic behaviour after using Migration Assistant and that's normal.
    To transfer the data from the new user account to your old user account, you can follow some steps. Here is all the information you need to do this > https://discussions.apple.com/docs/DOC-5472

Maybe you are looking for

  • ITunes Can't "Locate"

    iTunes cannot "find" files that are still right where they always were. This is reported by iTunes when I try to "sync" my iPod, and requires me to "locate" hundreds of files for iTunes using the clumsy system of clicking on each lost file and going

  • How to view files shared from Airdrop?

    Hi, I just shared a video i recorded from my mac to my iPhone, the transfer was successful, but i tried going to photos to view it and it's not there. Does anyone know where in the iPhone i can view airdrop files? Thanks.

  • Re-installed CS3 and Bridge does not appear...?

    I was having major issues with Bridge (slow-moving, then crashing and finally an inability to open altogether).  I tried a c number of things like clearing caches, repairing permissions etc.  In the end, I uninstalled Photoshop CS3 and deleted all Br

  • How to  � applet URLConnection � to the same HttpServlet session.

    Hi my applet needs to upload some data to be appended to previous uploads every few minutes. I tried with session = request.getSession (true); sessionId = session.getId () pass sessionId to applet and On the applet side URL url = new URL (serverURL +

  • Issues to be aware of when upgrading from SP1 to SP7

    Dear All, We are planning to upgrade from SP1 to SP7 of Microsoft version of SAP BPC. Are there any major pitfalls that we should be aware of with this upgrade? Is SP7 a stable release? Thanks in advance, Mark