Abap TO CONVERT SPECIAL CHARACTERS TO SPACE

I have a field in BI "zpustreg" which has values with - and # which is not allowing me to load the data to cube so I am writing this code in transformation to convert any special character to space. but it is having error if you can help me fix the code below would really appreciate it
<b>Abap Code to Load ZPUSTREG</b>
  METHOD compute_ZPUSTREG.
  IMPORTING
    request     type rsrequest
    datapackid  type rsdatapid
    SOURCE_FIELDS-/BIC/ZPUSTREG TYPE /BIC/OIZCUSTREG
   EXPORTING
     RESULT type tys_TG_1-/BIC/ZPUSTREG
    DATA:
      MONITOR_REC    TYPE rsmonitor.
$$ begin of routine - insert your code only below this line        -
... "insert your code here
*DATA:Monitor_REC TYPE rsmonitor.
DATA:L_D_OFFSET LIKE sy-index.
CONSTANTS:c_allowed(60) TYPE c.
Value `ABCDEFGHIJKLMNOPQRSTUVWXYZ!"%&'()*+,-/:;<=>?_0123456789_’.
RESULT = SOURCE_FIELDS-/BIC/ZPUSTREG
TRANSLATE RESULT TO UPPER CASE
DO 60 TIMES.
L_d_offset = sy-index – 1.
IF RESULT+1_offset(1) CO c_allowed.
Else.
RESULT+1_d_offset(1) = ` ’.
ENDIF.
ENDDO.
ENDMETHOD.
<b>
E:Statement "VALUE" is not defined. Check your spelling. spelling.
E:Unable to interpret "C". Possible causes of error: Incorrect spelling</b>
Thanks
Soniya

Hello Soniya
There is simply a '.' at the wrong place:
CONSTANTS:c_allowed(60) TYPE c.  "<- wrong, remove
Value `ABCDEFGHIJKLMNOPQRSTUVWXYZ!"%&'()*+,-/:;<=>?_0123456789_’.
CONSTANTS:c_allowed(60) TYPE c
Value `ABCDEFGHIJKLMNOPQRSTUVWXYZ!"%&'()*+,-/:;<=>?_0123456789_’.
That's it.
Regards
  Uwe

