Hi All,
I am having a problem regarding SMS sending in invoice.
I have made a code of it.
the code is proper. But when the invoice is sent to the Customer, the system sends the SMS 3 times in the span of 3 minutes.
There is no loop in this. though it sends 3 times.
Attaching the code.
selection-screen begin of block b1 .
parameters : p_vbeln like vbrk-vbeln obligatory.
selection-screen end of block b1.
clear wf_string .
concatenate 'http://alerts.icisms.in/api/web2sms.php?'
'workingkey=108122a0092jou29900wb&to=9898989898'
'&sender=GSPCRP&message=Stk Trf No: 9131805526 '
'Dated: 18/12 Qty: 35.00 Transporter: XXXXXXX'
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 ws_kunnr.
select kunag from vbrk into ws_kunnr where
vbeln = p_vbeln .
if sy-subrc = 0 .
ws_vbeln = p_vbeln.
else.
message ' Invoice not found ' type 'S'.
endif.
select kunnr adrnr telf2 from kna1
into corresponding fields of table it_kna1
where kunnr = ws_kunnr .
read table it_kna1 index 1.
select single smtp_addr
from adr6
into w_emailid
where addrnumber eq it_kna1-adrnr.
endselect.
if w_emailid is not initial.
perform mail.
else.
message 'E-Mail Address not maintained !!!' type 'S'.
endif.
The sms setting is proper as the basis team told me.