Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Special Character in ABAP

Former Member
0 Kudos

Hello,

I can't remember how to use specials characters in ABAP, for example if I want to put a tab in a string.

Can someone help me ?

Thanks,

Benoî

1 ACCEPTED SOLUTION

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Benoît!

Then you are probably not in an unicode system, so you can make a trick with a structure:


DATA: BEGIN OF tab_struc,
        field TYPE x,
      END OF tab_struc,
      tab TYPE char1.
tab_struc-field = 23.

Now you can assign to the hexadecimal field any code, which is for tab maybe 11 - just try out some values below 27. Later you just use the structure tab_struc, but without specifying the field -> you get a conversion into char without changes of value, that is as much as a tab or bell or linefeed.

Regards,

Christian

6 REPLIES 6

former_member188685
Active Contributor
0 Kudos

Hi

<b>SPACE</b> is the Special character name.

concatenate 'ABC' 'DEF' into str separated by <b>space</b>.

regards

vijay

eddy_declercq
Active Contributor
0 Kudos

Hi,

You use cl_abap_char_utilities=>HORIZONTAL_TAB for this.

Eddy

0 Kudos

Thanks but I need the old fashion

For 4.6C in fact

0 Kudos

Hi,

I dont know how much this helps you but in ABAP Editor (SE38), TAB moves 2 spaces...

May be you can try inserting two spaces (which I think are equivalent of a TAB) in your string..

In 4.6c ofcourse..

Sri

Message was edited by: Srikanth Pinnamaneni

abdul_hakim
Active Contributor
0 Kudos

Hi,

In SAPScript you can use tab character but in normal report transaction you cannot.You may use SPACE for getting spaces..

Regards,

Abdul

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Benoît!

Then you are probably not in an unicode system, so you can make a trick with a structure:


DATA: BEGIN OF tab_struc,
        field TYPE x,
      END OF tab_struc,
      tab TYPE char1.
tab_struc-field = 23.

Now you can assign to the hexadecimal field any code, which is for tab maybe 11 - just try out some values below 27. Later you just use the structure tab_struc, but without specifying the field -> you get a conversion into char without changes of value, that is as much as a tab or bell or linefeed.

Regards,

Christian