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: 

standard transaction

Former Member
0 Kudos

Hello Experts

For the below problem which is still not solved

yet I was adviced to proceed as follows.

1. Accepting the limitation, it is only cosmetic.

2. Modify the standard transaction

3. Strip out the carriage return/line feeds.

Imagine the customer accepts the modifying of the transaction

cbih82. In that case what has to be adapted or improved

to not having this problem.

In order to understand my problem

please call transaction cbih82, press F8,

'Start search anyway?' click yes,

'Do you really want to continue?' click also yes, at the hit list

chooce any incident and hit the button 'Safety Measures'. And now

you will see a field named 'Description' at the below part

of the gui.

Exactly this field is going to be filled through WebDynpro

via adaptive RFC.

A TextEdit element is used in order to insert a text which will passed

to the sap system (at the backend) later .

Java adds automatically \r\n as as usual when the user

makes a new line while inserting text in this text edit area.

This is so far OK.

e.g you insert a text like

sap 'line feed'

is 'line feed'

great 'line feed'

Java makes internally:

"Ltxt"= "sap\r\nis\r\ngreat\r\n"

But on the SAP side I get this text displayed like:

sap##is##great (inside a field named 'Description' ).

To sum up this mentioned field 'Description'

can be edited on the SAP side within the

transcation (cbih83). When you click on the

icon 'Display note' an editor will be launched.

It's like a magic, right there the line

feeds are interpreted correctly. I can see

the the text appearing one after another

sperated by new line (line feed).

With other words line feeds are exitisting

inside the editor but otherwise they are

displayed as # if you not launch this

editor. When I remove these # signs

on the other hand there won't be any

line feeds available inside the editor.

The goal is not displaying # but without deleting linefeeds.

On the WebDynpro side is everything well since \n\r is usually bahavour (for java)

when user hits enter button to have line breaks.

Only Sap is not be able to display n\r correctly.

Actionally n\r does not have to be displayed on the SAP side. SAP does it because

n\r cant be translated by SAP, therefore it appears as ##.

On the other hand you can say why not strip out simply ## on the sap side.

This time if you do that you will have nothing as line feeds, hereby you will

delete all line breaks.

Regards

Erdem Sas

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

you need to Replace "\r\n" this with CL_ABAP_CHAR_UTILITIES=>CR_LF in ABAP

How...?

In Java you might be calling some RFC READ_TEXT , So you need to wrap it into another Custom RFC

so pass the text to the Custom RFC, inside custom RFC you Make the above changes as mentioned REPLACE '\r\n' with CL_ABAP_CHAR_UTILITIES=>CR_LF , now call the standard RFC and pass the modified text.

What is the RFC you are using in Java side , is it RFC_SAVE_TEXT

9 REPLIES 9

former_member188685
Active Contributor
0 Kudos

you need to Replace "\r\n" this with CL_ABAP_CHAR_UTILITIES=>CR_LF in ABAP

How...?

In Java you might be calling some RFC READ_TEXT , So you need to wrap it into another Custom RFC

so pass the text to the Custom RFC, inside custom RFC you Make the above changes as mentioned REPLACE '\r\n' with CL_ABAP_CHAR_UTILITIES=>CR_LF , now call the standard RFC and pass the modified text.

What is the RFC you are using in Java side , is it RFC_SAVE_TEXT

Former Member
0 Kudos

Vijay Babu Dudla

thank you very much for your kindly efforts.

If I have understood you correctly so far I must

replace '\r\n' with CL_ABAP_CHAR_UTILITIES=>CR_LF

on the SAP side. Do you think it would solve out this problem ?

I try it to explain it a bit more.

I enter below shown data in the TextArea on the java side.

It is just a TextArea where you can enter many text

seperated wih enter -> \r\n (java side).

Please notice at the end of the line are \r\n included

whether the user hits enter while he is writing.

test
1
2
3
4
5

After I have saved the entered text so I

switch to SAP-System and call the affected GUI

to see wheter my input has taken effect.

At the SAP System there is a simple Text Input

Field with one line where I can see my privous

entered text in it like:

test##1##2##3##4##5

It has inserted ## signs automatically.

At the end of this "Text Input Field" is an icon

whereby you can display this text within an editor

if you click on it.

If you now hit this icon there will be launch an editor

bizarrely you will suddenly see this text without ##

and with correct line feeds.

The goal is not displaying ## within TextInputField

but nevertheless without deleting leinefeeds now .

Where exactly must the operation take effect to

avoid this circumstance ?

Regards

sas

0 Kudos

Convertion automatically happening in your case. But they are appearing on the same line

'##' are nothing but new Line feed which is equivalen to CL_ABAP_CHAR_UTILITIES=>CR_LF .

First tell what RFC you are using to Update the Text.

So that we can hadle while passing the data to RFC itself , i mean from the Java side we manipulate and send the data to RFC.

Regards

Vijay Babu Dudla

Former Member
0 Kudos

Vijay Babu Dudla I dont have access today to the whole

system.

I wont say to you any wrong thing,

Is it possible to say it to you tomorrow ?

I f so will return to you asap.

regards

sas

0 Kudos

Always welcome.

I hope this is for WebDynpro For Java , Assume the RFC is RFC_SAVE_TEXT

TEXT_LINES (is the node) table you pass it to SAP from java inorder to save the text.

TDFORMAT <- format "/ " for new line

TDLINE <---- Text

Here you move the text line by line to this table.

/ test

/ 1

/ 2

/ 3

/ 4

/ 5

Append the data to table if it is difficult to do it from java side.

Alternatvie 2:

The same can be handle in ABAP. using the Custom RFC

test##1##2##3##4##5 <---data from JAVA

in the custom RFC

i will split the data from JAVA

SPLIT TEXT AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE.

now this table will have 6 records

TEST

1

2

3

4

5

now pass this 6 records for update. with TDFORMAT: /

and you will have other parameters like TDOBJECT, TDID, TDNAME ,LANGUAGE also. then now text will be stored in the above required format.

Former Member
0 Kudos

Vijay Babu Dudla thank you very much for your additional

information. I will turn back tomorrow in order to deliver

the required information regarding mentioned points.

rgds

sas

0 Kudos

Hi Vijay,

pls can u tell me how you pass TDFORMAT

since it has the char type length 2 .

But this has the length 3 -> "/ "

TDFORMAT <- format "/ " for new line

regards

sas

0 Kudos

i mean only /

to the TDFORMAT

Former Member
0 Kudos

ok thx.

sas