Skip to Content
0
Apr 01, 2014 at 06:28 AM

New line problem in sending sms through SAP

125 Views

Hi all,

I need to send sms through sap. I have a code working fine.

constants: c_tab type c value cl_abap_char_utilities=>NEWLINE.

concatenate 'Sales INFO-' date3 into line1 separated by space.

move 'Order Input' to line2.

concatenate 'Day: Rs.' day_oamt into line3 separated by space.

concatenate 'MTH: Rs.' month_oamt into line4 separated by space.

concatenate 'YTD: Rs.' yord into line5 separated by space.

move 'Billing' to line6.

concatenate 'Day: Rs.' day_bamt into line7 separated by space.

concatenate 'MTH: Rs.' month_bamt into line8 separated by space.

concatenate 'YTD: Rs.' ybill into line9 separated by space.

concatenate line1 line2 line3 line4 line5 line6 line7 line8 line9 into text separated by C_TAB

concatenate '+91' m_no+len(10) into m_no.

'http://************************************='

M_NO

'&msg='

text

'&************************************************=text'

inTO WF_STRING.

CALL METHOD cl_http_client=>create_by_url

EXPORTING

url = wf_string

IMPORTING

client = http_client

EXCEPTIONS

argument_not_found = 1

plugin_not_active = 2

internal_error = 3

OTHERS = 4.

CALL METHOD http_client->send

EXCEPTIONS

http_communication_failure = 1

http_invalid_state = 2.

CALL METHOD http_client->receive

EXCEPTIONS

http_communication_failure = 1

http_invalid_state = 2

http_processing_failed = 3.

CLEAR result .

result = http_client->response->get_cdata( ).

I am able to send the message but it gets displayed in one line.

SALES INFO- <dd.mm.yyyy> Order Input DAY: Rs.123 MTH: Rs.123 YTD: Rs.123 Billing DAY: Rs.123 MTH: Rs.123 YTD: Rs.123

What I need to do is this.

SALES INFO- <dd.mm.yyyy>

Order Input

DAY: Rs.123

MTH: Rs.123

YTD: Rs.123

Billing

DAY: Rs.123

MTH: Rs.123

YTD: Rs.123