05-08-2017 11:40 AM
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
05-08-2017 3:30 PM
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.
05-08-2017 12:10 PM
Simply use string templates |\n| as linebreaks between the lines in your string?
05-08-2017 2:18 PM
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.
05-08-2017 2:23 PM
What exactly are you trying? How do you pass the string?
05-08-2017 3:03 PM
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.
05-08-2017 3:30 PM
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.
05-09-2017 6:24 AM
Thanks,
It worked for me
I created Multiline string in javascript itself, after taking inputs from individual variables of ABAP.