Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How you will send mail from one SAP system to other SAP
system?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is a foreign key relationship? Explain this with the help of an example.

1011


What are dml commands in abap?

1202


how can you display data say "your name"in sap script without print program or driver program??

2134


hi my name is amit i have passed BE(CSE) with honours(72%) in 2006 yr. i have completed SAP/ABAP training with good exposer. i need a staffing company which can provide me real time exposer in SAP R/3. so plz help me out and send any information regarding on my mail id or tele. no. 9999784331 thanks

1801


What are the various types of selection screen event?

954


What is the difference between bdc_open_group and bdc_open_dataset. : abap bdc

1100


What is is a match code? : abap data dictionary

1176


what is leave to TRANSACTION?

1434


What are data classes? What are the various data classes available for selection? : abap data dictionary

959


Why is pretty printer user in abap?

1151


How to debug rfc function module?

1207


What does a lock object involve?

1114


Final class

1472


What is the function of a domain?

1152


What is the difference between a dialog program and a report?

1030