Processsing non-printing ASCII characters using ABAP

Hi All,
I would like to process a GUI field input that contains a non-printing ASCII character. It is actually from barcode being read into a GUI field that is then picked up by an ABAP program e.g. in readable format looks like this: 123456789 but actually contains a non-printing ASCII character (ASCII char 29) used as a data separator e.g. 1234<sep>567<sep>89.
I would like to parse the input using ABAP at the non-printing ASCII character so that I have 3 variables A=1234 & B=567 & C=89.
How should I best tackle this?
Cheers,
N.

Pls check this...
DATA: hx29 type x value '29'.
data : wa_hx29(1).
data : wa_str(30) type c.
data : wa_str1(10),wa_str2(10),wa_str3(7).
wa_hx29 = hx29.
split wa_str at wa_hx29 into wa_str1 wa_str2 wa_str3.

Similar Messages

  • Caesar Cipher and non printing ascii

    I am writing a program to implements the caesar cipher. For the program I am using ASCII code so my encryption algorithm is:
    c = (p + k) mod 128
    The only problem is, is that depending on the characters being encrypted and depending on the key I use some of the characters are encrypted to non-printing ascii characters such as 'del'.
    So my code reads in the plain text from a file converts each character to ascii, encrypts each character using the key. It then writes the encrypted ascii values to a file as text (i.e. the character equivalent of the ascii).
    If I do then encounter a non-printing ascii value it is written to the file as a square shape. Is there any way I can get around this?
    Thanks for your help on the matter.
    Wallace

    Modify your encryption function so that it only covers those ASCII values that print, i.e. you need to implement the mod and + function yourself so that only good ASCII characters are considered.

  • Non US-ASCII characters in download file names

    I am trying to implement a simple file download in a JSP, and trying to get IE, Firefox and Opera to all display and handle non US-ASCII characters in the suggested download file name. Only concerned with Windows platform for now. Here's the code I am currently using:
    String agent = request.getHeader("USER-AGENT");
    if (null != agent && -1 != agent.indexOf("MSIE"))
    String codedfilename = URLEncoder.encode(cfrfilename, "UTF8");
    response.setContentType("application/x-download");
    response.setHeader("Content-Disposition","attachment;filename=" + codedfilename);
    else if (null != agent && -1 != agent.indexOf("Mozilla"))
    String codedfilename = MimeUtility.encodeText(cfrfilename, "UTF8", "B");
    response.setContentType("application/x-download");
    response.setHeader("Content-Disposition","attachment;filename=" + codedfilename);
    else
    response.setContentType("application/x-download");
    response.setHeader("Content-Disposition","attachment;filename=" + cfrfilename);
    }This URL encodes the file name if the browser is IE, MIME encodes it if the browser is Mozilla, and sends plain UTF-8 (the encoding of the JSP) for all other browsers. I get "cfrfilename" from translated properties files, and the string can contain characters from any character set - Chinese, Thai, Korean, etc.
    This code works correctly for IE - the file name is displayed correctly in the file Save as dialog, and it is saved correctly on disk, no matter which character set is used.
    For Firefox, the file name is displayed correctly in the file Save as dialog, but it is only saved correctly to disk if the file name is in a character set supported by the system locale. This seems to be a known Firefox bug (not fully using the Windows Unicode APIs), so nothing I can do about that.
    Nothing seems to work for Opera, however - I cannot get the file name to display correctly in the file Save as dialog, no matter which method I use (I have tried URL encoding and MIME encoding in addition to the plain UTF-8).
    Has anybody implemented something similar that works for at least these 3 browsers?

    I tested your code today,
                         dialog           save           open
    Firefox 1.5          OK                 OK               OK
    IE 6.0                OK                 OK                NGdailog: filename show in download popup dialog
    save: save to disk from dialog
    open: open directly from dailog

  • How to print external file using ABAP program

    Hello
    I want to print an external file which is located in server (
    20.99.0.18\GUI\xyz\8.0QUALITY\QM_TS.DOC) .....i want to print these kind of files(which i have retrieved from table 'DRAW' field 'filep' )......i need to print these files using ABAP program.
    thank you
    Vikram.
    Message was edited by:
            Vikram Bojja

    extract the data and pass to script or smartform for printing

  • How to insert ascii characters using dom

    I am having a tough time inserting ascii values in to xml text content
    i search for a regular space and try insert a non breaking space in my xml whic is basically �
    Infact I want to insert the ascii value of a non breaking space or for that matter ascii value of any character, I am using dom level 2.
    in the code the actual replace ment string is the ascii code, somehow when I click preview, it actually shows the space instead showing the what I have in my actual code, so i had to separate in the ascii and ; in my code snippet that follows
    String text = nl.item(i).getNodeValue();
                System.out.println(text);
                String newText  = text.replaceAll("\\s", "� followed by a ;");
                nl.item(i).setNodeValue(newText)it actually inserts &#160; in the xml code for the xml document and literally "&#160 followed by ;" appears in my document when viewed from a browser, all I am trying to do is replace a given character with an ascii value using dom. All i tried to do was replace a regular space with a non breaking space.
    &nbsp won't work either, infact i tried ascii values for other characters too, i end up having the ascii value in the tag when i view the finished document in a browser.
    Please help
    Edited by: jaks4u on Mar 22, 2008 2:23 PM

    As jtahlborn says, NBSP isn't an ASCII character. But this is Java we're working with, and XML. Neither of those two things have ever restricted themselves to the ASCII character set, and neither should you. They use Unicode, which is far larger and which does include that character. You could go to [the Unicode site|http://www.unicode.org/] and do some research -- which might broaden your horizons a lot -- but the code point for that character is (not surprisingly) 160. That's A0 in hexadecimal, so the Java character representing it ischar nbsp = '\u00a0';So use that in your code. Just make sure to output the XML document in an encoding that supports it (unlike ASCII). UTF-8 would be an excellent choice.

  • How Do I Include Non-Displayable ASCII Characters in a Character String in Labview 6 ?

    I would like to send different ASCII (ETX and STX)to a device via a serial connection.
    The problem is that Labview understand it as the string E + string T + string X ...
    how can I do it ?
    Thank you for your help
    Nicolas M

    If I understand your question correctly, try using the Type Cast function (in the Advanced>Data Manipulation SubPalette). Where you want to insert your hex value, use a numeric constant and wire it to the Type Cast input. The output of the Type Cast will be a string with the non-displayable value.

  • How 2 print large characters using dos

    i need 2 print a column in large characters while generating the report. i have to use dos printing only.

    I assume by 'dos' you mean you can't go through a printer dirver but must write to a printer port (LPT:) directly.
    In this case, your ony hope is to find the doc. for the printer and see what support it has. HP printers hava a language (there's HPGL, but also a simpler one for small printers), and then of course there's PostScript.
    This used to be the way everyone did printing 'til it was hidden from us by printer drivers
    Good luck!

  • Problems with password including non-ASCII characters

    I am a German language user with a German keyboard but an English OS as main language. Therefore my passwords (simple user and admin) includes non-ASCII characters used in German, French and Spanish language, which increases security. This works fine in the majority of login scenarios. There are, however, 3 scenarios where neither my non-ASCII simple user nor my non-ASCII admin PW are accepted:
    1) running "sudo" in Terminal;
    2) When I try to shut down and another user account is still open. Doing this brings up a login window asking for the PW of the other user that does not accept non-ASCII;
    3) Using Leopard/SnowLeopard CacheCleaner. Upon opening, this app asks for an admin PW, but does not recognize non-ASCII.
    Am I right in assuming that this has to do with non-ASCII PWs? I thought ASCII times were gone given the remarkable language flexibility of Mac OS over the years. I know this stupid problem only from Win XP. There it is even worse.
    Is there a way to overcome this problem without always temporarily changing my PW? Thanks.

    I think the problem is with the applications themselves and should be reported to the developer. Although some non-ASCII characters are acceptable for an admin password, in my experience most Unix systems don't like non-ASCII characters in passwords. It may be easier to avoid them if you can.
    OS X should simply request your admin password to shut down when another user account is open. An alert dialog usually appears warning that the other user is still logged in and giving you the option to log the other account out then shut down. But in my experience the only authorization needed is for your admin account.

  • Validation logic for US-ASCII characters

    Hi folks!
    I hope this question would be acceptable for all great forum members.
    I just would like to know if there is a better way to validate the code point range for US-ASCII character set or
    my validation logic is wrong for some reason.
    Please take a look at the following validation method sample code.
    By using this validation method,
    I'd like a user passing a value of any other character set to be rejected for further execution.
    My idea is the code point range for the US-ASCII character set is from 0 to 127.
    So each character value of each String value is compared to
    the maximum code point for the US-ASCII character set.
      private void validateEachElementValueHasOnlyUSASCIIChars(
          String[] aFieldValuesArray) {
        for(String fieldValue:aFieldValuesArray){
          char[] charArray = fieldValue.toCharArray();
          for(char c:charArray){
            if(c > 0x007F){// US-ASCII character set's maximum code point.
              throw new IllegalArgumentException(
                  "the value you passed" +
                  "("+Arrays.toString(charArray)+") contains a " +
                  "character of the invalid character set.");
      }Similar topic: [http://forums.sun.com/thread.jspa?forumID=31&threadID=751191]
    Thanks for your time.
    Kenjiro
    Edited by: kenjiro on Sep 26, 2008 5:49 AM

    Yep, looks ok to me. Depending on your requirement you might also disallow some of the non-printing control characters that are in ASCII (all of which are below 32, IIRC).

  • Which ASCII Characters are acceptable?

    I'm trying to clean up my iPhoto library so it'll sync with my iPhone. One possible cause I've seen mentioned here is the use of non-standard ASCII characters in Keywords, Album names, etc.
    Can you wise folks provide a bit more info here?
    FIRST QUESTION: I'm trying to figure out exactly which characters need to be eliminated. Are the following characters allowed or not?
    . Period
    , Comma
    - Hyphen
    _ Underline
    ( ) Parentheses
    (space)
    & Ampersand
    123 Numbers
    These seem like relatively common characters, so I'm hoping I don't have to remove every one of them. It would be especially difficult to remove every "space" from every title.
    SECOND QUESTION: Exactly which fields do I need to clean up?
    - Keywords (definitely)
    - Albums?
    - Film Rolls (I hope not)
    - Photo Titles (please say no...)
    Please help! Depending on the answers, this could either be a manageable project or a week-long chore.
    And by the way... If these characters are verboten, why doesn't iPhoto reject them when I first try to enter the data?

    Adam
    Are you actually having a problem?
    There is no list, but when I post that query it's because some people who post here have had issues that were solved when they removed non-ascii characters. Others have found issues when they removed leading and trailing spaces... so (where _ stands for a space)
    _keyword
    or keyword keyword_
    have caused issues, thought the space between keyword and keyword has not caused issues.
    So, here's my (not very helpful, I admit) take on it: non_ascii characters are not a problem, trailing and leading spaces are not a problem, unless, of course, they are.
    The real issue seems to be that they lead to a malformed albumdata.xml file, which is the file that other apps read to interact with.
    I think the best way to examine the albumdata.xml file is the way that Dave E shows:
    http://discussions.apple.com/thread.jspa?messageID=3870956&#3870956
    Regards
    TD

  • Device Type to print Vietnamese Characters

    Hi Gurus,
    I can print Vietnamese characters in a laser printer using the device type SWINCF and Access Method F (Frontend printing).
    Now I want to print using Access Method U (Print using Berkeley Protocol) in a network printer (located overseas). I am using a unicode device type ZHPUTF8F because our SAP system is running under Unicode (ECC 6.0). Unfortunately the printout for the Vietnamese characters are wrong (garbage characters). Is it possible to print Vietnamese characters using a device type other than SWINCF? The printer model that I am testing with is HPLJ 4250.
    One more thing, we will be needing to print using a dot matrix printer. Is there a specific device type that can print Vietnamese characters for dot matrix printer (e.g. Printronix)?
    Thanks,
    Andre

    Hi Andre,
    did you check SAP note 750219 that all listed prerequisites are met ?
    Regarding other printers and Unicode support, please have a look at:
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1015a496-94d5-2b10-3c8e-845ff55480c0
    or apply SAP note 1036961.
    Best regards,
    Nils Buerckel
    SAP AG
    Edited by: Nils Buerckel on Mar 19, 2010 5:09 PM

  • Cannot rename file with non-ASCII characters when using the

    My application moves files from one directory to another by calling File[] srcFiles = srcDir.listFiles() to get a list of files in the source directory, and then calling srcFiles.renameTo(destFile) to rename each file.
    This does not work (renameTo returns false and the file is not moved) under the following circumstances:
    - the file's leaf name contains non-ASCII characters, for example "�"
    - the OS is Solaris 9
    - the LANG and LC_* environment variables are unset, i.e. the C locale is being used
    If I set the LANG environment variable to, for example, en_GB.UTF-8 then the rename succeeds.
    I have tried calling srcFiles[index].getName().getBytes("UTF-8") and the non-ASCII characters are being replaced with ? (0x3f) characters when LANG is unset.
    Is this a bug in the JRE? I would argue that since my code does not actually manipulate the filename (I just use the File object that File.listFiles() gives me) then the rename should succeed. Of course I would not expect the file name to be displayed correctly if I printed it out.
    I have reproduced this behaviour with JDK 1.4.2_05 and 1.5.0_04 on Solaris 9.
    Francis

    Thanks for the info Alan.
    I considered setting the locale in the environment (this sounds like the "correct" fix to me and we might implement it later), but this application shares a WebLogic server with many other applications so we would have to do a huge amount of testing to make sure that the locale change wouldn't break the other apps. In the end I worked around the problem by making the code that generates the filenames in the first place strip out any non-ASCII characters (the names of the files are not critically important).
    Looking forward to JSR-203, in the meantime perhaps a note about this behaviour in the java.io.File javadoc would be useful.

  • Inserting non-ascii characters to ORACLE using SQLPLUS

    Hi
    I'm using Oracle 10.2.
    I would like to insert data with non-ascii characters, like éñ etc.
    For example:
    INSERT INTO FOO(NAME) VALUES ('abcñ');
    The problem is this - when I use SQLDeveloper with this query - there's no problem. However when I use SQLPLUS - I see the ñ character messed up.
    Most environments use some kind of escaping mechanism (like the \uXXXX in JAVA or %XX in URL escaping), but I simply can't find how to do so in SQLPLUS.
    Can somebody help please?

    Are you using "char" or "nchar" character datatypes? Make sure that the database character set defines the language script you need to support (see nls_database_parameters).

  • Replacing non-ASCII characters with HTML charcter references

    Hi All,
    In Oracle 10g or greater is there a built-in function that will convert a string with non-ASCII characters like this
    a b č 뮼
    into an ASCII string with HTML character references like this?
    a b & # x 0 1 0 D ; & # x B B B C ;
    (note I had to include spaces between each character in the sample code for message to prevent the forum software from converting my text)
    I tried using
    utl_i18n.escape_reference( val, 'us7ascii' )
    but for some reason it returns
    a b c & # x B B B C ;
    Note how it converted the Western European character "č" to its unaccented counterpart "c", not "& # x 0 1 0 D ;" (is this a bug?).
    I also tried a custom solution using regexp_replace and asciistr (which I can't include here because the forum software chokes on it) but it only returns the correct result for values <=4000 characters long. Unfortunately asciistr doesn't appear to accept CLOB values larger than 4000 characters. It returns an error message like
    (ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 30251, maximum: 4000) ).
    I'm looking for a solution that works on CLOB data of any size.
    Thanks in advance for any insight you can provide.
    Joe Fuda

    So with that (UTF8) in mind, let's take another look.....
    As shown below, I used a AL32UTF8 database.
    Note: I did not use a unicode capable tool for querying. So I set console mode code page to 1250 just to have č displayed properly (instead of posing as an è).
    Also, as a result of using windows-1250 for client character set, in the val column and in the second select's ncr column (iso8859-1), è (00e8) has been replaced with e through character set conversion going from server back to client.
    Running the same code on a database with a db character set such as we8mswin1252, that doesn't define the č (latin small c with caron) character, would yield results with a c in the ncr column.
    C:\>chcp 1250
    Aktuell teckentabell: 1250
    C:\>set nls_lang=.ee8mswin1250
    C:\>sqlplus test/test
    SQL*Plus: Release 11.1.0.6.0 - Production on Fri May 23 21:25:29 2008
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    With the OLAP option
    SQL> select * from nls_database_parameters where parameter like '%CHARACTERSET';
    PARAMETER              VALUE
    NLS_CHARACTERSET       AL32UTF8
    NLS_NCHAR_CHARACTERSET AL16UTF16
    SQL> select unistr('\010d \00e8') val, utl_i18n.escape_reference(unistr('\010d \00e8'),'us7ascii') NCR from dual;
    VAL  NCR
    č e  c e
    SQL> select unistr('\010d \00e8') val, utl_i18n.escape_reference(unistr('\010d \00e8'),'we8iso8859p1') NCR from dual;
    VAL  NCR
    č e  &# x10d; e     <- "è"
    SQL> select unistr('\010d \00e8') val, utl_i18n.escape_reference(unistr('\010d \00e8'),'ee8iso8859p2') NCR from dual;
    VAL  NCR
    č e  č &# xe8;
    SQL> select unistr('\010d \00e8') val, utl_i18n.escape_reference(unistr('\010d \00e8'),'cl8iso8859p5') NCR from dual;
    VAL  NCR
    č e  &# x10d; &# xe8;In the US7ASCII case, where it should be possible for all non-ascii characters to be escaped, it seems as if the actual escape step is skipped over.
    Hope this helps to understand whether utl_i8n is usable or not in your case.
    Message was edited by:
    orafad
    Fixed replaced character references :)

  • How can I use ASCII Characters on the iPad?

    I have an iPad (1) and use iOS 4.3.5. Is there an easier Way of using ASCII Characters than having to use the "copy-Paste" procedure? If not, can we expect to see the feature of entering the ASCII code straight through the standard keyboard soon?

    Norisouro wrote:
    . Is there an easier Way of using ASCII Characters than having to use the "copy-Paste" procedure?
    You need to give some details about what it is you want to do, because ASCII Characters are what are already on the keyboard.  It is non-ASCII that you might need to copy/paste.
    http://en.wikipedia.org/wiki/ASCII
    I think you can be sure that Apple is never going to include a feature in iOS that has you input special characters by typing in numbers like Windows does it.  Mac's have always used a different approach.

Maybe you are looking for

  • Window Arrange New Window for (Document name) is not creating a floating document? It works on my PC, but not my Mac (Mavericks).

    So I know this command is supposed to create that document in a new window and have it float ontop of the original document. It (the new window for the document) is supposed to stay in front of anything on the application frame, like the UI does. But

  • Problem in ref cursor output..plz suggest changes

    SQL> select * from department;     DEPTNO ENAME      7124284 SINGH SQL> CREATE OR REPLACE PACKAGE l_ref_cursor   2  AS   3  TYPE rc IS REF CURSOR;   4  END;   5  / Package created. SQL> CREATE OR REPLACE PROCEDURE P_RET_REF_CURSOR(in_deptno IN NUMBER

  • Report and Form on same page

    I used the wizard to create a report and form on a table. When the user hits the edit link on the report, it brings up the form (so they can edit) on a new page. Instead of this, I want the form to show on the same page as the report. What is the bes

  • Enterprise Portal INtegration with ECC 6.0

    Hello Experts I have installed ECC 6.0 SR3 and Enterprise POrtal 7.0 Systems. These two servers were installed on Virtual servers using cloud computing. ECC 6.0 I.P is 173.X.XX.164 and EP system was installed on 173.X.XX.169 IP. I need to set up conn

  • Non printing cartridges

    Hi Folks: Printer will not print magenta & light magenta cartridges. Get no error messages for either one. Twice checked supply levels - magenta=100% / lt. magenta=85%. Ran both levels 1 & 2 of head cleaning routine. Followed "community" suggestion o