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

wrong interpretation

Former Member
0 Likes
1,982

hi

sap translates \n\r to ## ? Why ?

What is the reason for this wrong interpretation ?

Regards

sas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,924

Stallkamp thank u for the moralizer but it was not really necessary instead of I need a solution

for my problem which is still existing.

On the SAP side there is a input field named DESCRIPTION (type char 132).

It displays # instead off new line ?

I hope you have understood it correctly now

sas

18 REPLIES 18
Read only

matt
Active Contributor
0 Likes
1,924

Any non-displayable character is displayed as #. The value in the field remains unchanged - so if you subsequently write it to a file it will still be, e.g. /n. You can check this in debugger by looking at the hexadecimal value.

matt

Read only

Former Member
0 Likes
1,924

ok but why can't SAP recognize \n\r as linefeed ?

What would u recommend instead?

Thanks

sas

Read only

matt
Active Contributor
0 Likes
1,924

What do mean exactly by "not recognise". If you are writing the file to the screen for example, the reason why SAP doesn't recognise these characters is because that's how the SAP application is written.

I can't recommend what to try instead, because you haven't said what are you trying to achieve!

matt

Read only

Former Member
0 Likes
1,924

hiii

yes non-displayable character is displayed as # only.and it will display as hexadecimal value only and you can check this in new editor.if you will use new editor you can see this # values there.

regards

twinkal

Read only

Former Member
0 Likes
1,924

I am trying to achieve the correctly interpreation of

my original intension: -> make a line feed

instead of displaying ## .

Regards

sas

Read only

matt
Active Contributor
0 Likes
1,924

For goodness sake, if you want help, you have to give more information. Simply repeating, "I want the correct interpretation" is unhelpful. The correct interpretation depends on context. If you'd like to give the context, you might get some useful answers.

Although you see #, what do you get when you look at it through the debugger in hex? The # is only a visual representation of an undisplayable character.

Where are you wanting this line feed? On the screen, in a file going to the presentation server, in a file going to the app server, in a SAPScript, and adobe form, in a smartform, in a webservice, a dynpro? What?

Where are you seeing this ##?

matt

Read only

0 Likes
1,924

billing first of all don't be in hysterics try to stay more

cool.

To your question (you are answering my questions with

questions)

Where are you wanting this line feed? On the screen, in a file going to the presentation server, in a file going to the app server, in a SAPScript, and adobe form, in a smartform, in a webservice, a dynpro? What?

What does it matter. Line feed (line break) is line feed ?

Regards

sas

Read only

matt
Active Contributor
0 Likes
1,924

If you can't be bothered to answer the questions I'm asking, in order to elucidate enough information to give you a helpful answer, then really there's very little point in me putting in any further effort to assist you.

Do you still have the boxes the computer came in?

Read only

0 Likes
1,924

billing thank you very much for your helpful hints ))

Read only

0 Likes
1,924

Hi.

> billing first of all don't be in hysterics try to stay more

> cool.

First of all I would like to say that here in the forums it is quite common to call each other using the first name. Using only the surname can be recognized as impolite here.

> To your question (you are answering my questions with

> questions)

Yes, he is answering with questions. And this is very good! Your orginial posting had not enough information for him to provide a solution. Either he could just not answer or he is asking for more input. Be happy that he is spending his time to solve your problem.

>

Where are you wanting this line feed? On the screen, in a file going to the presentation server, in a file going to the app server, in a SAPScript, and adobe form, in a smartform, in a webservice, a dynpro? What?

>

> What does it matter. Line feed (line break) is line feed ?

If you are sure that it does not matter, then you are free not to answer. But most likely he will not give you an answer then. And you are facing an issue with ABAP, not him...

And to explain it a little bit: Line feed is line feed. Yes. But the represenation of line feeds is different on different systems. And if you want to get a line feed as a result you better chose the represenation your system expects. So if you want to have a line feed while writing to the display using 'WRITE' you may need something different as if you want to create a textfile coded in EBCDIC on a mainframe...

You want an answer, so you need to specify your question as good as possible. If you don't want to interact, then read a book or search the net.

Best regards,

Jan Stallkamp

Read only

0 Likes
1,924

And to explain it a little bit: Line feed is line feed.

Not even that is true as you might easily find out [here|http://en.wikipedia.org/wiki/Newline#Representations] if you don't yet know.

Even the OP, sas, got it wrong because it is \r\n which isn't necessarily \n\r.

sas, how do you expect a one-line text field to display your string containing \r\n?

regards, anton

Read only

Former Member
0 Likes
1,925

Stallkamp thank u for the moralizer but it was not really necessary instead of I need a solution

for my problem which is still existing.

On the SAP side there is a input field named DESCRIPTION (type char 132).

It displays # instead off new line ?

I hope you have understood it correctly now

sas

Read only

0 Likes
1,924

> On the SAP side there is a input field named DESCRIPTION (type char 132).

Is "there" a normal dynpro? Or is it a textedit control?

Markus

Read only

0 Likes
1,924

Hi.

Ok, I understand. You are only interested in a solution not in being part of a community. That's your decision and I accept that. I just wanted to let you know that maybe a community network is not the right place for this attitude. And I hope that you understand that I'm only interested in helping people that are accepting the way a community works.

I will not touch this thread again unless there is a need to lock it.

Best regards,

Jan Stallkamp

Read only

0 Likes
1,924

Hi,

I think I might have understood what was being asked.

I take it that the "Description field" is something that you are trying to fill through a BAPI or something. In that case, I would suggest the following (I take it that since you want to put in line breaks, Description is actually a table). In JCo (I am no ABAP guy but I think the same principle might work here), I do something like the following -

I first take the string and after every 132 characters I add a

System.getProperty("line.separator");

This helps me cut the text in the maximum size that SAP accepts it (132 characters). Then while setting this text, I check if I have a line.separator. If yes, then I simply add a new row to the table.

For e.g -

Table description = tableParamList.getTable("Description");

description.appendRow();

description.setValue(myTextString, "ColumnName");

Now like I said, everytime I encounter a "\n\r" or a line.separator, I just call the

description.appendRow();

description.setValue(myTextString, "ColumnName");

part of the code.

Therefore I dont send "\n\r" directly over, but just add a new row in the Description table and set the text.

Maybe you could use a similar way to avoid seeing the "##". Everytime you encounter a "\n\r" in your text, just remove those characters from the string and add a line in the description table to set the text.

T00th.

Read only

Former Member
0 Likes
1,924

for unsupported characters, just use

CL_ABAP_CHAR_UTILITIES=>CR_LF or

CL_ABAP_CHAR_UTILITIES=>NEWLINE

regards.

Read only

0 Likes
1,924

you are very smart.

Grüße

Hakan