Skip to Content
-2

Multiline String

May 08, 2017 at 10:40 AM

123

avatar image

Hi All,

I am using a third party software which need multiline input or (multiline String) in a single variable, input be like this:

abc = ABC

xzy = XYZ

MNO =mno

this input shoud be in a single variable, which variable i need to pass in third party software from SAP ABAP code.

I tried many things but the value finaly is going as a single line string like : 'abc=ABCxyz=XYZMNO=mno' which third party software not accepting.

Is there any possible solution or way to achive this.

Thanks

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Matthew Billingham
May 08, 2017 at 02:30 PM
1

You are using a very old version of ABAP, since it doesn't recognise | as a string delimiter. What you should have done was applied the technique to your code, rather than just blindly using the example ABAP, which is explicitly set up as a demo. You don't need CL_DEMO_OUTPUT on your system.

But that's all by the by. I suspect this isn't an ABAP question. You're passing a string to a javascript parser. Therefore you should create your string in a format that javascript recognises as multiline. And you can get that by searching in a search engine for keywords multiline strings javascript.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks,

It worked for me

I created Multiline string in javascript itself, after taking inputs from individual variables of ABAP.

0
Horst Keller
May 08, 2017 at 11:10 AM
0

Simply use string templates |\n| as linebreaks between the lines in your string?

https://help.sap.com/http.svc/rc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abenstring_templates_separators.htm

Show 3 Share
10 |10000 characters needed characters left characters exceeded

When I am trying it is giving error type cl_abap_codepage is unknown, which is I think because of SAP version.

Can you explain it with example?

Thank you very much for your responce.

0

What exactly are you trying? How do you pass the string?

1

Actually I have to pass multiline string in a Javascrip through a variable suppose variable is 'data' like this

data = 'abc = ABC'    
       & 'xzy = XYZ'
& 'MNO =mno'. *------------------------------------------------------------------------------------------------- * which i am expecting will be passed in java script function(call myfunct(String data) like this. *------------------------------------------------------------------------------------------------- ABC = abc XYZ = xyz MNO = mno *----------------------------------------------------------------------- *but it is passing like this *----------------------------------------------------------------------- ABC = abcXYZ = xyzMNO = mno
==============================
javascript function
============================== 
call myfunct(String data){
//function definition
} 

before actually doing above things.

I tryied this

1.

Unable to find Method CONVERT_TO for class CL_ABAP_CODEPAGE

and this:

2.

cp1.png (5.5 kB)
cp2.png (20.6 kB)
0