How you will send mail from one SAP system to other SAP
system?
Answer / pramod
Please go through the sample code to Send mail
*********
*Data of an object which can be changed
DATA : doc_chng LIKE sodocchgi1.
*SAPoffice: Single List with Column Length 255
DATA : objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
*SAPoffice: Description of Imported Object Components
DATA : objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
*SAPoffice: Structure of the API Recipient List
DATA : reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
FORM errors_send_mail .
* Creation of the document to be sent
doc_chng-obj_name = 'Log report For Historical Balance
Conversation'
.
CONCATENATE 'Log for ' sy-repid INTO doc_chng-obj_descr
SEPARATED BY space.
LOOP AT it_error. "HERE TYPE = 'A' OR TYPE = 'E'.
objtxt = it_error-message.
APPEND objtxt.
CLEAR: objtxt.
ENDLOOP.
LOOP AT it_message.
AT FIRST .
WRITE : / 'List of documents created :'.
SKIP 1.
ENDAT.
WRITE : / it_message-message.
objtxt = it_message-message.
APPEND objtxt.
CLEAR: objtxt.
ENDLOOP.
* Creation of the entry for the compressed document
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = 9.
objpack-doc_type = 'RAW'.
objpack-obj_name = 'DATA'.
objpack-doc_size = 10 * 255.
objpack-obj_langu = 'EN'.
APPEND objpack.
CLEAR objpack.
CLEAR objpack-transf_bin.
objpack-head_start = 0.
objpack-head_num = 0.
objpack-body_start = 10.
objpack-body_num = tab_lines.
objpack-doc_type = 'DAT'.
objpack-obj_name = 'DATA'.
objpack-doc_size = tab_lines * 255.
objpack-obj_langu = 'EN'.
APPEND objpack.
CLEAR objpack.
* Completing the recipient list
* RECLIST-RECEIVER = 'Michael.mccullough@ge.com'.
reclist-receiver = 'Tiffany.Boyle@ge.com'.
reclist-rec_type = 'U'.
APPEND reclist.
CLEAR reclist.
reclist-receiver = 'Kalpana.tyagi2@ge.com'.
reclist-rec_type = 'U'.
APPEND reclist.
CLEAR reclist.
* Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = objpack
contents_txt = objtxt
contents_bin = objbin
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
IF sy-subrc = 0.
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
ENDIF.
Is This Answer Correct ? | 4 Yes | 3 No |
what is the Tcode to send customer master data to another system.
what is the process of dialog program from first to last?
The data of a view is not physically stored, but derived from one or more tables (t/f) : abap data dictionary
What is the typical structure of an ABAP/4 program?
How can an internal table with header line and one without header line be distinguished when passed to a subroutine? : abap modularization
send coding to write a program to create customer quotation using BAPI 'BAPI_QUOTATION_CREATEFROMDATA2/BAPI_QUOTATION_CREATEFR OMDATA'
how many types of idoc'c?
How can we upload a text file having delimiters in to legacy system? : abap bdc
How can we determine a vendor is Bloc/Unblock from the table LFA1?
What are the properties of selection screen?
How many default tab strips are there? How to insert more tabs in it?
What is an interface? In what scenario we use interface? What is the difference between abstract class and interface?