‎2009 Dec 11 9:49 AM
H Experts,
I was trying to call a webservice from ABAP. I got the data as string in the resuklt parameter using the statment
result = http_client->response->get_cdata( ).
Now i need to split it at carriage return in the string . I have used teh statment
SPLIT result AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab .
This is not working , even after this statement my result_tab is having only 1 records which is the full string .
Please suggest what could be wrong.
Many Thanks,
Neeraj
‎2009 Dec 11 9:55 AM
>
> Now i need to split it at carriage return in the string . I have used teh statment
> SPLIT result AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab .
Hello,
You are trying to split at carriage return(CR) but in your code your are trying to split at Carriage Return + Line Feed
Try like this:
DATA:
v_cr TYPE char1.
v_cr = cl_abap_char_utilities=>cr_lf+0(1).
SPLIT result AT v_cr INTO TABLE result_tab
BR,
Suhas
‎2009 Dec 11 9:55 AM
>
> Now i need to split it at carriage return in the string . I have used teh statment
> SPLIT result AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab .
Hello,
You are trying to split at carriage return(CR) but in your code your are trying to split at Carriage Return + Line Feed
Try like this:
DATA:
v_cr TYPE char1.
v_cr = cl_abap_char_utilities=>cr_lf+0(1).
SPLIT result AT v_cr INTO TABLE result_tab
BR,
Suhas
‎2009 Dec 11 10:08 AM
Hi Suhas,
I need the data in this format . The string contains the full data in single line as it is a string. How can i achieve thsi>?
<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns0:FFecureIDAccount_By_UPI_ActiveResponse xmlns:ns0="urn:WB_DATA_RemoteAccessAccounts" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ns0:getListValues>
<ns0:Account_id>12345</ns0:Account_id>
<ns0:Account_Key />
<ns0:Account_Type>FFCURID</ns0:Account_Type>
<ns0:Assigned_To />
<ns0:Billable />
<ns0:Cost_Object_Type />
<ns0:Cost_Object_Value />
</ns0:getListValues>
</ns0:FFecureIDAccount_By_UPI_ActiveResponse>
</soapenv:Body>
</soapenv:Envelope>
‎2009 Dec 11 10:11 AM
Hello Niraj,
I think you got the entire XML parsed as a string & you want to display the XML in this format . Correct ?
What exactly is you req.?
Cheers,
Suhas
‎2009 Dec 11 10:13 AM
Hi,
Then try with new line attribute of the class cl_abap_char_utilities
data: c_new value cl_abap_char_utilities=>newline
Now split at c_new.
Regards,
Swarna Munukoti
‎2009 Dec 11 10:11 AM
Hi Neera,
if it does not split into more than one record, then the string does not contain any cl_abap_char_utilities=>cr_lf. cl_abap_char_utilities=>cr_lf are two characters, a carriage return and a linefeed. This is something almost nobody uses except Bill Gates. Unix uses only a line feed. Try this.
Regards,
Clemens