Smartform as email to external mail id
Hi all
I have to send a smartform as an email to an external e-mail id. This has to be achieved through Action profile. I have created a Z-class by copying the class CL_DOC_PROCESSING_CRM_ORDER. I have attached my smartform name also to the action.
What code do I have to write to pass the external mail id??
Plz help.
Points will be rewarded generously for useful answers.
Thanks and regards
Debolina
Debolina,
You can use the function module to create the recipient address. You then need to pass the recipient entry to the mail_recipient parameter of the smartform.
lv_mailaddr is the e-mail or distribution list name
lv_type_id is either 'C' - shared distribution list or 'U' -external e-mail address
ls_recip_id is a single receipient or et_receipient is a table(say from a distribution list)
CALL FUNCTION 'CREATE_RECIPIENT_OBJ_PPF'
EXPORTING
IP_MAILADDR = lv_mailaddr
IP_TYPE_ID = lv_type_id
IMPORTING
EP_RECIPIENT_ID = ls_recip_id
ET_RECIPIENT = et_receipient
EXCEPTIONS
INVALID_RECIPIENT = 1
OTHERS = 2.
Take care,
Stephen
Similar Messages
-
SAPConnect to Send Emails to external mail address
I am trying to send email from SAP to an external email address.
I've configured in SCOT the mail server and it respective port.
When I tried to send a test message, the message failed in the queue with the log:
"Cannot process message in SAP System - No ESMTP Plug-In Is Available for SAPconnect
Application Server Used by the Send Process:
S21TDI05
(Schedule Send Process on App.Server with Plug-In)
Upon checking the sap documentation, I encounter there's also a SMTP Service in "SMICM" as well. Inside there I can see that the SMTP setting is not activate and no values has been entered.
Are these 2 connected?
Advices are welcome.
Thanks,
Regards,
Wooi Chian.This error message means that your SMTP plug-in is not active. Go to TR: SMICM -> GOTO -> SERVICES
Here you must see that the SMTP plug in is active.
This error usally due to bind error. The port wich had to be used is used by an other service.
Check if below mentioned parameters are set.
rdisp/start_icman = true
icm/server_port_0 = PROT=HTTP,PORT=1080
icm/server_port_1 = PROT=SMTP,PORT=25$$, TIMEOUT=60, PROCTIMEOUT=300
icm/server_port_2 = HTTPS,PORT=82$$, TIMEOUT=60, PROCTIMEOUT=300
and restart ICM . You should see SMTP service on SMICM transaction.
In my case problem was with the below parameters. PORT=HTTPS was assigned to server_port_1. I swapped the values of both the parameters icm/server_port_1 and icm/server_port_3. Only after that SMTP service started being visible under DISPLAY --> Services.
icm/server_port_0 PROT=HTTP,PORT=80$$, TIMEOUT=60, PROCTIMEOUT=300
icm/server_port_1 PROT=HTTPS,PORT=82$$, TIMEOUT=60, PROCTIMEOUT=300
icm/server_port_3 PROT=SMTP,PORT=25$$, TIMEOUT=60, PROCTIMEOUT=300
Hope this helps solve the issue.
/Ravi -
Error while sending email to external mail - Urgent
Hi All,
I am getting error while sending email with attachement. The Error code is 02.
I am not able to identify the error. bold Please help me in solving this problem.
Is it anything wrong with the code or Any Configuration with SCOT/SOST.bold
the code i am using is :
REPORT YVR_F MESSAGE-ID XX .
TABLES : EDIDC, EDIDS, EDPAR.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
PARAMETERS : P_STATUS LIKE EDIDC-STATUS DEFAULT '51'.
SELECT-OPTIONS : S_DIRECT FOR EDIDC-DIRECT,
S_MESTYP FOR EDIDC-MESTYP,
S_CREDAT FOR EDIDC-CREDAT.
SELECTION-SCREEN END OF BLOCK B1 .
PARAMETER: P_EMAIL LIKE SOMLRECI1-RECEIVER,
P_SENDER LIKE SOMLRECI1-RECEIVER no-display,
P_DELSPL AS CHECKBOX,
P_ONLINE NO-DISPLAY.
DATA : TB_EDIDC LIKE STANDARD TABLE OF EDIDC INITIAL SIZE 0 WITH HEADER
LINE.
DATA : TB_EDPAR LIKE STANDARD TABLE OF EDPAR INITIAL SIZE 0 WITH HEADER
LINE.
DATA : TB_KNA1 LIKE STANDARD TABLE OF KNA1 INITIAL SIZE 0 WITH HEADER
LINE.
DATA : TB_ADRC LIKE STANDARD TABLE OF ADRC INITIAL SIZE 0 WITH HEADER
LINE.
DATA: INT_PDF TYPE TABLE OF TLINE WITH HEADER LINE.
DATA : BEGIN OF TB_ED OCCURS 0,
SNDPRN LIKE EDIDC-SNDPRN,
LOC LIKE ADRC-BUILDING,
DOCNUM LIKE EDIDC-DOCNUM,
IDOCTP LIKE EDIDC-IDOCTP,
MESTYP LIKE EDIDC-MESTYP,
DIRECT LIKE EDIDC-DIRECT,
CREDAT LIKE EDIDC-CREDAT,
STATUS LIKE EDIDC-STATUS,
END OF TB_ED.
DATA: IT_MESSAGE TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: IT_ATTACH TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
WITH HEADER LINE.
Job Runtime Parameters
DATA: GD_EVENTID LIKE TBTCM-EVENTID,
GD_EVENTPARM LIKE TBTCM-EVENTPARM,
GD_EXTERNAL_PROGRAM_ACTIVE LIKE TBTCM-XPGACTIVE,
GD_JOBCOUNT LIKE TBTCM-JOBCOUNT,
GD_JOBNAME LIKE TBTCM-JOBNAME,
GD_STEPCOUNT LIKE TBTCM-STEPCOUNT,
GD_ERROR TYPE SY-SUBRC,
GD_RECIEVER TYPE SY-SUBRC.
DATA: W_RECSIZE TYPE I,
W_SPOOL_NR LIKE SY-SPONO.
%_print LIKE pri_params.
DATA: GD_SUBJECT LIKE SODOCCHGI1-OBJ_DESCR,
IT_MESS_BOD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
IT_MESS_ATT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
GD_SENDER_TYPE LIKE SOEXTRECI1-ADR_TYP,
GD_ATTACHMENT_DESC TYPE SO_OBJ_NAM,
GD_ATTACHMENT_NAME TYPE SO_OBJ_DES.
Spool to PDF conversions
DATA: GD_SPOOL_NR LIKE TSP01-RQIDENT,
GD_DESTINATION LIKE RLGRAP-FILENAME,
GD_BYTECOUNT LIKE TST01-DSIZE,
GD_BUFFER TYPE STRING.
Binary store for PDF
DATA: BEGIN OF IT_PDF_OUTPUT OCCURS 0.
INCLUDE STRUCTURE TLINE.
DATA: END OF IT_PDF_OUTPUT.
DATA: GD_RECSIZE TYPE I.
CONSTANTS: C_DEV LIKE SY-SYSID VALUE 'DEV',
C_NO(1) TYPE C VALUE ' ',
C_DEVICE(4) TYPE C VALUE 'LOCL'.
DATA: T_PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
T_CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
T_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
W_CNT TYPE I,
W_SENT_ALL(1) TYPE C,
W_DOC_DATA LIKE SODOCCHGI1.
DATA : MSTR_PRINT_PARMS LIKE PRI_PARAMS,
MC_VALID,
P_REPID LIKE SY-REPID,
WF_ID LIKE TSP01-RQIDENT,
LOC_BYTECOUNT TYPE I.
*start-of-selection.
MSTR_PRINT_PARMS-PDEST = 'LOCL'.
P_REPID = SY-REPID.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
authority= ' '
COPIES = '1'
COVER_PAGE = SPACE
DATA_SET = SPACE
DEPARTMENT = SPACE
DESTINATION = 'LP01'
EXPIRATION = '1'
IMMEDIATELY = 'X'
LAYOUT = 'X_65_132'
MODE = SPACE
NEW_LIST_ID = 'X'
NO_DIALOG = 'X'
USER = SY-UNAME
IMPORTING
OUT_PARAMETERS = MSTR_PRINT_PARMS
VALID = MC_VALID
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
SUBMIT (P_REPID) TO SAP-SPOOL WITHOUT SPOOL DYNPRO
SPOOL PARAMETERS MSTR_PRINT_PARMS.
AND RETURN.
NEW-PAGE PRINT ON NO DIALOG PARAMETERS
MSTR_PRINT_PARMS.
perform data.
NEW-PAGE PRINT OFF. "This marks the end of the screen for which the
*SPOOL NO WAS GENERATED.
WF_ID = SY-SPONO.
*converting spool to pdf
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = WF_ID "SPOOL NUMBER
NO_DIALOG = SPACE
PDF_DESTINATION = 'X'
IMPORTING
PDF_BYTECOUNT =
LOC_BYTECOUNT "NUMBER OF BYTES TRANSFERRED
TABLES
PDF = INT_PDF "TABLE FOR PDF REPORT
EXCEPTIONS
ERR_NO_ABAP_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DESTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11
OTHERS = 12.
*CALL FUNCTION 'DOWNLOAD'
*EXPORTING
*bin_filesize = loc_bytecount "NO. OF BYTES
*filename = 'C:/EMAILPDF.PDF'
*filetype = 'BIN'
**IMPORTING
**act_filename = loc_filename
*TABLES
*data_tab = int_pdf.
IF P_DELSPL EQ 'X'.
PERFORM DELETE_SPOOL.
ENDIF.
Transfer the 132-long strings to 255-long strings
LOOP AT INT_PDF.
TRANSLATE INT_PDF USING ' ~'.
CONCATENATE GD_BUFFER INT_PDF INTO GD_BUFFER.
ENDLOOP.
TRANSLATE GD_BUFFER USING '~ '.
DO.
IT_MESS_ATT = GD_BUFFER.
APPEND IT_MESS_ATT.
SHIFT GD_BUFFER LEFT BY 255 PLACES.
IF GD_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
DESCRIBE TABLE IT_MESS_ATT LINES GD_RECSIZE.
CHECK GD_RECSIZE > 0.
PERFORM SENDMAIL USING P_EMAIL..
*& Form sendmail
text
--> p1 text
<-- p2 text
FORM SENDMAIL USING P_EMAIL.
CHECK NOT ( P_EMAIL IS INITIAL ).
REFRESH IT_MESS_BOD.
Default subject matter
GD_SUBJECT = 'Subject'.
GD_ATTACHMENT_DESC = 'IDOC LIST'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
IT_MESS_BOD = 'List Of Failed Idocs'.
APPEND IT_MESS_BOD.
IT_MESS_BOD = 'List Of Failed Idocs'.
APPEND IT_MESS_BOD.
If no sender specified - default blank
IF P_SENDER EQ SPACE.
GD_SENDER_TYPE = SPACE.
ELSE.
GD_SENDER_TYPE = 'INT'.
ENDIF.
Send file by email as .xls speadsheet
PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
TABLES IT_MESS_BOD
IT_MESS_ATT
USING P_EMAIL
'Document attachment'
'PDF'
GD_ATTACHMENT_NAME
GD_ATTACHMENT_DESC
P_SENDER
GD_SENDER_TYPE
CHANGING GD_ERROR
GD_RECIEVER.
ENDFORM. " sendmail
*& Form DELETE_SPOOL
text
--> p1 text
<-- p2 text
FORM DELETE_SPOOL.
DATA: LD_SPOOL_NR TYPE TSP01_SP0R-RQID_CHAR.
LD_SPOOL_NR = WF_ID. "GD_SPOOL_NR.
CHECK P_DELSPL <> C_NO.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
SPOOLID = LD_SPOOL_NR.
ENDFORM. " DELETE_SPOOL
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
text
-->P_IT_MESS_BOD text
-->P_IT_MESS_ATT text
-->P_P_EMAIL text
-->P_0846 text
-->P_0847 text
-->P_GD_ATTACHMENT_NAME text
-->P_GD_ATTACHMENT_DESC text
-->P_P_SENDER text
-->P_GD_SENDER_TYPE text
<--P_GD_ERROR text
<--P_GD_RECIEVER text
FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES IT_MESSAGE
IT_ATTACH
USING P_EMAIL
P_MTITLE
P_FORMAT
P_FILENAME
P_ATTDESCRIPTION
P_SENDER_ADDRESS
P_SENDER_ADDRES_TYPE
CHANGING P_ERROR
P_RECIEVER.
DATA: LD_ERROR TYPE SY-SUBRC,
LD_RECIEVER TYPE SY-SUBRC,
LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,
LD_EMAIL LIKE SOMLRECI1-RECEIVER,
LD_FORMAT TYPE SO_OBJ_TP ,
LD_ATTDESCRIPTION TYPE SO_OBJ_NAM ,
LD_ATTFILENAME TYPE SO_OBJ_DES ,
LD_SENDER_ADDRESS LIKE SOEXTRECI1-RECEIVER,
LD_SENDER_ADDRESS_TYPE LIKE SOEXTRECI1-ADR_TYP,
LD_RECEIVER LIKE SY-SUBRC.
DATA: T_PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
T_CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
T_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
W_CNT TYPE I,
W_SENT_ALL(1) TYPE C,
W_DOC_DATA LIKE SODOCCHGI1.
LD_EMAIL = P_EMAIL.
LD_MTITLE = P_MTITLE.
LD_FORMAT = P_FORMAT.
LD_ATTDESCRIPTION = P_ATTDESCRIPTION.
LD_ATTFILENAME = P_FILENAME.
LD_SENDER_ADDRESS = P_SENDER.
LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.
Fill the document data.
W_DOC_DATA-DOC_SIZE = 1.
Populate the subject/generic message attributes
W_DOC_DATA-OBJ_LANGU = SY-LANGU.
W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
W_DOC_DATA-OBJ_DESCR = LD_MTITLE .
W_DOC_DATA-SENSITIVTY = 'F'.
Fill the document data and get size of attachment
CLEAR W_DOC_DATA.
READ TABLE IT_ATTACH INDEX W_CNT.
W_DOC_DATA-DOC_SIZE =
( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
W_DOC_DATA-OBJ_LANGU = SY-LANGU.
W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
W_DOC_DATA-OBJ_DESCR = LD_MTITLE.
W_DOC_DATA-SENSITIVTY = 'F'.
CLEAR T_ATTACHMENT.
REFRESH T_ATTACHMENT.
T_ATTACHMENT[] = IT_ATTACH[].
Describe the body of the message
CLEAR T_PACKING_LIST.
REFRESH T_PACKING_LIST.
T_PACKING_LIST-TRANSF_BIN = SPACE.
T_PACKING_LIST-HEAD_START = 1.
T_PACKING_LIST-HEAD_NUM = 0.
T_PACKING_LIST-BODY_START = 1.
DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
T_PACKING_LIST-DOC_TYPE = 'RAW'.
APPEND T_PACKING_LIST.
Create attachment notification
T_PACKING_LIST-TRANSF_BIN = 'X'.
T_PACKING_LIST-HEAD_START = 1.
T_PACKING_LIST-HEAD_NUM = 1.
T_PACKING_LIST-BODY_START = 1.
DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
T_PACKING_LIST-DOC_TYPE = LD_FORMAT.
T_PACKING_LIST-OBJ_DESCR = LD_ATTDESCRIPTION.
T_PACKING_LIST-OBJ_NAME = LD_ATTFILENAME.
T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
APPEND T_PACKING_LIST.
Add the recipients email address
CLEAR T_RECEIVERS.
REFRESH T_RECEIVERS.
T_RECEIVERS-RECEIVER = p_EMAIL.
T_RECEIVERS-REC_TYPE = 'U'.
T_RECEIVERS-COM_TYPE = 'INT'.
T_RECEIVERS-NOTIF_DEL = 'X'.
T_RECEIVERS-NOTIF_NDEL = 'X'.
APPEND T_RECEIVERS.
DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
W_SENT_ALL = 'X'.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = W_DOC_DATA
PUT_IN_OUTBOX = 'X'
SENDER_ADDRESS = LD_SENDER_ADDRESS
SENDER_ADDRESS_TYPE = LD_SENDER_ADDRESS_TYPE
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL = W_SENT_ALL
TABLES
PACKING_LIST = T_PACKING_LIST
object_header = objhead
CONTENTS_BIN = T_ATTACHMENT
CONTENTS_TXT = IT_MESSAGE
RECEIVERS = T_RECEIVERS
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH 'Error occurred while sending'.
ELSE.
MESSAGE I000 WITH 'The document was sent'.
ENDIF.
ENDFORM. " SEND_FILE_AS_EMAIL_ATTACHMENT
*& Form data
text
--> p1 text
<-- p2 text
FORM data.
SELECT SNDPRN
DOCNUM
IDOCTP
MESTYP
DIRECT
CREDAT
STATUS
FROM EDIDC
INTO CORRESPONDING FIELDS
OF TABLE TB_EDIDC
WHERE STATUS = P_STATUS
AND MESTYP IN S_MESTYP
AND DIRECT IN S_DIRECT
AND CREDAT IN S_CREDAT.
SELECT KUNNR
INPNR
FROM EDPAR
INTO CORRESPONDING FIELDS
OF TABLE TB_EDPAR
FOR ALL ENTRIES IN TB_EDIDC
WHERE KUNNR = TB_EDIDC-SNDPRN.
SELECT KUNNR
ADRNR
FROM KNA1
INTO CORRESPONDING FIELDS
OF TABLE TB_KNA1
FOR ALL ENTRIES IN TB_EDPAR
WHERE KUNNR = TB_EDPAR-INPNR.
SELECT ADDRNUMBER
BUILDING
FROM ADRC
INTO CORRESPONDING FIELDS
OF TABLE TB_ADRC
FOR ALL ENTRIES IN TB_KNA1
WHERE ADDRNUMBER = TB_KNA1-ADRNR.
LOOP AT TB_EDIDC WHERE STATUS = P_STATUS
AND MESTYP IN S_MESTYP
AND DIRECT IN S_DIRECT
AND CREDAT IN S_CREDAT.
TB_ED-SNDPRN = TB_EDIDC-SNDPRN.
TB_ED-DOCNUM = TB_EDIDC-DOCNUM.
TB_ED-IDOCTP = TB_EDIDC-IDOCTP.
TB_ED-MESTYP = TB_EDIDC-MESTYP.
TB_ED-DIRECT = TB_EDIDC-DIRECT.
TB_ED-CREDAT = TB_EDIDC-CREDAT.
TB_ED-STATUS = TB_EDIDC-STATUS.
READ TABLE TB_EDPAR WITH KEY KUNNR = TB_EDIDC-SNDPRN.
READ TABLE TB_KNA1 WITH KEY KUNNR = TB_EDPAR-INPNR.
READ TABLE TB_ADRC WITH KEY ADDRNUMBER = TB_KNA1-ADRNR.
TB_ED-LOC = TB_ADRC-BUILDING.
APPEND TB_ED.
ENDLOOP.
WRITE :/02 'CustomerNo',
15 'Location Code',
30 'Idoc Number',
55 'Basic Type',
70 'Message Type',
95 'Direction',
110 'Received Date',
130 'Status'.
ULINE.
LOOP AT TB_ED.
WRITE :/02 TB_ED-SNDPRN,
15 TB_ED-LOC,
30 TB_ED-DOCNUM,
55 TB_ED-IDOCTP,
70 TB_ED-MESTYP,
95 TB_ED-DIRECT,
110 TB_ED-CREDAT,
130 TB_ED-STATUS.
ENDLOOP.
ENDFORM. " data
Kindly help me in solving the issue.
Thanks in advance.
Suki.Hi,
Check in transaction SCOT. If your mail is in error status in SCOT, you can assure that there is no problem with your code. If your message has not reached till SCOT, then the problem will be with the code.
If the mail is there in scot with error status tell the BASIS to configure it. I feel this could be the problem.
Regards,
Renjith Michael. -
If anybody aware of sending smartform thru email then pls mail me a sample document. I have a code which is generating mail request but finally i am not receiving the mail at the given id. Please help.
Sutapa Sengupta
[email protected]Thanks a lot for the quick response. I have tried this code. My mail request is getting created successfully but i cannot see any mail waiting in SCOT neither can i see it SO01 - outbox . In this code in the third subroutine the object is not getting created. Please throw some light.
Thanks again. -
Can't send smartform to external mail address
Hi, everyone.
Now, after creating some self-defined smartforms, we want to send its
PDF copy to
our external mail address. From this point, I had some try.
Reference to SAP Library, I make a testing program named 'YPDF_TEST'.
However, one exception always exists when running and error message id
is 'XS806' - means
"No delivery to &, invalid recipient address"
I filled the address with following fields.
[ dev_mail_recipient-logsys = 'CLNT600'.
dev_mail_recipient-objtype = 'RECIPIENT'.
dev_mail_recipient-objkey = '[email protected]'. ]
I just can't understand the real reason why it doesn't work.
Through debugging, I found the error occurs when handling the following
codes
in function "SX_ADDRESS_TO_DEVTYPE".
[ swc_create_object o_recipient 'RECIPIENT' recipient_id-objkey.
swc_get_property o_recipient 'CommunicationType' m_recipient-type.
get_property_longvalue o_recipient m_recipient-address. ]
On the current situation, if can't come over this problem,
we may not build the connection and don't provide information in time.
Failed to send, I yet try another function - added the tail but on earthdidn't get it ~~~
Would you give me some hints or advice ?
Any help is appreciated.
====================
<i>REPORT ypdf_test .
DATA: fm_name TYPE rs38l_fnam.
DATA: my_control_pars TYPE ssfctrlop. "for CONTROL_PARAMETERS
DATA: my_output_info TYPE ssfcrescl. "for JOB_OUTPUT_INFO
DATA: output_options TYPE ssfcompop.
DATA: e_devtype TYPE rspoptype.
DATA: gw_lcprint TYPE ziebsflc001.
DATA: bin_file TYPE xstring,
bin_filesize TYPE i,
ndiv TYPE i, offset TYPE i,
nmod TYPE i.
DATA: BEGIN OF bin_table OCCURS 0,
x TYPE xstring,
END OF bin_table.
DATA: lines LIKE tline OCCURS 0.
DATA: dev_mail_sender LIKE swotobjid, "B20K061818
dev_mail_recipient LIKE swotobjid.
DATA: dev_mail_applobj_tab LIKE swotobjid OCCURS 10 WITH HEADER LINE.
DATA: param LIKE itcpp.
my_control_pars-no_dialog = 'X'.
my_control_pars-getotf = 'X'.
Get genereated function name of Smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZDEMO_SMART_FORM_PPF'
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
Get Device type
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = sy-langu
I_APPLICATION = 'SAPDEFAULT'
IMPORTING
e_devtype = e_devtype
EXCEPTIONS
no_language = 1
language_not_installed = 2
no_devtype_found = 3
system_error = 4
OTHERS = 5 .
IF sy-subrc <> 0.
ENDIF.
output_options-tdprinter = e_devtype.
set needed mail option
my_control_pars-device = 'MAIL'.
dev_mail_sender-logsys = 'CLNT600'.
dev_mail_sender-objtype = 'RECIPIENT'.
dev_mail_sender-objkey = 'CHI_DEV03'.
dev_mail_recipient-logsys = 'CLNT600'.
dev_mail_recipient-objtype = 'RECIPIENT'.
dev_mail_recipient-objkey = '[email protected]'.
CALL FUNCTION fm_name
EXPORTING
control_parameters = my_control_pars
mail_recipient = dev_mail_recipient
mail_sender = dev_mail_sender
output_options = output_options
ip_carrid = 'ID'
ip_connid = '8290'
ip_fldate = sy-datum
ip_bookid = '12345678'
ip_customid = '09876521'
ip_luggweight = 90
ip_wunit = 'KG'
ip_smoker = 'X'
IMPORTING
job_output_info = my_output_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Another try ***
*DATA: param LIKE itcpp.
*DATA: BEGIN OF off_obj.
INCLUDE STRUCTURE soodk.
*DATA: END OF off_obj,
ok TYPE c,
msgid TYPE symsgid,
msgno TYPE symsgno,
msgv1 TYPE symsgv,
msgv2 TYPE symsgv,
msgv3 TYPE symsgv,
msgv4 TYPE symsgv.
*DATA: dev_mail_applobj_tab LIKE swotobjid OCCURS 10 WITH HEADER LINE.
*CALL FUNCTION 'CONVERT_OTF_AND_MAIL'
EXPORTING
mailoptions = param
mail_sender = dev_mail_sender
mail_recipient = dev_mail_recipient
IMPORTING
office_objid = off_obj
mail_ok = ok
msgno = msgno
msgid = msgid
msgv1 = msgv1
msgv2 = msgv2
msgv3 = msgv3
msgv4 = msgv4
TABLES
mail_application_object_ids = dev_mail_applobj_tab
otf = my_output_info-otfdata.</i>Hi,
You can follow a different approach. Send the output of the Smartform to the spool.
You have a Function Module to read the spool and convert it to PDF . Then there is one more function module to attach the PDF and send it as a mail.
You need to configure SMTP in Tcode : SCOT.
Search the forum with emailpdfattachment
You have umpteen postings available.
Pls reward if useful.
Regards,
Laxman Nayak -
Stop emails going out to external mail domains
Hi All,
DB:11.1.0.7.0
Oracle Apps:12.1.1
O/S: Redhat Linux 64 bits
Is there a way to stop emails going out to external mail domains from Wf Mailer.
Currently we are converting all suppliers with their real email ids. Is there a way to stop emails going out to external mail domains? This issue will arise as soon as someone run the payments and then vendor will automatically start receiving the emails from our test environment.
Thanks for your time!
Regards,This topic has been discussed before - pl use the search feature of the forums
http://forums.oracle.com/forums/search.jspa?threadID=&q=828812.1&objID=c3&dateRange=all&userID=&numResults=15
How To Stop Old Outbound Workflow Notification Email Messages During Clone Activity (Doc ID 828812.1)
HTH
Srini -
Stop emails going out to external mail domains in xdodelivery.cfg file
Hi All,
DB:11.1.0.7.0
Oracle Apps:12.1.1
O/S: Redhat Linux 64 bits
Is there a way to stop emails going out to external mail domains in xdodelivery.cfg file located at $XDO_TOP/resource
Currently we are converting all suppliers with their real email ids. Is there a way to stop emails going out to external mail domains? This issue will arise as soon as someone run the payments and then vendor will automatically start receiving the emails from our test environment.
I think XDO Bursting (Delivery) is using a separate mailer (not the standard Java mailer configuration).
xdodelivery.cfg file contents:
But for XDO bursting, we have setup separate outbound (SMTP) mailer as per requested, which is currently not have “TEST Address” set and not sure there is option to set here.
/erptest/test/apps/apps_st/appl/xdo/12.0.0/resource/xdodelivery.cfg
<?xml version="1.0" encoding="UTF-8" ?>
<config xmlns="http://xmlns.oracle.com/oxp/delivery/config">
<servers>
<server name="xyz.bo.abc.com" type="smtp_email" default="true">
<host>xyz.bo.abc.com</host>
<port>25</port>
</server>
</servers>
<properties>
<property name="ds-temp-dir">/tmp</property>
<property name="ds-buffering">true</property>
<property name="SMTP_CONTENT_TYPE:String">"application/pdf"</property>
</properties>
</config>
Thanks for your time!
Regards,Hi;
Did you check your previous thread, which many user post many notes to stop emails?It doesnt helps?
stop emails going out to external mail domains
Regard
Helios -
Can't receive email from external in mail exchange server 2010
we are facing problems of not receiving email from external parties from the mail exchange server 2010 suddenly.
we can send and received internal emails but not the external, anyone could help to provide solution. we also have our own in-house server 2012.
hoping to get a best solution with thanks.
This topic first appeared in the Spiceworks Communitywe are facing problems of not receiving email from external parties from the mail exchange server 2010 suddenly.
we can send and received internal emails but not the external, anyone could help to provide solution. we also have our own in-house server 2012.
hoping to get a best solution with thanks.
This topic first appeared in the Spiceworks Community -
How to send an email to external user (offline form) from se38
Hi all
how to send an email to external user (offline form) from se38 and upload the same from recipent.
we have sent mail using scripts and smartforms but couldnt do here. It will be helpful if you can give us any sample code
regards
mohammedHi,
Have a look at this thread [Re: Sending PDF forms (created using SFP) as Email Attachment] i explain all the solution with a sample code .
Hope it's help you
regards -
Sending external mail using SO_NEW_DOCUMENT_ATT_SEND_API1
When i use this RFC by appending the internal table receiver with receiver: sapuser name and rec_type B it triggers mail to the sap user login .But when i give external email address for receiver with rec_type 'U' it is not triggering any mail.Can anyone please tell me how to use this RFC in sending external mails??
I went back and you are right "INT" was not the REC_TYPE it was the COM_TYPE.
Sorry for any confusion caused.
However,
I suggest 2 more tests and then I give up and can not think about anything else.
Try:
#1
REC_TYPE = 'X'.
if it does not work.
#2
REC_TYPE = 'R'.
Hope that will do the trick. I was trying a lot when I had to get that working some time ago.
And surely the other colleagues point to something which must be setup as well. Transaction SCOT the SMTP settings.
Furthermore there could be another issue. I remember that I worked at a client who had turned off the send settings on their email server. So SAP finished everything and handed the emails on to a mail server. The mail server had a setting to block any emails from the development environment.
So that might be another cause of your issue. -
I've added a external mail contact for all my mailbox users because all the users have other jobs and other external email addresses. Since these users don't normally log on to my domain to get email, I need to create a distribution list with all their
external email addresses. I've scripted the creation of all the external mail contacts, from the mailbox users and I use AD's Notes field to contain the users external address. When using add-DistributionGroupMember and supplying the external mail
contact email address as the "-Member" param, about half of the time the users mailbox user gets added to the group instead of the external contact. I don't see any arguments to tell add-DistributionGroupMember to use only mail contacts.
1) I don't even know how it's finding the mailbox user because I'm supplying an external email address which is only in the external mail contact.
2) Some members of the group are correctly added as external contacts, some are mailbox users.
3) I only want the external mail contacts in the group
If it helps, here's the line that I use to add members to the group. I've tried mail enabling the mail contacts, no help...
Add-DistributionGroupMember–identity“AltEveryone”–member(get-QADuser$_.Name).Notes
Thanks for any help.You should ask questions like this in the Exchange forum. It is not a scripting question but is a product behavior question.
You cannot add an external contact without first creating the contact first.
¯\_(ツ)_/¯ -
Problem sending emails with Mac Mail 1.3.11
Desperately in need of help. I'm able to receive but not send email using Mac Mail. I keep getting an error message:
"This message could not be delivered and will remain in your Outbox until it can be delivered.
The sender address [email protected] was rejected by the server"
I have already tried the following at the advice of AppleCare reps:-
Have verified & repaired disk utilities & keychains
Have reinstalled the operating system
Have trashed the mail.plist file
Have trashed the outbox.mbox file
Getting quite frustrated now because we have a mac bookpro with identical mail settings and it is able to send and receive mail without any problems.Could it be the version of Mail I'm running ?
I initially thought that the problem related to having switched to a new ISP but the fact that one of the mac's has no problem has led me to be less convinced of that idea.
Any suggestions gratefully accepted.
Many thanksI am having the same problem exactly. I can read e-mail, but get the same error message trying to send it. I can't use .Mac anymore--have to use alternate e-mail for the last month--since some time in October 2006.
I haven't changed anything on my G4, haven't upgraded anything, and the problem started about the time .Mac reported some customers were unable to use Mail for a couple of days in October.
I see nobody answered your post. Did you ever get your mail to work? I have repaired permissions, but I don't think it has anything to do with that.
Thanks,
iMama
G4 Quicksilver 867Mhz 60GB Mac OS X (10.3.8) Maxtor 120GB internal; LaCie 150GB external HD -
Error while sending mail from SAP to external mail id
Hello Experts,
I am blocked by the below problem.
I am trying to send email from SAP to an external email ID. I have tried using Class approach as well as the function 'SO_DOCUMENT_SEND_API1' for the same.
Everytime i get the following message:
Internal error: CL_SMTP_RESPONSE ESMTP error code is not known. 554 554 <email address> Sender address rejected.
I am not at all able to figure out why this type of error is coming.
The same code is working on the development environment but not on the test system.
Please reply back asap as i am completely blocked due to this.
Thanks/Regards,
HimanshuHello Priyanka,
Actually, I performed the following two steps in order to solve the issue:
- In transaction SICF, the node for SAPConnect must be active. In our system, this node was in inactive state. Hence I activated it.
- Then In transaction SCOT-> Settings menu--> default domain should be 'xyz.com' if the email addresses in your company are maintained with a suffix xyz.com.
But for me the problem didnt get solved here..
The problem that i am facing now is that if in my user profile, I have the email address maintained, then i get an error saying 'Sender address rejected'. However, if i goto transaction SU01 and clear the email id, the mail is successfully sent to outer world.
You can try the above mentioned two steps using SICF and SCOT. If the problem does not get solved then try clearing the mail id in ur user profile.
Hope this helps. If you find an answer to the problem of the mail id getting cleared, then please let me know..
Regards,
Himanshu -
Can't receive from external mail
I has look through the forum but unable to find a solution to my problem, so I hope someone here can help.
I just upgrade one of our server from Tiger 10.4.11 to Leopard Server 10.5.5, now we only can send and receive inside our lan, but only can send, can't receive from outside our lan.
As far as I can tell all our MX, and PTR are fine and we are not in any of the RBL.
I think the problem might have something to do with NAT, but not sure where to check.
Here is the postconf output
xserve:~ root# postconf -n
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:http://127.0.0.1:10024
daemon_directory = /usr/libexec/postfix
debugpeerlevel = 2
enableserveroptions = yes
html_directory = no
inet_interfaces = all
mail_owner = _postfix
mailboxsizelimit = 0
mailbox_transport = cyrus
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mapsrbldomains =
messagesizelimit = 10485760
mydestination = $myhostname,localhost.$mydomain,localhost,douglaspark.school.nz,mail.douglaspar k.school.nz
mydomain = douglaspark.school.nz
mydomain_fallback = localhost
myhostname = mail.douglaspark.school.nz
mynetworks = 127.0.0.0/8,10.0.1.0/24,202.174.163.117
newaliases_path = /usr/bin/newaliases
queue_directory = /private/var/spool/postfix
readme_directory = /usr/share/doc/postfix
sample_directory = /usr/share/doc/postfix/examples
sendmail_path = /usr/sbin/sendmail
setgid_group = _postdrop
smtpdclientrestrictions = permit_mynetworks zen.spamhaus.org permit
smtpdenforcetls = yes
smtpdpw_server_securityoptions = cram-md5,plain,login
smtpdrecipientrestrictions = permitsasl_authenticated,permit_mynetworks,reject_unauthdestination,permit
smtpdsasl_authenable = yes
smtpdtls_certfile = /etc/certificates/mail.douglaspark.school.nz.crt
smtpdtls_keyfile = /etc/certificates/mail.douglaspark.school.nz.key
smtpduse_pwserver = yes
smtpdusetls = yes
unknownlocal_recipient_rejectcode = 550
Here is the Delivery Notification.
This report relates to a message you sent with the following header fields:
Message-id: <1222931212.48e4730c39ea4@www.*.net.nz>
Date: Thu, 02 Oct 2008 20:06:52 +1300 (NZDT)
From: *@paradise.net.nz
To: Sochet Ly <***@douglaspark.school.nz>
Subject: Re: test
Your message cannot be delivered to the following recipients:
Recipient address: ****@douglaspark.school.nz
Reason: Server rejected MAIL FROM address.
Diagnostic code: smtp;530 5.7.0 Must issue a STARTTLS command first
Remote system: dns;mail.douglaspark.school.nz
(TCP|203.97.33.68|59550|202.174.163.117|25)
Reporting-MTA: dns;smtp5.clear.net.nz (tcp-daemon)
Original-recipient: rfc822;*@douglaspark.school.nz
Final-recipient: rfc822;*@douglaspark.school.nz
Action: failed
Status: 5.0.0 (Server rejected MAIL FROM address.)
Remote-MTA: dns;mail.douglaspark.school.nz
(TCP|203.97.33.68|59550|202.174.163.117|25)
Diagnostic-code: smtp;530 5.7.0 Must issue a STARTTLS command first
Thanks in advance.
<edited by host>Hi pterobyte,
I set logging level to information, and then send myself an email inside our lan, send and receive ok, also sent an email to my external email address, then reply from external mail address here is the mail.log
Oct 3 12:18:53 xserve postfix/smtpd[37952]: connect from xserve.douglaspark.school.nz[202.174.163.117]
Oct 3 12:18:54 xserve postfix/smtpd[37952]: 147EC26C229: client=xserve.douglaspark.school.nz[202.174.163.117], sasl_method=CRAM-MD5, sasl_username=sochetly
Oct 3 12:18:54 xserve postfix/cleanup[37958]: 147EC26C229: message-id=<[email protected]>
Oct 3 12:18:54 xserve postfix/qmgr[84]: 147EC26C229: from=<*@douglaspark.school.nz>, size=647, nrcpt=1 (queue active)
Oct 3 12:18:57 xserve postfix/smtpd[37966]: connect from localhost[127.0.0.1]
Oct 3 12:18:57 xserve postfix/smtpd[37966]: 59AD026C246: client=localhost[127.0.0.1]
Oct 3 12:18:57 xserve postfix/cleanup[37958]: 59AD026C246: message-id=<096B6230-9CCE-4451-B018-A509BFAD7DBC@**.school.nz>
Oct 3 12:18:57 xserve postfix/qmgr[84]: 59AD026C246: from=<**@douglaspark.school.nz>, size=1306, nrcpt=1 (queue active)
Oct 3 12:18:57 xserve postfix/smtpd[37966]: disconnect from localhost[127.0.0.1]
Oct 3 12:18:57 xserve postfix/smtp[37959]: 147EC26C229: to=<*@douglaspark.school.nz>, relay=127.0.0.1[127.0.0.1]:10024, delay=3.4, delays=0.09/0.17/0.03/3.1, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 59AD026C246)
Oct 3 12:18:57 xserve postfix/qmgr[84]: 147EC26C229: removed
Oct 3 12:18:57 xserve postfix/pipe[37969]: 59AD026C246: to=<*@douglaspark.school.nz>, relay=cyrus, delay=0.53, delays=0.01/0.07/0/0.45, dsn=2.0.0, status=sent (delivered via cyrus service)
Oct 3 12:18:57 xserve postfix/qmgr[84]: 59AD026C246: removed
Oct 3 12:19:33 xserve postfix/smtpd[37952]: 5DFD426C264: client=xserve.douglaspark.school.nz[202.174.163.117], sasl_method=CRAM-MD5, sasl_username=sochetly
Oct 3 12:19:33 xserve postfix/cleanup[37958]: 5DFD426C264: message-id=<[email protected]>
Oct 3 12:19:33 xserve postfix/qmgr[84]: 5DFD426C264: from=<*@douglaspark.school.nz>, size=618, nrcpt=1 (queue active)
Oct 3 12:19:35 xserve postfix/smtpd[37966]: connect from localhost[127.0.0.1]
Oct 3 12:19:35 xserve postfix/smtpd[37966]: 84FFE26C28B: client=localhost[127.0.0.1]
Oct 3 12:19:35 xserve postfix/cleanup[37958]: 84FFE26C28B: message-id=<[email protected]>
Oct 3 12:19:35 xserve postfix/qmgr[84]: 84FFE26C28B: from=<**@douglaspark.school.nz>, size=1099, nrcpt=1 (queue active)
Oct 3 12:19:35 xserve postfix/smtpd[37966]: disconnect from localhost[127.0.0.1]
Oct 3 12:19:35 xserve postfix/smtp[37959]: 5DFD426C264: to=<*@paradise.net.nz>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.3, delays=0.03/0.01/0.04/2.2, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 84FFE26C28B)
Oct 3 12:19:35 xserve postfix/qmgr[84]: 5DFD426C264: removed
Oct 3 12:19:36 xserve postfix/smtp[38021]: 84FFE26C28B: to=<**@paradise.net.nz>, relay=mx.paradise.net.nz[203.97.33.212]:25, delay=0.86, delays=0.01/0.02/0.58/0.26, dsn=2.0.0, status=sent (250 ok: Message 551665631 accepted)
Oct 3 12:19:36 xserve postfix/qmgr[84]: 84FFE26C28B: removed
Oct 3 12:20:14 xserve postfix/smtpd[38034]: connect from smtp5.clear.net.nz[203.97.33.68]
Oct 3 12:20:17 xserve postfix/smtpd[38034]: disconnect from smtp5.clear.net.nz[203.97.33.68]
I can see it connected from my ISP server, but then in disconnect straight away.
and here is some recent mailaccess.log
ct 3 12:14:04 xserve pop3s[37852]: starttls: TLSv1 with cipher AES128-SHA (128/128 bits new) no authentication
Oct 3 12:14:04 xserve pop3s[37852]: login: [10.0.1.83] supportstaff APOP+TLS User logged in
Oct 3 12:18:27 xserve imaps[37939]: TLS server engine: cannot load CA data
Oct 3 12:18:27 xserve imaps[37939]: starttls: TLSv1 with cipher AES128-SHA (128/128 bits new) no authentication
Oct 3 12:18:29 xserve imaps[37939]: login: xserve.douglaspark.school.nz [202.174.163.117] sochetly CRAM-MD5+TLS User logged in
Oct 3 12:18:29 xserve imaps[37943]: TLS server engine: cannot load CA data
Oct 3 12:18:29 xserve imaps[37943]: starttls: TLSv1 with cipher AES128-SHA (128/128 bits reused) no authentication
Oct 3 12:18:29 xserve imaps[37943]: login: xserve.douglaspark.school.nz [202.174.163.117] sochetly CRAM-MD5+TLS User logged in
Oct 3 12:18:29 xserve imaps[37943]: skiplist: recovered /var/imap/user/s/sochetly.seen (2 records, 2848 bytes) in 0 seconds
Oct 3 12:18:29 xserve imaps[37944]: TLS server engine: cannot load CA data
Oct 3 12:18:29 xserve imaps[37944]: starttls: TLSv1 with cipher AES128-SHA (128/128 bits reused) no authentication
Oct 3 12:18:29 xserve imaps[37944]: login: xserve.douglaspark.school.nz [202.174.163.117] sochetly CRAM-MD5+TLS User logged in
Oct 3 12:18:32 xserve imaps[37939]: starttls: TLSv1 with cipher AES128-SHA (128/128 bits reused) no authentication
Oct 3 12:18:32 xserve imaps[37939]: login: xserve.douglaspark.school.nz [202.174.163.117] sochetly CRAM-MD5+TLS User logged in
Oct 3 12:18:32 xserve imaps[37946]: TLS server engine: cannot load CA data
Oct 3 12:18:32 xserve imaps[37946]: starttls: TLSv1 with cipher AES128-SHA (128/128 bits reused) no authentication
Oct 3 12:18:32 xserve imaps[37946]: login: xserve.douglaspark.school.nz [202.174.163.117] sochetly CRAM-MD5+TLS User logged in
Oct 3 12:18:37 xserve imaps[37946]: Expunged 10 messages from user.sochetly.Sent Messages
Oct 3 12:18:57 xserve lmtpunix[37971]: Delivered: <[email protected]> to mailbox: user.sochetly
Oct 3 12:19:03 xserve imaps[37943]: Expunged 9 messages from user.sochetly
Oct 3 12:19:04 xserve pop3s[37977]: TLS server engine: cannot load CA data
Oct 3 12:19:04 xserve pop3s[37977]: starttls: TLSv1 with cipher AES128-SHA (128/128 bits new) no authentication
Oct 3 12:19:04 xserve pop3s[37977]: login: [10.0.1.83] supportstaff APOP+TLS User logged in
Oct 3 12:24:04 xserve pop3s[38238]: TLS server engine: cannot load CA data
Oct 3 12:24:04 xserve pop3s[38238]: starttls: TLSv1 with cipher AES128-SHA (128/128 bits new) no authentication
Oct 3 12:24:04 xserve pop3s[38238]: login: [10.0.1.83] supportstaff APOP+TLS User logged in
Can you tell me what is this message mean.
TLS server engine: cannot load CA data.
Thanks.
Jet
<edited by host> -
External mail:attachement part....
Hai,
we have developed a workflow for sales order.Once sales order creation & approval done the mail should go to customer(external mail).
The below code(sample code got from internet & modified) is works fine .But do not want to send attachement.We want to remove attachement part from the coding.Ie we want to send only message,not attachement.
Any tips?
Points will be given......Jaheer.
TABLES: VBAK.
PARAMETERS: Email TYPE somlreci1-receiver.
TYPES: BEGIN OF T_VBAK,
VBELN TYPE VBAK-VBELN,
VKORG TYPE VBAK-VKORG,
VTWEG TYPE VBAK-VTWEG,
SPART TYPE VBAK-SPART,
END OF T_VBAK.
DATA: IT_VBAK TYPE STANDARD TABLE OF T_VBAK INITIAL SIZE 0,
WA_VBAK TYPE T_VBAK.
TYPES: BEGIN OF T_CHARVBAK,
VBELN(10) TYPE c,
VKORG(5) TYPE c,
VTWEG(8) TYPE c,
SPART(18) TYPE c,
END OF T_CHARVBAK.
DATA: WA_CHARVBAK TYPE T_CHARVBAK.
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c,
w_doc_data LIKE sodocchgi1,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_xls_data_table.
END-OF-SELECTION.
perform populate_email_message_body.
write: 'Dear customer,'.
write:/20 'your sales document number has been approved:',vbak-vbeln
/40 'Best Regards'.
skip 1.
write:/20 'Name :----
write:/20 'Signature:----
write:/20 'Date :',sy-datum.
PERFORM send_file_as_email_attachment
tables it_message
it_attach
using Email
'CUSTOMER .xls documnet attachment'
'XLS'
'CUSTOMER'
changing gd_error
gd_reciever.
PERFORM initiate_mail_execute_program.
*& Form DATA_RETRIEVAL
Retrieve data from vbeln table and populate itab it_vbak
FORM data_retrieval.
INCLUDE <CNTN01>.
DATA:CONTAINER LIKE SWCONT OCCURS 0 WITH HEADER LINE.
DATA obj_key TYPE swo_typeid. " Object key
SWC_SET_ELEMENT CONTAINER 'AUN' vbak-vbeln.
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
OBJECT_TYPE = 'BUS2096'
OBJECT_KEY = OBJ_KEY
EVENT = 'ASSIGNED'
COMMIT_WORK = 'X'
EVENT_LANGUAGE = SY-LANGU
LANGUAGE = SY-LANGU
USER = SY-UNAME
IFS_XML_CONTAINER =
IMPORTING
RETURN_CODE =
EVENT_ID =
TABLES
INPUT_CONTAINER = CONTAINER
MESSAGE_LINES =
MESSAGE_STRUCT =
IMPORT vbak-vbeln FROM MEMORY ID 'SALESDOCUMENT'.
SELECT SINGLE * FROM VBAK WHERE VBELN = vbak-vbeln.
ENDFORM. " DATA_RETRIEVAL
*& Form BUILD_XLS_DATA_TABLE
Build data table for .xls document
FORM build_xls_data_table.
CONSTANTS: con_cret TYPE c VALUE '0D', "OK for non Unicode
con_tab TYPE c VALUE '09'. "OK for non Unicode
CONCATENATE 'Sales Document' 'Sales Organization' 'Distribution
Channel' 'Division'
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
LOOP AT IT_VBAK INTO WA_CHARVBAK.
CONCATENATE WA_CHARVBAK-VBELN WA_CHARVBAK-VBELN
WA_CHARVBAK-VKORG WA_CHARVBAK-VKORG
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
ENDLOOP.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables pit_message
pit_attach
using sendmail
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
ld_email = sendmail.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
w_doc_data-doc_size = 1.
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = pit_attach[].
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = 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.
ld_error = sy-subrc.
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM. "send_file_as_email_attachment
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
form populate_email_message_body.
REFRESH it_message.
it_message = 'has been approved by CRISTAL'.
CONCATENATE 'Dear Customer,
Your Sales Document' VBAK-VBELN IT_MESSAGE 'Created by:' VBAK-ERNAM
'Sales office:'vbak-vkbur INTO IT_MESSAGE SEPARATED BY ' '.
APPEND it_message.
endform. " POPULATE_EMAIL_MESSAGE_BODYHi,
Try this code. It is working fine for me,
REPORT ZMAIL.
data : document_data like SODOCCHGI1.
data : receivers like SOMLRECI1 OCCURS 0 WITH HEADER LINE,
object_content like SOLISTI1 OCCURS 0 WITH HEADER LINE.
subject line
document_data-obj_descr = 'My subject Line'.
Mail Content
object_content-line = 'My Content 1'.
APPEND object_content.
object_content-line = 'My Content 2'.
APPEND object_content.
Receiver type and ids
receivers-receiver = '[email protected]'.
receivers-REC_TYPE = 'U'. "Email message
APPEND receivers.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = document_data
DOCUMENT_TYPE = 'RAW'
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL = SENT_TO_ALL
NEW_OBJECT_ID = NEW_OBJECT_ID
TABLES
OBJECT_HEADER = OBJECT_HEADER
OBJECT_CONTENT = OBJECT_CONTENT
CONTENTS_HEX = CONTENTS_HEX
OBJECT_PARA = OBJECT_PARA
OBJECT_PARB = OBJECT_PARB
receivers = 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.
U need to change the receiver type based on the type of mail that u send.
Thanks,
Prasath N
Maybe you are looking for
-
How can I speed up this VI? It only checks 6 channels, but updates only 20/sec
I am measuring 6 channels of current in this VI. It will only update about 20 times per second. The VI is quite simple. It measures current on 6 channels, performs a running average using shift registers, and performs some math on the current to conv
-
Explanations on Sales Documents
Can anybody send explanations about sales documents that I have mentioned below? Inquiry IN Quotation QT Free-of-charge delivery FD Standard sales order OR Cash sale BV Rush order SO Quantity contract CQ Maintenance contra
-
Apple TV, monitor use and lag time with mouse and keyboard
I purchased an Apple TV so that I could use one monitor to switch between my Mac Mini and my MacbookPro. The monitor is hardwired to the Mini, but the MacbookPro uses airplay. My wireless mouse and keyboard lag with this setup. Is there a way to fix
-
How to start gcalctool in solaris in scientific mode by default
Hi Alll, How can I start the gcalctool in the scientific mode by defualt. Currenlty its getting started in Basic mode. I checked the man page for gcalctol but could not get much information from that Thanks in advance Bye Pradeep
-
Can I network in this fashion? router -> powerbook(ethernet)->airport express(sharing)-> ibook(ethernet) I have only two computers and I am trying to avoid buying a discontinued overpricd airport card Any help would be great