Application Development and Automation 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: 
Read only

How to work with data type XSTRING?

Former Member
0 Likes
4,136

Hello Abapers,

I have an issue with xstring...The sample program is like

DATA a TYPE xstring.

a = 'BEN123NNET'.

WRITE : a.

but the output is ' BE '

Why isn't the remaining fields getting displayed?

With Regards,

Bennet Thomas.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,983

Hi,

Actualy xstring recognize only the HEX values i.e 0 to 9 and A,B,C,D , E and F. since N is beyond that range the string is truncated.

Instead of your string if you take a string like 'BEA123BF' you will get the entire string.

Or use string instead of Xstring.

Regards,

Anirban

7 REPLIES 7
Read only

Former Member
0 Likes
1,983

Hi

May be the data length of xstring u hav defined somewhere in yr program is of 2.that's why it is taking only BE

chek this .

Thnks

Anurodh

Read only

naveen_inuganti2
Active Contributor
0 Likes
1,983

Hi Thomas....

We can use... SSTRING for this.

What is the problem with that.?

---Naveen.I

Read only

0 Likes
1,983

Hi Naveen,

I am working with unicodes and have an issue with this xstring data type....will this (SSTRING) be of use when we work with structures during unicode conversions...will there be any alignments that we need to consider?

With Regards,

Bennet Thomas.

Read only

bpawanchand
Active Contributor
0 Likes
1,983

Hi

Check this link you will come to know when we use Xstring

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abapprogramtodownloadBITMAPfileto+PC

Regards

Pavan

Read only

0 Likes
1,983

Dear Pavan,

The link provided by you is not working. Can you specify some alternate URL?

regards

Supriyo

Read only

Former Member
0 Likes
1,984

Hi,

Actualy xstring recognize only the HEX values i.e 0 to 9 and A,B,C,D , E and F. since N is beyond that range the string is truncated.

Instead of your string if you take a string like 'BEA123BF' you will get the entire string.

Or use string instead of Xstring.

Regards,

Anirban

Read only

0 Likes
1,983

Hi Anirban,

Thank you.. I was breaking my head with this...Have a great day...

With Regards,

Bennet Thomas.