cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi Guys,

I am facing problem with null values in string and it's hex code xstring. I have some data in one field with data type LCHR. This field contains data like :

"SAPMSDYP MBatch-Input ####%PC 60317081539#?"

I have one abap program. I am just appending this data to a string variable and then converting this string to xstring data. The length of the string is 53 and after conversion to xstring the length of xstring data is more then the string data. In string data wherever the "#" is there it is coming as "0000" in raw data(xstring). After this conversion i am just sending this data to my java program using http_client. At java side if the incoming data is having null value in-between data then this java program will reject this data. The main problem is i have to handle these null value in my abap program only.

At debugging time in variable details box also its hex value is showing as 0000 that is sap's default string to hex conversion. And if i move the mouse cursor on this variable then in hint box this single '#' is showing as 5 characters as CString.

For string to xstring conversion i am using the below code: CL_ABAP_CONV_OUT_CE=>create(

encoding = 'UTF-8'

endian = 'L' ).

conv->convert( EXPORTING data = text

IMPORTING buffer = buffer1 ).

Here i have to handle this null("#") value either in string data or in xstring data in ABAP program only. I don't know how to do this.

0 Likes
View Entire Topic
Florian
SAP Champion
SAP Champion
0 Likes

Why don't you handle the # sign with abap before sending it to your java application? You can build a construct with string functions.

So you don't have to deal on the java-side:-)

Here are some keywords to point you the correct documentation.

String Functions, count, find, and match

~Florian

Former Member
0 Likes

Hi Florian,

I tried at ABAP side also but any of the string function is not able to modify / replace or change this character. I need the way where i can get its correct hex value.

~Shekhawat

Florian
SAP Champion
SAP Champion
0 Likes

You may have a look at the debugger to see the values unconverted. As Ebrahim suggest, I think this is the rootcause atm.