2006 Sep 21 9:31 AM
Hi Experts,
I have a requirement lik this:
When i am trying to read a directory from App.server,
due to system problem or any hardware problem if i am not able to read i need to send a mail to System admin.
The mail should go automatically is not able to connect to app.server.
Is there any FM available for this type of requirement or can any body tell me how can we do this?
Regards
2006 Sep 21 9:36 AM
hi Ravi,
Use SO_NEW_DOCUMENT_SEND_API1 FM if the Open dataset fails i.e,
open dataset ..
if sy-subrc ne 0.
Call Function ' SO_NEW_DOCUMENT_SEND_API1'.
endif.
hi Ravi,
Use SO_NEW_DOCUMENT_SEND_API1 FM if the Open dataset fails i.e,
open dataset ..
if sy-subrc ne 0.
Call Function ' SO_NEW_DOCUMENT_SEND_API1'.
endif.
2006 Sep 21 9:33 AM
Hi,
use this codings.
open dataset p_filename for output.
if sy-subrc ne 0.
use SO_NEW_DOCUMENT_SEND_API1 function module to send mail to your administrator.
endif.
Plz mark useful answers.
Regards
Divakar
2006 Sep 21 9:36 AM
Hi,
You can use this func module also.
MESSAGE_SEND_AS_MAIL
give ur message and receipient add
Plz mark useful answers.
Regards
Divakar
2006 Sep 21 9:35 AM
Check the following code it may help u.
FORM send_mail USING p_y16m_rcp_par STRUCTURE y16m_rcp_par.
Have a subject for the mail
g_s_document_data-obj_name = text-t02.
g_s_document_data-obj_descr = text-t03.
Fill receiver information
g_s_receivers-rec_type = p_y16m_rcp_par-rec_type.
g_s_receivers-rec_id = p_y16m_rcp_par-rec_id.
g_s_receivers-express = 'X'.
APPEND g_s_receivers TO g_t_receivers.
Call function to send mail
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = g_s_document_data
document_type = 'RAW'
PUT_IN_OUTBOX = ' '
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
OBJECT_HEADER =
object_content = g_t_object_content
CONTENTS_HEX =
OBJECT_PARA =
OBJECT_PARB =
receivers = g_t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " SEND_MAIL
Regards
2006 Sep 21 9:36 AM
hi Ravi,
Use SO_NEW_DOCUMENT_SEND_API1 FM if the Open dataset fails i.e,
open dataset ..
if sy-subrc ne 0.
Call Function ' SO_NEW_DOCUMENT_SEND_API1'.
endif.
2006 Sep 21 9:51 AM
2006 Sep 21 9:37 AM
OPEN DATASET v_filepath FOR INPUT IN TEXT MODE
.
IF sy-subrc NE 0.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = wa_document_data
put_in_outbox = 'X'
sender_address = ''
sender_address_type = ''
commit_work = 'X'
IMPORTING
sent_to_all = v_sys_admin
TABLES
packing_list = i_packing_list
contents_bin = i_attach
contents_txt = i_contents_txt
receivers = i_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
endif.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |