2008 Jul 18 9:08 AM
hi
sap translates \n\r to ## ? Why ?
What is the reason for this wrong interpretation ?
Regards
sas
2008 Jul 18 1:47 PM
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
2008 Jul 18 9:14 AM
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
2008 Jul 18 9:21 AM
ok but why can't SAP recognize \n\r as linefeed ?
What would u recommend instead?
Thanks
sas
2008 Jul 18 9:50 AM
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
2008 Jul 18 9:22 AM
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
2008 Jul 18 9:59 AM
I am trying to achieve the correctly interpreation of
my original intension: -> make a line feed
instead of displaying ## .
Regards
sas
2008 Jul 18 11:00 AM
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
2008 Jul 18 11:14 AM
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
2008 Jul 18 1:25 PM
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?
2008 Jul 18 1:34 PM
2008 Jul 18 1:35 PM
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
2008 Jul 18 2:09 PM
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
2008 Jul 18 1:47 PM
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
2008 Jul 18 1:59 PM
> 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
2008 Jul 18 2:02 PM
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
2008 Jul 18 2:03 PM
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.
2008 Jul 18 2:10 PM
for unsupported characters, just use
CL_ABAP_CHAR_UTILITIES=>CR_LF or
CL_ABAP_CHAR_UTILITIES=>NEWLINE
regards.
2008 Jul 18 2:15 PM
2008 Jul 19 1:53 PM