Similar Messages

  • Special Characters and spaces in Tablenames and Column Names are allowed ?

    Hi
    I have created two tables in Oracle10g
    as follows
    SQL> create table test(columna number,columnb varchar2(20),primary key(columna));
    Table created.
    SQL> insert into test values(1,'test');
    1 row created.
    SQL> commit;
    COMMIT är utfört.
    SQL> create table "test quote"("#" number,abc number,primary key("#"));
    Table created.
    SQL> insert into "test quote" values(1,2);
    1 row created.
    SQL> commit;
    COMMIT är utfört.
    SQL> select * from "test quote";
    # ABC
    1 2
    SQL> select * from test;
    COLUMNA COLUMNB
    1 test
    Now I want to cache the tables and their data into TimesTen
    The cache group for table test which is not having any spaces and special characters in table name and column names is created perfectly.
    But when I create the cache group for table "test quote" which is having special characters and spaces it gives error :
    Command>create readonly cache group w2 from testuser.test(columna number,columnb varchar2(20),primary key(columna));
    Command>select * from test;
    <1,test>
    1 row found.
    Command>create readonly cache group w3 from testuser."test quote"("#" number,abc number,primary key("#"));
    5140: Could not find TESTUSER.TEST QUOTE in Oracle. May not have privileges.
    Command Failed.
    Now there is contradiction that why cache group for table test is created successfully and why it is not being created for table "test quote".
    What I think is if special characters and spaces in column names and table names are possible in Oracle then it sould be possible in TimesTen.
    Any possible solution.
    Looking forward for your reply.
    Please help I am stuck badly.
    /Ahmad

    Hi
    Problem Solved ....... Remeber only Capital letters work with special characters ......
    /Ahmad

  • To convert special characters to English characters.

    Is there any functional module to convert special characters(Latin) to English characters?

    Hi Meera,
         Welcome To SDN!!
    try using the function module 'SCP_REPLACE_STRANGE_CHARS'.
    Give the variable with special characters in intext.
    Regards
    Kiran Sure

  • How to convert special characters in ABAP to XML?

    Hi All.
    We have a scenario where from XI (exchange Infrastructure), a BAPI is called which returns an XML. From that XML, a PDF is generated.
    Now, if the XML contains any special characters, it will fail.
    So if any CHinese char or >, # etc signs are there, it fails.
    Can you please tell me how to convert my string in ABAP to a proper XML?
    I am new to it and I was trying the following code
    DATA: today TYPE string,
          result TYPE string.
    today = 'This is testing'.
    CALL TRANSFORMATION ID
         SOURCE today = today
         RESULT XML result.
    IF sy-subrc = 0.
      WRITE result.
    ENDIF.
    But it does not return me anything.
    Thanks in adv.

    hi
    good
    go through these links,hope these would help you to solve your problem
    http://www.sap-press.de/download/dateien/792/sappress_abapreference_2edition.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c2567f2b-0b01-0010-b7b5-977cbf80665d
    thanks
    mrutyun^

  • HTML Editor - converting "special characters" into entities

    Hi everyone,
    I'm currently in the middle of formatting my wife's novel into 'clean' html so I can use Calibre to create a well formatted epub/mobi/etc.
    I've read that TextMate on Mac includes a function to "Convert Selection to Entities excluding Tags".  In other words it will replace all special characters (ellipses, copyright sign, etc) with the html entities.
    I'm currently using Kate and I can't seem to find anything similar.  Is anyone aware of any linux editors with the same function?
    Thanks for the help!

    ctarwater wrote:Encoding is already UTF-8 but I'm trying to make these docs as "universal" as possible and I've read that little things like replacing quotation marks and other symbols with their html entities is a good step in that direction.
    In situations with multiple encodings this might be the case, but the XML spec requires UTF‐8 support at minimum and defaults to it when the encoding is not declared. All XML parsers can deal with UTF‐8.
    In fact, replacing UTF‐8 characters with entities is less portable in XML. This is because the available entities are defined by the doctype, and XML only supports five by default (&lt;, &gt;, &quot;, &amp;, and &apos;). Things like &hellip; are defined in the HTML and XHTML doctypes, but not in other dialects of XML. This used to bite RSS pretty hard (probably still does), because people assumed the entities were available everywhere when they’re really not. EPUB and Mobi are based on XHTML, but other formats might use other XML dialects.

  • Converting control characters to spaces in a Unicode program?

    I want to take an ASCII character string and convert any
    ASCII Control Characters to Spaces.
    In a non-Unicode program, I define the following hex constant:
    CONSTANTS: c_control_to_space(64) TYPE x VALUE
      '00200120022003200420052006200720082009200A200B200C200D200E200F20' &
      '10201120122013201420012016201720182019201A201B201C201D201E201F20'.
    I then execute the following TRANSLATE statement:
          TRANSLATE w_transcript USING c_control_to_space.
    What would be the "approved" method of accomplishing the same effect
    in a Unicode program?

    Neil,
    First, thank you for pointing out my typo. You are correct that the "0120" in the second line of the literal was intended to be "1520".
    Second, thank you for your suggestion. Based on your idea, I tried something similar, but not exactly what you suggested. In particular, since I can't figure out how to construct the constant that I want, I used your idea to construct it as  a variable, as follows:
      DATA number TYPE i.
      DATA offset TYPE i.
      DATA hex(4) TYPE x.
      FIELD-SYMBOLS <char> TYPE c.
      ASSIGN hex TO <char> CASTING TYPE c.
      DATA w_control_to_space(64) TYPE c.
      DO 32 TIMES.
        hex = sy-index - 1.
        offset = 2 * ( sy-index - 1 ).
        number = STRLEN( <char> ).
        IF number GT 1.
          SUBTRACT 1 FROM number.
          SHIFT <char> LEFT BY number PLACES.
        ENDIF.
        w_control_to_space+offset(1) = <char>.
      ENDDO.
    After having constructed "w_control_to_space", I can now use the TRANSLATE statement:
      TRANSLATE w_transcript USING w_control_to_space.
    This code passes the Unicode syntax checks and works correctly on a non-Unicode system. I don't have access to a Unicode system on which to run it. I'd appreciate any feedback on this approach - especially if someone can actually test it on a Unicode system.

  • Auto convert special characters

    Good day all and thanx for your help.
    CS3 & trying out CS5.
    A couple of the sites I do, are written in Afrikaans, ons of the 11 official languages in South Africa.
    Afrikaans makes use of characters such as ê, ë, ô, ü, é, ö and so on. I normally forget to change it in code view and make use of &... It then displays as funny characters in browser. Is there a way I can learn/tell DW to auto change my special characters or do you perhaps have a good solution or tip for me.
    Thank you very much.
    Regards,
    Deon

    Hi Deon,
    that happens to me very often too. So I too thought it would be nice to change the special characters automatically. All I've found at that time was a payment program (in those days for CS3). It's still here after all:
    http://www.experts-exchange.com/Web_Development/Software/Macromedia_Dreamweaver/Q_22706485 .html
    Meanwhile, I'll do it in another way. When I finished one of my sides, I use the "Find and Replace"-function of DW. I start searching one of the special characters and after changing them (if necessary), I only replace one character and can start a new action. Look here for example (from my German DW where we have the same problems in our language):
    The general way to insert the special characters you know, I suppose. If not, here you will find a nice tutorial:
    http://www.recipester.org/Recipe:Insert_special_characters_in_Dreamweaver_27537484
    or
    http://help.adobe.com/en_US/dreamweaver/cs/using/WSc78c5058ca073340dcda9110b1f693f21-7ccca .html
    Hans-G.

  • How to convert special characters like #, &, etc occuring in the input string

    Hi,
              I am using method 'Get' to submit a form . When ever there is any
              special character like '#' in my input For example "033#Test", nothing
              gets posted beyond 033.
              Can any one please let me know how do I overcome this problem.
              Thanks in advance.
              Regards,
              Moin
              

    Moinuddin:
              It seems possible your browser may be confused by the fact that 033 is
              the octal representation for an ESCape character (Hex 1B). Try dropping
              the leading zero. In addition, it is usually better to represent special
              characters like the hash mark "#" using HTML character entities instead
              of literals, i.e. &#35; = hash mark
              Regards,
              Jim Brown
              Moinuddin Ahmed wrote:
              >
              > Hi,
              > I am using method 'Get' to submit a form . When ever there is any
              > special character like '#' in my input For example "033#Test", nothing
              > gets posted beyond 033.
              >
              > Can any one please let me know how do I overcome this problem.
              >
              > Thanks in advance.
              > Regards,
              > Moin
              Jim Brown
              Developer Relations Engineer
              BEA Support
              

  • Report Query - Download data - converts special characters

    When I'm doing a select from a table which has a "<" or ">" sign it is being changed to &lt; or &gt; when I view the XML data that is being downloaded. Is there any way to prevent it from doing this?

    What I'm finding is that when master detail data is dumped in XML it is being dumped as individual rows.
    <DOC>
    <ID>12341</ID>
    <RC>23456</RC>
    </DOC>
    <DOC>
    <ID>12342</ID>
    <RC>34567</RC>
    </DOC>
    <DOC>
    <ID>12343</ID>
    <RC>45678</RC>
    </DOC>
    What I'm trying to achieve is this ...
    <DOC>
    <ID>12341</ID>
    <RCROW>
    <RC>23456</RC>
    <RC>34567</RC>
    <RC>45678</RC>
    </RCROW>
    </DOC>
    This is how one should expect the data to look... not as my first example. Can I do this with plsql... most definitely. However, the report query tool wants a select statement. You can add queries but it will simply output the data as a single row regardless of how many queries you create. Furthermore I thought I might try to introduce subnodes by encapsulating the data with <> but unfortunately any special data will get converted to html code. So when I read it with text viewer software I can see these replaced with &lt; and &gt; Within the report query tool you can't create a select which will format the data (as per my second example). I'm trying to use reporting software which will expect the data as per my second example so that it will appear grouped and sorted properly but it won't work if the rows are being treated as individual lines as in my first example. I'm not sure why Oracle would not allow you to sort and group it this way since any XML data I've seen, seems to be grouped as per my second example and not as they have implemented it. I have no idea as to how to create this format to the data using report queries given the data will get converted to HTML.

  • Creating xml and converting special characters

    I am trying to creating an xml representation of some data. I have created various methods for creating the various parts of the structure.
    But is there an easy way to transform invalid xml characters to the xml representations (such as converting to a particular charset) e.g & -> amp;
    public class XMLTagDisplayFormatter extends AbstractTagDisplayFormatter
        private static XMLTagDisplayFormatter formatter;
        protected static final String xmlOpenStart = "<";
        protected static final String xmlOpenEnd = ">";
        protected static final String xmlCloseStart = "</";
        protected static final String xmlCloseEnd = ">";
        protected static final String xmlSingleTagClose = " />";
        protected static final String xmlSingleDataTagClose = "]] />";
        /** Return xml open tag round a string e.g <tag> */
        public static String xmlOpen(String xmlName)
            return xmlOpenStart + xmlName + xmlOpenEnd;
        public static String xmlOpenHeading(String name,String data)
            return(xmlOpen(name+" id=\""+data+"\""));
        /** Return xml close tag around a string e.g </tag> */
        public static String xmlClose(String xmlName)
            return xmlCloseStart + xmlName + xmlCloseEnd;
        public static String xmlSingleTag(String data)
           return xmlOpenStart + data + xmlSingleTagClose;
       public static String xmlFullTag(String xmlName,String data)
           return     xmlOpen(xmlName)
                   +  data
                   +  xmlClose(xmlName);
        StringBuffer sb = new StringBuffer();
        public void   openHeadingElement(String type,String value)
             if(value.equals(""))
                 sb.append(xmlOpen(type));
             else
                 sb.append(xmlOpenHeading(type,replaceXMLCharacters(value)));
        public void   openHeadingElement(String type,boolean value)
          openHeadingElement(type,String.valueOf(value));
       public void   openHeadingElement(String type,int value)
            openHeadingElement(type,String.valueOf(value));
        public void   closeHeadingElement(String type)
            sb.append(xmlClose(type));
        public void addElement(String type, String value)
            sb.append(xmlFullTag(type,replaceXMLCharacters(value)));
        public void addElement(String type, int value)
            addElement(type,String.valueOf(value));
        public void addElement(String type, boolean value)
            addElement(type,String.valueOf(value));
        public String toString()
            return sb.toString();
        public AbstractTagDisplayFormatter getInstanceOf()
            if (formatter == null)
                formatter = new XMLTagDisplayFormatter();
            return formatter;
    }

    Thanks,
    Ive written this method which seems to work for me although Im only using it for debugging.
    public static String xmlCData(String xmlData)
            char tempChar;
            StringBuffer replacedString = new StringBuffer();
            for(int i=0;i<xmlData.length();i++)
               tempChar = xmlData.charAt(i);
               if(
                   (Character.isLetterOrDigit(tempChar)==true)
                   ||
                   (Character.isSpaceChar(tempChar)==true)
                   replacedString.append(tempChar);
               else
                   replacedString.append("#x"+Character.digit(tempChar,16));
             return xmlCDataTagOpen + replacedString + xmlCDataTagClose;
        }

  • Convert special characters

    hi
    is it possible to read the below text with pl/sql??
    ïq¿ÁkÜ/‡ùôL•

    Yeah. As long as your NLS_LANG is set properly to handle these characters? What are these characters? Are they in ISO-8859? UT8?
    Cheers
    Sarma.

  • How to convert special characters like #, &, etc occuring in the input stri

    Hi,
    I am using method 'Get' to submit a form . When ever there is any
    special character like '#' in my input For example "033#Test", nothing
    gets posted beyond 033.
    Can any one please let me know how do I overcome this problem.
    Thanks in advance.
    Regards,
    Moin

    Before you send the form parameters you need to url-encode them. Like this:String param1="param=033#Test";
    String encodedParam1 = java.net.URLEncoder.encode(param1);Then send the encoded version, which if you examine it you will see looks like "033%25Test".

  • How to Avoid Special Characters in string

    Hai.
    I want only Alphabets & Digits to be entered in to my string.No any other special characters except spaces.How can I do this? 
    Solved!
    Go to Solution.

    MikeS81 wrote:
    see the attached example.
    I would allow a few more, e.g. 0 and 8 to allow editing of the entered string (backspace, cursor buttons, delete key, etc.).
    Message Edited by altenbach on 11-21-2008 12:49 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    check_char_LV80MOD.vi ‏14 KB
    FilterStringInput.gif ‏6 KB

  • Output proper special characters in JSTL custom tag

    I've written a custom JSTL Tag and want to output proper encoded special characters, like the c:out tag does (example: > to >). Do I have to parse that manually or is there a method within the jsp-api?

    Custom JSTL tag ?????Oops. Custom tag, of course.
    In custom tags, you have to manually parse it AFAIK.Somehow I can't imagine that such a frequently needed feature has do be done manually. Almost every tag that has to output data, has to convert special characters, otherwise cross-side-scripting would be possible.

  • Replacing 'special' characters

    Hi all,
    I was wondering if thers is a function module, class (method) or whatever (codepage translation) to convert 'special' characters like:
    è, é, ë, ï, etc with respectively e, e, e, i?
    More generally speaking we need to convert all characters (whether it be Unicode, Latin-1, etc.) to plain text containing only the letters of the alphabet from a-z and A-Z.
    Kind regards,
    Micky.

    @ Rainer,
    both thanks a lot for your relevant replies which are quite helpful. And I do think that we still needs some sort of intermediate table to hold at least some characters to be translated/converted into plain text.
    @ Gautham,
    I'm currently testing this function module with several codepages (parameter INTER_CP) beside the default codepage 1146. For characters like ë and ï this is definitely the way to go, but when using some characters that are really out there like ¥ŖßÞu0152u03A9u03C6, we still seem to be needing an intermediate table to replace these characters.
    But again, some very helpful answers.
    P.S. Although both answers are potentially worth 10 pts, It only seems fair to give you both the credit you deserve.

Maybe you are looking for