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: 

Multiline String

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

matt
Active Contributor

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.

6 REPLIES 6

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

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_templat...

0 Kudos

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.

horst_keller
Product and Topic Expert
Product and Topic Expert

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

0 Kudos

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.

matt
Active Contributor

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.

Former Member
0 Kudos

Thanks,

It worked for me

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