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: 

Problem with Search String, conersion of New Line character.

Former Member
0 Kudos

Dear All,

I am invoking a Z* RFC from Java System.

Some value of String type is passed to the BAPI, (Let's call it Long Text).

The String variable (Long Text)may also contain New Line Character , which is represented by Carriage Return(CR) and Line Feed(LF) in Java,

CR and FL is represented by ''

and '

' respectively in Java System.

But when these values are passed to the BAPI , they are displayed as '#' character in SAP Debugger.

In the same RFC Parameter (Long Text) , I tried to search for ' & # x D ; ' , ' & # x A ; ' or '#' , with

SEARCH fv_str FOR ' & # x D ; ' , ' & # x A ; ' or '#' ,

but the ABAP Code can not find any of these string in the Long Text provided to the RFC.

Some one having any idea about the issue, please help.

Thanking You All.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

If you search this forum you will find posts about how to deal with these characters... which are hex 0D and 0A....

See attributes for class CL_ABAP_CHAR_UTILITIES. In your abap code you need to utilize:

CL_ABAP_CHAR_UTILITIES=>CR_LF.

or turn off unicode switch and insert a definition, like:

data: lv_cr type x value '0D',

lv_lf type x value '0A'.

and compare value in your string to that....

2 REPLIES 2

Former Member
0 Kudos

If you search this forum you will find posts about how to deal with these characters... which are hex 0D and 0A....

See attributes for class CL_ABAP_CHAR_UTILITIES. In your abap code you need to utilize:

CL_ABAP_CHAR_UTILITIES=>CR_LF.

or turn off unicode switch and insert a definition, like:

data: lv_cr type x value '0D',

lv_lf type x value '0A'.

and compare value in your string to that....

0 Kudos

Dear DaveL,

Thanks a lot.