Convert char to ascii code and vice versa

HI
Is there any function module to convert char to ascii code and vice versa.
Thanks in advance

Hi,
be careful if you have unicode running in your system. URL_ASCII_CODE_GET is platform-dependent so it will return the internal HERX representation of the character in your system - which is hopefully and in most cases ASCII.
Under unicode, we use double-byte characters here. I tried this function and the result CHAR_CODE is '00' regardless what character I specify for TRANS_CHAR. But the coding is so simple I corrected resultig in this sample code:
[P]
convert p_form to ASCII (internal) representation
  DATA:
    l_ofs TYPE syfdpos,
    l_len TYPE sy-linsz,
    l_ascii TYPE i.
  FIELD-SYMBOLS:
    <x> TYPE x.
  l_len = STRLEN( p_ascii ).
  DO l_len TIMES.
    l_ofs = sy-index - 1.
    ASSIGN p_ascii+l_ofs(1) TO <x> CASTING.
    l_ascii = <x>.
    WRITE: l_ascii.
  ENDDO.
[/P]
Here, for each character of string p_ascii, the internal (ASCII) representation is determined and written to the output list.
Regards,
Clemens

Similar Messages

  • Strange problem in converting between XML to string and vice versa

    i have an application that needs to send an XML document
    over the wire. For this reason, I need to convert the
    doc into a String at the sending side and back to Doc
    at the receiving side. This document is stored in a "CLOB"
    column in a table in the database. I use XDK to retrieve
    this entire row (including the CLOB - hence this is an XML
    document which has a column that itself is an xml document in
    string format - this is just the clob read in by XDK).
    Thus the row looks like
    <ROWSET>
    <ROW>
    <col1> A <col1>
    <CLOB_COL> ..clob value of an xml doc..</CLOB_COL>
    </ROW>
    </ROWSET>
    When I convert this document into String and back, one of the "<"
    tags in the clob column document gets changed to "&lt;" and hence
    the parsing fails! I have used the latest label of the XDK build
    to get the latest parser jar but still i have the same problem.
    I am using the following routines for the conversion.
    /* for converting document to string */
    public static String convertToString(XMLDocument xml) throws
    IOException
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    xml.print(pw);
    String result = sw.toString();
    return result;
    /* for converting string to document */
    public static XMLDocument convertToXml(String xmlStr)
    throws
    IOException,SAXException
    ByteArrayInputStream inStream = new
    ByteArrayInputStream(xmlStr.getBytes());
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    parser.parse(inStream);
    return parser.getDocument();

    How do you get the XML document? Do you use XSU? You can use:
    String str = qry.getXMLString();
    to get the result XML document in String.
    XSU will escape all of the < and >. Or the the XML document in
    one of the column will make the result XML doc not well-formed.
    Not quite understand your problem. You can send me your test
    case.
    i have an application that needs to send an XML document
    over the wire. For this reason, I need to convert the
    doc into a String at the sending side and back to Doc
    at the receiving side. This document is stored in a "CLOB"
    column in a table in the database. I use XDK to retrieve
    this entire row (including the CLOB - hence this is an XML
    document which has a column that itself is an xml document in
    string format - this is just the clob read in by XDK).
    Thus the row looks like
    <ROWSET>
    <ROW>
    <col1> A <col1>
    <CLOB_COL> ..clob value of an xml doc..</CLOB_COL>
    </ROW>
    </ROWSET>
    When I convert this document into String and back, one of the "<"
    tags in the clob column document gets changed to "<" and hence
    the parsing fails! I have used the latest label of the XDK build
    to get the latest parser jar but still i have the same problem.
    I am using the following routines for the conversion.
    /* for converting document to string */
    public static String convertToString(XMLDocument xml) throws
    IOException
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    xml.print(pw);
    String result = sw.toString();
    return result;
    /* for converting string to document */
    public static XMLDocument convertToXml(String xmlStr)
    throws
    IOException,SAXException
    ByteArrayInputStream inStream = new
    ByteArrayInputStream(xmlStr.getBytes());
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    parser.parse(inStream);
    return parser.getDocument();

  • I cannot sync because both computers insist I register the other device with their code and vice versa

    I want to sync two computers, but both insist they have the master code and insist that I enter it into the other machine. however the other machine will not accept it.

    From your description, I believe you are not logged in with any of your machines. Do you see something like [https://support.mozilla.com/media/uploads/gallery/images/compcode.jpg this image on the left]? If that appears in both of your computers, you need to log in first. Once you do that in one computer, you would see [https://support.mozilla.com/media/uploads/gallery/images/2011-01-27-15-46-25-9c0352.png this menu].
    This way you could proceed as explained from the Step 2 in this article: [[How to sync Firefox settings between computers]].
    In order to log-in with one computer, make sure you follow Cor-el's intructions:
    "Tools > Options > Sync" or "Firefox > Set Up Sync":
    Click "Set Up Firefox Sync" to go to "Firefox Sync Setup"
    Click "I already have a Firefox Sync account" : Connect
    Click "I don't have the device with me" at the bottom
    The "I don't have the device with me" appears at the bottom of the 3 boxes with the code.
    Remember that in order to log-in, you would need to have your sync-key.
    If you don't have it anymore, the only way to proceed is to go to [https://account.services.mozilla.com/ your account] and delete it. That way you can start from scratch and by following the steps in the article I linked you should be fine.

  • How to convert XML doc to string and vice versa?

    Assume I have a XML doc and I want to convert it into a string (and put it into a string variable).
    How can I do this?
    How can I do the opposite: Convert a string content into a XML doc?
    Peter

    Use:
    ParseEscapedXML() and ora:getContentAsString()
    See
    http://www.codeguru.com/cpp/sample_chapter/article.php/c10789__7/
    Marc

  • Converting from String to float and vice versa

    I'm interested in people's thoughts on where common logic to convert between various field types should be stored in an application to minimise code duplication and maintenance.
    I have an application which consists of an object and a jPanel which displays and maintains this object. The object contains a number of private float fields which are accessed by getters and setters. The jPanel contains one jTextField for each of the fields within the object.
    Currently I have numerous lines of code in the jPanel to convert between the values needed by the getters and setters in the object (i.e. float) and the String value used by the jTextFields. This code handles cases where the String value may be blank or null.
    I've thought that one alternative to having all this conversion/validation code in the jPanel is to create a second set of getters and setters for each field which accept and return String values.
    What do people think about this? Is it advisable for only have one getter and setter for a variable? Should I put the conversion/validation logic for each field into a seperate common routine?
    Thanks,
    James.

    Hi James,
    You should go with whatever works best for you. By creating multiple getters and setter you save yourself from repeating the same code throughout your program.

  • Converting PC data to AppleWorks and vice versa

    Background: I am working with a high school reunion class administrator who has emailed me a mailing list file in a PC Excell spreadsheet format. I can read this in AppleWorks (6). He is asking me to put this in a database format where we can use this for mailing labels. He is asking me to send this back to him in MS Works format (He has PC MS Works not Mac MS Works) however he is using an Intel Mac preferring the Windows XP over OSX. I do not have MS Works only AppleWorks. Is all the above possible with AppleWorks? Can I put the data from the spreadsheet into a database format, and does that require I cut and paste everything? Once I get it into an AppleWorks database how do I put it into MS Works database format or something he can read into MS Works database format, and email it to him? First time experimenting with this and hope it will work out. Thanks in advance for any help. CAB
    Mac mini Intel/iBook G3   Mac OS X (10.4.5)   Mac OSX (10.3.5) for iBook

    My open question is how to take Excel data (.xls) and make a Apple Works database file? Must I cut and paste each name, address, phone #, email from Excel to Appleworks DB? Is there any other way?
    You should be able to copy and paste the entire data set in one move, provided you have an AppleWorks DB set up to receive the data.
    Create the AW DB, adding the fields in the same order as the columns of the Excel spreadsheet.
    Open the spreadsheet in Excel or as an AppleWorks spreadsheet.
    Select and copy all of the block of cells containing data.
    Click on the first (empty) record of the database document so the the whole record is highlighted (ie. click on the record, but not in a field, or in List view, click on the small square to the left of the first row), then Paste.
    Your data should be pasted in, creating one record in the DB for each line on the spreadsheet.
    Regards,
    Barry

  • How to convert ascii value into character and vice versa

    Hello the java world people,
    I want to convert each characters from my array into their corespondent ascii value and vice versa, how can I do that ?

    The term "ASCII" is often used very loosely.
    Java char values are UNICODE and the ASCII codes are indentical to UNICODE characters in the range 0 .. 127. UNICODE values 128 and above don't have coresponding ASCII values, though 128-255 corespond to ISO-8859-1 which is one of the encodings often called "extended ASCII".
    As shown above you can covert between chars and coresponding int value simply with a cast, but you should be aware that the more exotic characters will not give you sensible values.

  • How to convert from UNICODE (UTF16) to UTF8 and vice-versa in JAVA.

    Hi
    I want to insert a string in format UTF16 to the database. How do I convert from UTF16 to UTF8 and vice- versa in JAVA?. What type must the database field be? Do I need a special set up for the database (oracle 8.i)?
    thanks
    null

    I'm not sure if this is the correct topic, but we are having problems accessing our Japanese data stored in UTF-8 in our Oracle database using the JDBC thin driver. The data is submitted and extracted correctly using ODBC drivers, but inspection of the same data retrieved from the GetString() call using the JDBC thin driver shows frequent occurrences of bytes like "FF", which are not expected in either UTF8 or UCS2. My understanding is that accessing UTF8 in Java should involve NO NLS translation, since we are simply going from one Unicode encoding to another.
    We are using Oracle version 8.0.4.
    Can you tell me what we are doing wrong?
    null

  • Help needed XML to Internal table and vice versa

    Hello frnds, I need to convert Internal table to XML and Vice versa.
    Now I am able to most of the part except for this...
    the xml which I have to generate looks something like this...
    - <trade_dt>
    - <![CDATA[ 20111108000000:20111108235959
      ]]>
      </trade_dt>
    its a range I think
    And then the reponse which I get back the XML is like
    - <lockinfo>
    - <![CDATA[
    TRD_HEADER     1045     1          2
    ACT_CASHFLOW     1042               1
    TRD_TERM     1045               2
      ]]>
      </lockinfo>
    Is there any provision in class cl_ixml or class if_ixml_element to handle this part.....
    Edited by: Amit Sawant on Dec 28, 2011 3:51 PM

    Hello Amit,
    I would suggest you, to use the XSL-Transformations, which can be inbound used in ABAP.
    For example:
    DATA:
      l_xml       TYPE string,
      lt_flights  TYPE TABLE OF SFLIGHT.
    SELECT * FROM SFLIGHT INTO TABLE LT_FLIGHT.
    CALL TRANSFORMATION id
      SOURCE DATA = lt_flights
      RESULT XML l_xml.
    Now, you have a XML-String which is in the ABAP-XML Notation, which means, that ABAP can move this XML-Data back into an internal table/structure.
    For the backward, you have to use the following statement:
    CALL TRANSFORMATION id
      SOURCE XML l_xml
      RESULT DATA = lt_flights.
    As you will see, it is very easy. The Transformation "id" is just one example and build in. When you have to transform the data, or do not want to have the ASX-Notation in it, you should at least define your own transformations with the transaction XSLT_TOOL and use it similar to the transformation "id".
    Kind Regards,
    Hendrik

  • PDF to Word.doc Converter and vice versa

    Hello!
    I am in need of a program capable to convert PDF files to Word documents and vice versa (eventually, a program for each way). The converter needs GUI and must handle images, tables etc. (not just plain text). Does anyone have any tip concering which
    program I should use? It has to be free as my working place has not budgeted with buying 100 licenses. :-)
    Thanks in advance!

    Free? You'll be lucky. Your best bet to achieve your requirements is a PDF compatible OCR application such as Finereader. Free it ain't!
    <IKT-kr> wrote in message news:[email protected]...
    Hello!
    I am in need of a program capable to convert PDF files to Word documents and vice versa (eventually, a program for each way). The converter needs GUI and must handle images, tables etc. (not just plain text). Does anyone have any tip concering which program
    I should use? It has to be free as my working place has not budgeted with buying 100 licenses. :-)
    Thanks in advance!
    Graham Mayor - Word MVP
    www.gmayor.com
    Posted via the Communities Bridge
    http://communitybridge.codeplex.com/

  • How to convert a data set into a xml data and vice versa

    i am new to oracle with xml..
    my aim is to convert a data set into a xml data and vice versa..
    my work is as follows...
    my query:
    select rggpk,rggcode,rggname from ms_regiongeo
    to convert a data set into a xml*
    select XMLType(trim(replace(dbms_xmlgen.getXML('select rggpk,rggcode, rggname from ms_regiongeo'),'<?xml version="1.0"?>',''))) XML_DATA from dual;
    (this works fine and output of this query is as follows..)
    <ROWSET>
    <ROW>
      <RGGPK>201</RGGPK>
      <RGGCODE>Asia</RGGCODE>
      <RGGNAME>Asia</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>1</RGGPK>
      <RGGCODE>OTH</RGGCODE>
      <RGGNAME>Others</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>21</RGGPK>
      <RGGCODE>COB</RGGCODE>
      <RGGNAME>Africa and Yemen</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>2</RGGPK>
      <RGGCODE>AUS</RGGCODE>
      <RGGNAME>Australia</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>23</RGGPK>
      <RGGCODE>IND</RGGCODE>
      <RGGNAME>Indian Sub Continent</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>24</RGGPK>
      <RGGCODE>TVM</RGGCODE>
      <RGGNAME>North America</RGGNAME>
    </ROW>
    </ROWSET>
    and to reverse this process, I tried a query like this..*
    select EXTRACTVALUE (XML_DATA,'ROWSET/ROW/RGGPK') as EMP_ID
    from(
            select XMLType(trim(replace(dbms_xmlgen.getXML('select rggpk,rggcode, rggname from ms_regiongeo'),'<?xml version="1.0"?>',''))) XML_DATA from dual
    )tab1but failed.. and raised with an eror: ORA-19025
    help me..
    regards,
    john

    Hi-
    my aim is to convert a data set into a xml data  You can refer to the below posts
    Adding namespace to XML output
    Re: how to convert table data in xml format based on the xsd.

  • How to convert SOAPEnvelope or SOAPBody to org.w3c.dom.Node and vice versa?

    How to convert javax.xml.soap.SOAPEnvelope or javax.xml.soapSOAPBody to org.w3c.dom.Node and vice versa?If this convertion is very diffcult , how to convert String to org.w3c.dom.Node?
    Thanks a lot

    vj008 wrote:
    while parsing a DOM i want to convert
    org.w3c.dom.Element to xml string and after certain processing on that xml string i want to convert back it to
    org.w3c.dom.Element.[This might help. xml transformations in java. |http://tejaspurohit.blogspot.com/2009/08/xml-transformations-in-java.html]

  • CONVERTING X,Y TO LATITUDE,LONGITUDE VICE VERSA

    hi,
    i need formula for converting x,y coordinates to latitude ,longitude and vice versa,
    CAN ANYBODY HELP ME IN THIS?

    There is no standard formula for such conversions, as converting from one coordinate system to another is often a complex mathematical formula. What you need to do is track down (via the internet) the mathematical formula you require for your conversion and then apply that formula as SQL or PL/SQL code. You can pretty much do any mathematics in Oracle code, but firstly you need to know the maths required (and so would we if you expect us to help you).

  • Object Creation Of One class into another and vice versa

    Hello Everyone,
    My name is Prashant Sharma from Jaipur [Rajasthan]
    Can u people help me
    How to create of one class into another and vice versa
    Eg,
    I am having class A and class B
    I want to create object of class A into class B and vice versa
    Plz help me out of this problem as soon as possible....

    Read this: [Creating Objects|http://java.sun.com/docs/books/tutorial/java/javaOO/objectcreation.html]
    Then, do one of these three:
    1. Create an instance of the class
    2. Extend the class
    3. Access methods within the class
    Try it out. Post the problem code if you're having trouble.

  • SSRS subscriptions in default zone of sharepoint 2013 are not showing in intranet zone and vice versa.

    one of the Sharepoint 2013 site collection has alternate access mappings created. Default site is .com and intranet is .local.
    So when we add SSRS subscription in .com - they are not showing in .local and vice- versa. How do we fix this so the subscriptions are same in both .com and .local.

    Hi spanda,
    Per my understanding that you have configured the alternate access mappings which Default site is .com and intranet is .local. But the subscription in one of the site will not list in another mapped site, right?
    Actually, if you are on a different Alternate Access Mapping other than the Subscription was created on, we will get no subscriptions, Because we are using the method "Microsoft.ReportServices.SharePoint.UI.ManageSubscriptionPages"
    to deal with the logic by creating the value for "m_reportUrl" using the current context of the URL the user is using and passing that to the "SubscriptionListControl".  You can find the code in this article if you have some
    knowledge of development:
    SQL Server Reporting Services ignores Alternate Access Mappings When Checking for Report Subscriptions
    I recommand you to submit an feedback at
    https://connect.microsoft.com/SQLServer/
    If the suggestion mentioned by customers for many times, the product team may consider to add the feature in the next SQL Server version. Your feedback is valuable for us to improve our products and increase the level of service
    provided.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

Maybe you are looking for