Skip to Content

ASCII value

Guys:

This is might be not SAP related!!!

What is Ascii charter for 23 in Microsoft Excel since i am sending excel sheet to uploading data into SAP. SAP standard program spliting data based on the 23 Ascii value so i will also separate my excel file by 23 Ascii char.

Thanks in advance

Suresh Babu Karanam

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

11 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 04, 2005 at 03:38 PM

    Hi Suresh,

    ASCII 23 = ETB (Hex = 17) (Char = ^W)

    Meaning = End transmission block, not the same as EOT

    You might take a look at site:

    http://www.robelle.com/library/smugbook/ascii.html

    Regards,

    Rob.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 06, 2005 at 08:49 AM

    Guys:

    My requirment is i have one,two and three variables. i need to concatenate and <b>separeted char 23 is ASCII value</b>.

    one = my.

    two = sap.

    CONCATENATE one two INTO three

    <b>SEPARATED BY (ASCII 23)</b>

    How can i go about that above issue. If any body have idea please share with me.

    Advanced Thanks

    Suresh Babu Karanam

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 06, 2005 at 01:40 PM

    Hi Suresh,

    there is a work-around with structures:

    DATA: BEGIN OF ascii23_struc,

    field TYPE x,

    END OF ascii23_struc,

    ascii23 TYPE char1.

    ascii23_struc-field = 23.

    MOVE ascii23_struc TO ascii23.

    Unfortunately it's not longer supported with unicode.

    I didn't find 23 somewhere in SAP, but for some other characters following is available (in 4.7):

    ascii23 = cl_abap_char_utilities=>horizontal_tab.

    In older version an include or type-pool for some general definitions should be available.

    Regards,

    Christian

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 06, 2005 at 02:42 PM

    Hi Suresh,

    You can easily concatenate using a ASCII value and also split the concatenated string at ASCII value.

    Check the below code,

    DATA: temp_hexa TYPE x VALUE 23,

    one(10) TYPE c,

    two(10) TYPE c,

    three(20) TYPE c,

    i_itab TYPE TABLE OF string,

    w_itab like line of i_itab.

    one = 'My'.

    two = 'SAP'.

    • Concatenation of the strings using ascii 23

    CONCATENATE one temp_hexa two INTO three.

    WRITE:/ 'one :',one,' two :',two.

    WRITE:/'three :',three.

    • Slpitting the strings at ascii 23

    SPLIT three AT temp_hexa INTO TABLE i_itab.

    LOOP AT i_itab into w_itab.

    WRITE:/ w_itab.

    ENDLOOP.

    But when the concatenated string is print it will show the ASCII as # (i don't know why).

    Hope that is helpful to you.

    Regards,

    Kathirvel.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Interesting you say that,

      <i>

      But when the concatenated string is print it will show the ASCII as # (i don't know why). </i>

      data : temp_hexa TYPE x VALUE 23

      temp_hexa has a hexadecimal type. So the value assigned would be hexadecimal and therefore 23 would actually be 3 + 16 * 2 = 35 and ASCII for 35 is #

      So you should use value as 17.

      Regards,

      Subramanian V.

      P.S. - Nevertheless it is a novel way

      Message was edited by: Subramanian Venkateswaran

  • author's profile photo Former Member
    Former Member
    Posted on Jan 06, 2005 at 03:02 PM

    Hi Subu,

    You assign any ascii value to a hexa decimal type variable (say the temp_hexa), and print it on a list, i tried '09' for tab, '44' for ,(comma), but in the list it was only #.

    If you could really solve this out for me it will be really nice.

    Please try this and tell me the results.

    Thanks in advance.

    Kathirvel.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 06, 2005 at 03:56 PM

    Christian:

    Thank you very much for usefull information. If po'ble 09 ASCII value charecter will also solve my purpose.

    Regards

    Suresh Babu Karanam

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 06, 2005 at 04:03 PM

    Hi Suresh,

    If you got some answers please share them, it will be help for us.

    Regards,

    Kathirvel.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 06, 2005 at 04:32 PM

    Hi Guys:

    please test the following code in the debugging mode you can identify for <b>same char(#)</b> have different <b>hexa decimal</b> values.

    code

    -


    data : gd_separator type c.

    data : test type c value '#'.

    gd_separator = cl_abap_char_utilities=>horizontal_tab.

    Once again thanks for all your help.

    Regards

    Suresh Babu Karanam

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 06, 2005 at 05:04 PM

    Hi,

    some more comments:

    data temp type x value 23 "23 is entered as decimal, so this was correct (not 17)

    When printing or debugging, we are all using SAP's list processor - and there are some restrictions to "printable characters": that's why most times just # as replacement is displayed. This doesn't occur in file download, but would be visible by using AL11 for displaying the file - just use a local editor for checking (the existence of tabulator for example).

    If tabbed file is enough, two ways are handy: using a structure

    TYPES: BEGIN OF types_line,

    one TYPE mara-matnr,

    sep01 TYPE c,

    three TYPE kna1-kunnr,

    sep02 TYPE c,

    ...

    end of types_line.

    ...

    start-of-selection.

    CLASS cl_abap_char_utilities DEFINITION LOAD.

    wa_line-sep01 = cl_abap_char_utilities=>horizontal_tab.

    *( or old-style like mentioned above)

    MOVE wa_line-sep01 TO: wa_line-sep02, ...

    ...

    Or you use concatenate ... separated by sep...

    which will lead to different results, when your fields contain spaces - shouldn't bother with Excel.

    Regards,

    Christian

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Christian for sharing that piece of information.

      Just to confirm your statement, I wrote this piece of code, and the difference is in the quotes. Something new to learn every day, I guess.

      data: hexa1 type x value '23'.
      data: hexa2 type x value 23.
      data: character type c.
      
      if hexa1 eq hexa2.
        write 'Equals'.
      else.
        write 'Does not equal'.
      endif.
      

      And hexcode 23 translating to 35 in decimal and exactly matching with the '#' code is just too much of a coincidence , I guess, for my theory.

      Thanks again.

      Regards,

      Subramanian V.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2005 at 03:22 AM

    Thanks Suresh and Christian,

    I have something more to add, some time back i got stuck in a same kind of problem; i found some results, they are

    1. If we want to use some separators mainly ASCII, they must be declared as hexa decimal values in most cases.

    2. The above is much applicable when we want to split a string that has been concatenated using an ASCII value.

    3. When such a string is concatenated and printed it will not display most of the ASCII values like (TAB - 09, ETB - 23, etc) instead it will display a # value only (but the hexa value will correspond to the actual ASCII value if debugged).

    4. But when the same concatenated value is downloaded into a file the assigned ASCII value can be found.

    Thus like Christian told these may be due to restrictions to "Printable Characters".

    Once again Thanks to you all,

    Regards,

    Kathirvel.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.