BOM Creation, Auto Alert thru MAIL
Dear All,
One dept. ( R&D) creates Bill of Material, is there any setting which would trigger auto mail generation & directed to different dept. & users.
Regards
ND
Dear Nitin,
Regarding this you can contact your ABAP consultant to build a logic to trigger the mail once after a new BOM is generated.
May be you can get this on the basis of table count for the table MAST for a specific plant.
Also check this link regarding sending mail to external system for a job,
Re: Settings to be done for sending mail to external system
Regards
Mangalraj.S
Similar Messages
-
Auto-Reaction E-mail is not working:
HI Basis gurus,
I am setting up a fresh configuration with Solution Manager.
Central system is solution manager 4.0.
Auto-Reaction E-mail is not working:
I have set Z_ccms_Onalert_email with the following parameter
Parameter name Parameter value
SENDER userid from client 000
RECIPIENT my company e-mail Id.
RECIPIENT-TYPEID U
for the below MTE:
Properties of DEV\r3dev_DEV_00\...\Background\Aborted
MTE class R3BPServerSpecAbortedJobs
when I check in CCMS Selfmonitoring it shows:
Node name (MTE) DEV\MoniInfra_r3dev_DEV_00\...\DataSupplier\Log
System DEV
Context MoniInfra_r3dev_DEV_00
Object name DataSupplier
Short name Log
Status ACTIVE
Alert text Document <CCMS alerts DEV 20050808 041658> could not be sent
Line-Id in Message Container 0000000243 0001149437 1123489018
VAR 1 CCMS alerts DEV 20050808 041658
VAR 2 CCMS alerts DEV 20050808 041658
VAR 3 CCMS alerts DEV 20050808 041658
VAR 4 CCMS alerts DEV 20050808 041658
I also tried creating seperate MTE and added
Properties of DEV\r3dev_DEV_00\...\R3Abap\Shortdump
MTE class R3AbapShortdumps
With Auto-Reaction Methor has ccms_Onalert_email with the above parameter.
But the e-mails are not triggered.
I checked ccms_selfmonitoring and found below error message:
Node name (MTE) DEV\MoniInfra_r3dev_DEV_00\...\Tooldispatching (short running tasks)\Messages
Context MoniInfra_r3dev_DEV_00 Object name Tooldispatching (short running tasks) Alert text Unable to set runtime status for data collection method (RC = 253), MTE: DEV\r3dev_DEV_00\...\R3Abap\Shortdumps
Line-Id in Message Container 0000000222 0001068279 1122993022
Also send_internet_mail Job is running every 10mins.
Please provide solutions for this.
Thanks in advance
PradeepHi Pradeep,
Can you send e-mail at all from the ssm 4.0 ? Are there any mail hanging in scott ? Are the MTE's reporting at all? May be a stupid one but you say
I have set Z_ccms_Onalert_email with the following parameter
and then
With Auto-Reaction Methor has ccms_Onalert_email with the above parameter.
But the e-mails are not triggered.
Is the no Z_ a typo in the post or is this a typo in you're system ??
Lando -
Modify Standard CCMS Alert E-Mail Text
Hi ALL,
I have configured CCMS Monitoring and its working Perfect.
Alerrt E-Mails are generated, but the Text of these E-Mail is Techno savvy and cryptic.
Is there any way I can Modify/Customize the CCMS Alert E-Mail Text.
ThanksHi,
Auto reaction methods triggered in sattelite systems are sent to client 000 and then through SMTP server to the external mailing address.
In central auto reaction methods we make use of info sent by CCMS agents to trigger an alert in the central Solman system using the custom created central auto reaction method, assigned to a specific MTE class for a satellite system.
this is the new method modified to be able to do the configurations from the central system itself instead of doing the setting in the individual satellite systems, and as it makes use of ccms agents its faster.
the configuration is same almost in both cases, just go through 455140 S-note, and follow the similar steps in solman system.
Please let me know if any problems,
Thanks,
Regards,
Kaustubh. -
Dear All,
Anybody give me the configuration details for "Auto Alert by Email" When backup job completed.
Regards,
SenthilDear Senthil,
In order to achieve this you have to do the following configuarations
SMTP Configuaration to triger the mail - TCode SCOT
CCMS Configuaration also see the SNote - 176492 - Automatic Email if an Alert Occurs
Goto TCode RZ21
-->Click Display Overview
--> Select the Monitoring properties 'CCMS_OnAler_Email'
--> Change Mode
-->Goto Parameter Tab and enter the followong
Parameter Name Parameter Value
SENDER ABC_USER(SAP User ID should exist in 000 Client)
RECIPIENT [email protected]
RECEIPIENT-TYPEID U
--> Goto Release Tab and select Auto Reaction Method
Goto RZ20
-->Expand CCMS Monitor Template
-->Click Node Database
-->Goto Properties
-->Goto Change Mode
-->Give MethodName - Auto Reaction 'CCMS_OnAler_Email'
-->Activate the Maintenance Function.
Cheers
Rayees Palot -
Hello gurus,
I'm trying to configure the CCMS so it will send alerts to mails.
-I've configured the SAPConnect and checked it. A mail from SBWP appeared in my outlook account.
-I've followed the instruction of:
/people/federico.babelis2/blog/2006/05/03/solution-manager-cen-and-alerting-configuration-guide-for-dummies
and configured the central-auto-reaction.
-CSMCENTOOL table is empty, that means that there are no alerts to send ?
Please help me to configure the Central-Auto-Reaction.
kind regards,
Dimitry HaritonovHelo Dimitry,
Found a similar thread.
Re: Configuring the Alert monitoring of Solution Manager 4.0
Hope this is helpful in ur quest.
Br,
Sri
comment from the thread Read :
"Hi Yagel,
the question is, how do you want to be notfied by the alert. Via email? For this, you have to configure your alert monitor (e.g. like described in the mentioned Blog) and configure SAP Connect (and SMTP, see note 455140), so that you are able to send emails from the SAP System to your office-email-adress or so.
I have tested some time ago the autoreaction methods with emailing and after configuring the SAP Connect correctly, it wasn't a big problem.
Best regards,
Kai
Message was edited by: Sri Raghu Kishore Pusapati -
How to add columns (fields) to header section of an alert e-mail?
Hi all,
In a standard out of the box alert template, I want to add custom fields (e.g. Notes, Value p.a.) to the body of an alert e-mail, see photo:
These cannot be any list/library built-in columns like 'Created', 'Created By' etc.
The class responsible for those column in 'Alerttemplate.xml' is:
<![CDATA[ </tr> </table> </td></tr></table> </td> </tr> <tr> <td class="vh" colspan="2">$Resources:Alerts_event_title;</td> <td class="vh">$Resources:Alerts_event_modified;</td> <td class="vh">$Resources:Alerts_event_modifiedby;</td> <td class="vh"> </td> </tr> <tr> <td colspan="5" class="rulerow"> </td> </tr> ]]>
How can I add additional fields to that?Since there was no input from anyone on the forum, I have come up with a following workaround:
I could not add any more columns to the alert e-mail body for edited items so I used a 'Title' column to combine all the columns a wanted to display in the e-mail alert.
These were the 'Prefix' - 'Suffix' 'Product' columns. On 'Edit' and 'New' forms, there is a piece of jquery to combine those 3 columns and store the value in a 'Title' column which is appropriately hidden from the views and forms. There is no 'Quick Edit'
switched on in the list so jquery will always run setting a 'Title' column correctly.
Users can see the relevant information right in their inbox so they won't have to log in to SP remotely to look up this information. -
This is regarding CBMA in single stack SAP PI 7.3.1. I have set up the alert mail using default java mail client.I do receive the alerts via mail. But my requirement is to direct all the alert mails to Business workplace inbox in ECC.
So I need to set up PI to redirect mails to ECC Business workplace user inbox (sbwp). From here rules are set up & routed per distribution list.
Please guide me how I can achieve this requirement.Hi,
yes, it is a little bit different. This is the issue.....
But I am not sure if your links will help:
1) /people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable
is about a different solution. I do not need to count the number of lines of the source message.
And the second variable is about concat line by line from unbound node to unbound node.
My issue is:
Souce:
Message line (0...unbound) ! ! ! ! ! ! ! !
. ResultLine (1..1)
Mapping:
=> ResultLine1
ResultLine2
ResultLine........ => into UDF to an element (1..1) in one mapping operation.
So that all "ResultLine"s are included.
The result is explained in the given link for Mail attachment with UDF.
So I am not sure how to use this thread for my issue.
In the comments of that blog Christoph Gerber writes that the new variable feature can only handle single values.
So it is not suitable for my purposes as I have a list of values here that needs to be moved into the target message field.
2) http://wiki.sdn.sap.com/wiki/display/Java/UsingEditJavaSectioninMessageMapping
shows where to find the button "Java section" which is not available here in 7.1
3) /people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
too is about the nice little button for Java Section that is no longer existing on PI 7.1 screen for mappings.
So my issue is: How to replace the Java section function with global variables in PI 7.1?
Best regards
Dirk -
What is use of Item Category N(non-stock item) in BOM creation
Dear Experts,
What is use of Item Category N(non-stock item) in BOM creation ?
regards
rajakarthikHi,
This item category is used for components which are not kept in stock if they are used in a bill of material (BOM). Non-stock items can be entered in the BOM with or without a master record. To enter a non-stock item without a master record, you must simply enter a descriptive text.
When you use this item category, the system automatically creates a purchase requisition for these components,
Special functions
The following functions are supported for non-stock items
You maintain purchasing data for non-stock items in the bill of material.
In the planning run, the system generates purchase requisitions
instead of dependent requirements for components that are procured directly. When you configure your R/3 System for MRP, you can define whether direct procurement is triggered by the planning run or by production order management.
Product costing processes take valuation data from the BOM item.
The system determines the release strategy on the basis of the price data you enter. The material group is required to produce a purchase requisition.
Pavan -
For this program i could send the smart form thru mail but in the inbox ..
*& Report ZSFOO
REPORT ZSFOO.
*& Report ZSFINV
TABLES : KNA1, " General Data In Customer Master
KNB1, " Customer Master(Company Code)
BSID, " Accounting: Secondary Index for Customers
ZSMARTFORM, " Custom table for Storing Bank Details
zsf_exp_inv, " Structure that stores required fields from all tables used
KNVK. " Customer Master Contact Partner
data : Begin of it_struct occurs 0.
include structure zsf_exp_inv01.
data : End of it_struct.
types : begin of ty_bsid,
kunnr like bsid-kunnr,
WAERS like bsid-WAERS,
XBLNR LIKE BSID-XBLNR,
BUDAT LIKE BSID-BUDAT,
WRBTR LIKE BSID-WRBTR,
BUKRS LIKE BSID-BUKRS,
end of ty_bsid.
types : begin of ty_kna1,
kunnr like kna1-kunnr,
NAME1 LIKE KNA1-NAME1,
STRAS LIKE KNA1-STRAS,
MCOD3 LIKE KNA1-MCOD3,
LAND1 LIKE KNA1-LAND1,
SORTL LIKE KNA1-SORTL,
end of ty_kna1.
types : begin of ty_knb1,
kunnr like knb1-kunnr,
ZTERM LIKE KNB1-ZTERM,
end of ty_knb1.
types : begin of ty_knVK,
kunnr like kNVK-kunnr,
NAME1 LIKE KNVK-NAME1,
end of ty_knVK.
types : begin of ty_ZSMARTFORM,
SNO LIKE ZSMARTFORM-SNO,
CURRENCY LIKE zsmartform-currency,
BANKNAME LIKE zsmartform-bankname,
ADDRESS1 LIKE ZSMARTFORM-ADDRESS1,
ADDRESS2 LIKE ZSMARTFORM-ADDRESS2,
ADDRESS3 LIKE ZSMARTFORM-ADDRESS3,
ADDRESS4 LIKE ZSMARTFORM-ADDRESS4,
ADDRESS5 LIKE ZSMARTFORM-ADDRESS5,
ADDRESS6 LIKE ZSMARTFORM-ADDRESS6,
VALIDFROM LIKE ZSMARTFORM-VALIDFROM,
VALIDTO LIKE ZSMARTFORM-VALIDTO,
end of ty_ZSMARTFORM.
data : it_bsid type table of ty_bsid,
it_kna1 type table of ty_kna1,
it_knb1 type table of ty_knb1,
it_zsmartform type table of ty_zsmartform,
it_knVK type table of ty_kNVK.
data : wa_bsid like line of it_bsid,
wa_kna1 like line of it_kna1,
wa_knb1 like line of it_knb1,
wa_zsmartform like line of it_zsmartform,
wa_knVK like line of it_knVK.
*****************Selection Screen**********************************
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
SELECT-OPTIONS : S_KUNNR FOR KNA1-KUNNR,
S_belnr FOR BSID-belnr,
S_BUKRS FOR BSID-BUKRS,
S_CURR FOR ZSMARTFORM-CURRENCY.
SELECTION-SCREEN END OF BLOCK B1.
DATA : BEGIN OF IT_PARAM OCCURS 0.
INCLUDE STRUCTURE ZPARAMETERS.
DATA : END OF IT_PARAM.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
SKIP 1.
Parameters : OPTION1 AS CHECKBOX,
P_POINF(300) type c,
OPTION2 AS CHECKBOX,
P_DESC(300) TYPE C,
OPTION3 AS CHECKBOX,
P_MONTH(200) TYPE C,
OPTION4 AS CHECKBOX,
P_RATE(100) TYPE C.
SELECTION-SCREEN END OF BLOCK B2.
**********************PARAMETERS***********************************
data : l type i,
Y(300) type c,
j type i,
k type i value 1,
s type i,
m(300) type c,
p type i,
z type i.
data : l1 type i,
Y1(300) type c,
j1 type i,
k1 type i value 1,
s1 type i,
m1(300) type c,
p1 type i,
z1 type i.
data : l2 type i,
Y2(300) type c,
j2 type i,
k2 type i value 1,
s2 type i,
m2(300) type c,
p2 type i,
z2 type i.
data : l3 type i,
Y3(300) type c,
j3 type i,
k3 type i value 1,
s3 type i,
m3(300) type c,
p3 type i,
z3 type i.
IF OPTION1 = 'X'.
concatenate P_POINF ',' into P_POINF.
l = strlen( P_POINF ).
do l times.
Y = P_POINF+j(k).
case Y.
when ','.
m = P_POINF+s(z).
s = j + 1.
z = -1.
p = p + 1.
if p = 1.
IT_PARAM-LINE1 = m.
endif.
if p = 2.
IT_PARAM-LINE2 = m.
endif.
if p = 3.
IT_PARAM-LINE3 = m.
endif.
when '.'.
if p = 4.
IT_PARAM-LINE4 = m.
endif.
endcase.
j = j + 1.
z = z + 1.
enddo.
ENDIF.
IF OPTION2 = 'X'.
concatenate P_DESC ',' into P_DESC.
l1 = strlen( P_DESC ).
do l1 times.
Y1 = P_DESC+j1(k1).
case Y1.
when ','.
m1 = P_DESC+s1(z1).
s1 = j1 + 1.
z1 = -1.
p1 = p1 + 1.
if p1 = 1.
IT_PARAM-LINE5 = m1.
endif.
if p1 = 2.
IT_PARAM-LINE6 = m1.
endif.
if p1 = 3.
IT_PARAM-LINE7 = m1.
endif.
when '.'.
if p1 = 4.
IT_PARAM-LINE8 = m1.
endif.
endcase.
j1 = j1 + 1.
z1 = z1 + 1.
enddo.
ENDIF.
IF OPTION3 = 'X'.
concatenate P_MONTH ',' into P_MONTH.
l2 = strlen( P_MONTH ).
do l2 times.
Y2 = P_MONTH+j2(k2).
case Y2.
when ','.
m2 = P_MONTH+s2(z2).
s2 = j2 + 1.
z2 = -1.
p2 = p2 + 1.
if p2 = 1.
IT_PARAM-LINE9 = m2.
endif.
if p2 = 2.
IT_PARAM-LINE10 = m2.
endif.
if p2 = 3.
IT_PARAM-LINE11 = m2.
endif.
when '.'.
if p2 = 4.
IT_PARAM-LINe12 = m2.
endif.
endcase.
j2 = j2 + 1.
z2 = z2 + 1.
enddo.
ENDIF.
IF OPTION4 = 'X'.
concatenate P_RATE ',' into P_RATE.
l3 = strlen( P_RATE ).
do l3 times.
Y3 = P_RATE+j3(k3).
case Y3.
when ','.
m3 = P_RATE+s3(z3).
s3 = j3 + 1.
z3 = -1.
p3 = p3 + 1.
if p3 = 1.
IT_PARAM-LINE13 = m3.
endif.
if p3 = 2.
IT_PARAM-LINE14 = m3.
endif.
if p3 = 3.
IT_PARAM-LINE15 = m3.
endif.
if p3 = 4.
IT_PARAM-LINe16 = m3.
endif.
endcase.
j3 = j3 + 1.
z3 = z3 + 1.
enddo.
ENDIF.
APPEND IT_PARAM.
select * from kna1 into corresponding fields of table it_kna1 where kunnr in s_kunnr.
select * from knb1 into corresponding fields of table it_knb1 for all entries in it_kna1 where kunnr = it_kna1-kunnr.
select * from bsid into corresponding fields of table it_bsid for all entries in it_kna1 where kunnr = it_kna1-kunnr and belnr in s_belnr and bukrs in s_bukrs..
SELECT * FROM KNVK INTO CORRESPONDING FIELDS OF TABLE IT_KNVK FOR ALL ENTRIES IN IT_KNA1 WHERE KUNNR = IT_KNA1-KUNNR.
select * from zsmartform into corresponding fields of table it_zsmartform .
DATA : AMT LIKE SPELL.
loop at it_bsid into wa_bsid.
read table it_kna1 into wa_kna1 with key kunnr = wa_bsid-kunnr.
read table it_knb1 into wa_knb1 with key kunnr = wa_bsid-kunnr.
read table it_zsmartform into wa_zsmartform with key CURRENCY = wa_bsid-WAERS.
READ TABLE IT_KNVK INTO WA_KNVK WITH KEY KUNNR = WA_BSID-KUNNR.
it_struct-name1 = wa_kna1-name1.
it_struct-stras = wa_kna1-stras.
it_struct-mcod3 = wa_kna1-mcod3.
it_struct-land1 = wa_kna1-land1.
it_struct-sortl = wa_kna1-sortl.
it_struct-zterm = wa_knb1-zterm.
it_struct-xblnr = wa_bsid-xblnr.
it_struct-currency = wa_zsmartform-currency.
it_struct-currency = wa_bsid-waers.
it_struct-budat = wa_bsid-budat.
it_struct-BANKNAME = wa_zsmartform-BANKNAME.
it_struct-ADDRESS1 = wa_zsmartform-ADDRESS1.
it_struct-ADDRESS2 = wa_zsmartform-ADDRESS2.
it_struct-ADDRESS3 = wa_zsmartform-ADDRESS3.
it_struct-ADDRESS4 = wa_zsmartform-ADDRESS4.
it_struct-ADDRESS5 = wa_zsmartform-ADDRESS5.
it_struct-ADDRESS6 = wa_zsmartform-ADDRESS6.
it_struct-CURR = WA_BSID-WRBTR.
IT_STRUCT-NAME = WA_KNVK-NAME1.
IT_STRUCT-AMOUNT = IT_SPELL-AMT.
append it_struct.
endloop.
data : x type i,
x1 type i,
a type string.
loop at it_struct.
x = strlen( it_struct-curr ).
x1 = x - 3.
a = it_struct-curr+0(x1).
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = a
CURRENCY = ' '
FILLER = ' '
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = AMT.
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3
*IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
endloop.
DATA: ws_ucomm LIKE sy-ucomm.
DATA: form_name TYPE rs38l_fnam.
DATA: wa_ctrlop TYPE ssfctrlop,
wa_outopt TYPE ssfcompop.
data : i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: t_otfdata TYPE ssfcrescl,
t_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE,
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
data : wa_objhead TYPE soli_tab,
wa_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
DATA: t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE.
DATA: w_filesize TYPE string.
DATA: w_bin_filesize TYPE i.
wa_ctrlop-getotf = 'X'.
CALL FUNCTION '/1BCDWB/SF00000001'
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_outopt
user_settings = 'X'
IN_WORDS = amt
importing
job_output_info = t_otfdata
TABLES
I_ZSF_EXP_INV = it_struct
I_ZPARAMETERS = it_param.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
t_otf[] = t_otfdata-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = w_bin_filesize
TABLES
otf = t_otf
lines = t_pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
bin_filesize = w_bin_filesize
CODEPAGE = ' '
filename = 'c: est59.PDF'
filetype = 'BIN'
IMPORTING
filelength = w_filesize
TABLES
data_tab = t_pdf_tab
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10
IF sy-subrc <> 0.
*You should include message-id in the report heading
WRITE : sy-subrc.
ELSE.
WRITE : 'File Test.pdf downloaded succesfully'.
ENDIF.
loop at t_pdf_tab.
translate t_pdf_tab using '~'.
concatenate wa_buffer t_pdf_tab into wa_buffer.
endloop.
translate wa_buffer using '~'.
do.
i_record = wa_buffer.
append i_record.
shift wa_buffer left by 255 places.
if wa_buffer is initial.
exit.
endif.
enddo.
Attachment
refresh:
i_reclist,
i_objtxt,
i_objbin,
i_objpack.
clear wa_objhead.
i_objbin[] = i_record[].
Create Message Body
Title and Description
i_objtxt = 'test with pdf-Attachment!'.
append i_objtxt.
describe table i_objtxt lines v_lines_txt.
read table i_objtxt index v_lines_txt.
wa_doc_chng-obj_name = 'smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'smartform'.
wa_doc_chng-sensitivty = 'O'.
wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
clear i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
append i_objpack.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'Smartform'.
CONCATENATE 'Hazard report-' p_load '.pdf' INTO i_objpack-obj_descr.
describe table i_objbin lines v_lines_bin.
read table i_objbin index v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-obj_descr = 'test'.
i_objpack-doc_size = v_lines_bin * 255.
APPEND i_objpack.
Attachment
(pdf-Attachment)
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
Länge des Attachment ermitteln
describe table i_objbin lines v_lines_bin.
read table i_objbin index v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
append i_objpack.
clear i_reclist.
i_reclist-receiver = '[email protected]'.
i_reclist-express = 'X'.
i_reclist-rec_type = 'U'.
append i_reclist.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
COMMIT_WORK = 'X'
put_in_outbox = 'X'
TABLES
packing_list = i_objpack
object_header = wa_objhead
CONTENTS_BIN = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
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.
for this program i could send the smart form thru mail but in the inbox i could not
download it it says needed to be decoded properly.file not starting with pdf....
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = 'Mail sent'(003)
txt1 = 'The report is sent via e-mail.'(004)
txt2 = ' '.
LEAVE PROGRAM.
ENDIF.hi krishna,
u r right. there is no error in sending the mail and the file but the problem is that file created and converted to pdf is not done properly.jst verify whether the file is created properly or not .thats the only problem that can occurs else ur program is absolutely right. -
Running snow leopard on MBP and am not getting an sound alerts for Mail or Calendar; Have checked all setting in sound in the system preferences
Hi..
For Mail, from your Mail menu bar (top of your screen) click Mail > Preferences then select the General tab.
Click the pop up menu to the right of New messages sound to make a selection. -
How to send an attachment thru mail in SAP?
Hi all,
I have an file which has been sent by the customer. The file type may vary each & every week (sometimes XLS, sometimes CSV & sometimes notepad). This file has to be sent to another person thru mail as an attachment.
Is it possible to send thru the fun mod 'SO_SEND_NEW_*'.
If so how to send as attachment. If not thru this fun mod, how to send?
Thanks,
Vijay.I am enclosing the sample code to trigger an email, The logic for this is in comments, check this I am shure yuor problem will be solved.
*& Report ZGBL_SLA_PER
REPORT zgbl_sla_per NO STANDARD PAGE HEADING LINE-COUNT 26(3) MESSAGE-ID
zmsg2.
DECLARATION OF DB TABLES
TABLES: zncrfid, zrule_id.
DECLARATION OF INTERNAL TABLES
DATA: BEGIN OF ncrf OCCURS 0,
zncrf_id(15) TYPE c,
zncrf_l4_name(60) TYPE c,
z9gl_sla_flag(1) TYPE c,
zowners(30) TYPE c,
zowners_value(30) TYPE c,
zdate_changed(8) TYPE n,
ztime_changed(6) TYPE n,
END OF ncrf.
*DATA: NCRF LIKE ZNCRFID OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF it_ruleid OCCURS 0,
zrule_id(10) TYPE c,
zowners(30) TYPE c,
zowners_value(30) TYPE c,
END OF it_ruleid.
*data: wa like ncrf occurs 0 with header line.
DATA: BEGIN OF itab OCCURS 0,
zncrf_id(15) TYPE c,
zncrf_l4_name(60) TYPE c,
z9gl_sla_flag(1) TYPE c,
zowners(30) TYPE c,
zowners_value(30) TYPE c,
zdate_changed(8) TYPE n,
ztime_changed(6) TYPE n,
END OF itab.
data: file(10) type c,
dates type date.
EMAIL DECLARATION
*CONSTANTS: c_subject LIKE sodocchgi1-obj_descr VALUE 'Subject',
*c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
*DATA: g_time TYPE char8,
*g_email(40) TYPE c,
*g_sent_all(1) TYPE c,
*g_doc_data LIKE sodocchgi1,
*g_error TYPE sy-subrc.
*DATA: i_message LIKE solisti1 OCCURS 0 WITH HEADER LINE,
*i_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
*i_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
*DATA: BEGIN OF mailid OCCURS 0,
zemail_id TYPE zrule_id-zemail_id,
END OF mailid.
*data: mailid like zrule_id occurs 0 with header line.
UPLOADING FLAT FILE TO INTERNAL TABLE NCRF
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\VAMSY\file.txt'
filetype = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = ncrf[]
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
IF sy-subrc EQ 0.
Checking internal table ncrf is empty then
*delete records from TABLE ZNCRF_ID ******************************
IF ncrf[] IS INITIAL.
MESSAGE i003(ZMSG2).
ELSE.
DELETE FROM zncrfid.
ENDIF.
*****Values are read from rule table and checking owner and owner_value
*from zrule_id table and inserted into ZNCRFID **************
SELECT * FROM zrule_id INTO CORRESPONDING FIELDS OF TABLE it_ruleid
WHERE zrule_id IN ('OWNER1', 'OWNER2').
append IT_RULEID.
LOOP AT ncrf WHERE z9gl_sla_flag EQ 'Y'.
READ TABLE it_ruleid WITH KEY zowners = ncrf-zowners
zowners_value = ncrf-zowners_value.
IF ncrf-zowners = it_ruleid-zowners AND ncrf-zowners_value =
it_ruleid-zowners_value AND ncrf-z9gl_sla_flag ='Y'.
itab-zncrf_id = ncrf-zncrf_id.
itab-zncrf_l4_name = ncrf-zncrf_l4_name.
itab-z9gl_sla_flag = ncrf-z9gl_sla_flag.
itab-zdate_changed = sy-datum.
itab-ztime_changed = sy-uzeit.
itab-zowners = it_ruleid-zowners.
itab-zowners_value = it_ruleid-zowners_value.
APPEND itab.
ENDIF.
ENDLOOP.
modify database table zncrfid FROM ITAB
LOOP AT itab.
WRITE:/ itab-zncrf_id, itab-zncrf_l4_name, itab-z9gl_sla_flag,
itab-zowners, itab-zowners_value, itab-zdate_changed,
itab-ztime_changed.
zncrfid-zncrf_id = itab-zncrf_id.
zncrfid-zncrf_l4_name = itab-zncrf_l4_name.
zncrfid-z9gl_sla_flag = itab-z9gl_sla_flag.
zncrfid-zowners = itab-zowners.
zncrfid-zowners_value = itab-zowners_value.
zncrfid-zdate_changed = itab-zdate_changed.
zncrfid-ztime_changed = itab-ztime_changed.
INSERT INTO zncrfid VALUES zncrfid.
ENDLOOP.
ENDIF.
ENDIF.
*CALL FUNCTION 'DATE_TO_DAY'
EXPORTING
DATE = sy-datum
IMPORTING
WEEKDAY = file.
**CHECKING FOR THE FIRST MONDAY OF THE MONTH.
dates = sy-datum.
shift dates by 6 places left.
if file CO 'monday' and dates < 7 and dates >= 1.
else.
message e004(zmsg2).
endif.
EMAIL SEND TO OWNERS LIST
**Fill the mail body in i_message.
get email id's from database into internal table et_mailid
Fill the document data.
*g_doc_data-doc_size = 1.
Populate the subject/generic message attributes
*g_doc_data-obj_langu = sy-langu.
*g_doc_data-obj_name = 'SAPRPT'.
*g_doc_data-obj_descr = c_subject .
*g_doc_data-sensitivty = 'F'.
Describe the body of the message
Information about structure of data tables
*CLEAR i_packing_list.
*REFRESH i_packing_list.
*i_packing_list-transf_bin = space.
*i_packing_list-head_start = 1.
*i_packing_list-head_num = 0.
*i_packing_list-body_start = 1.
*DESCRIBE TABLE i_message LINES i_packing_list-body_num.
*i_packing_list-doc_type = 'RAW'.
*APPEND i_packing_list.
Add the recipients email address
*LOOP AT mailid.
*CLEAR i_receivers.
*i_receivers-receiver = mailid-zemail_id.
*i_receivers-rec_type = 'U'.
*i_receivers-com_type = 'INT'.
*i_receivers-notif_del = 'X'.
*i_receivers-notif_ndel = 'X'.
*APPEND i_receivers.
*ENDLOOP.
Call the FM to post the message to SAPMAIL
*CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
*EXPORTING
*document_data = g_doc_data
*put_in_outbox = 'X'
*commit_work = 'X'
*IMPORTING
*sent_to_all = g_sent_all
*TABLES
*packing_list = i_packing_list
*contents_txt = i_message
*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.
Store function module return code
*g_error = sy-subrc.
Get i_receivers return code
*LOOP AT i_receivers.
*ENDLOOP.
**Instructs mail send program for SAPCONNECT to send email(rsconn01)
*WAIT UP TO 2 SECONDS.
*IF g_error EQ 0.
*SUBMIT zgbl_sla_per WITH mode = 'INT'
*WITH output = 'X'
*AND RETURN.
REWARD IF FOUND USEFULL,
Cheers, -
Sending an Alert e-mail on execution of process chain containing ATTACHMENT
Hi Experts,
Need your help on the following,
We have a scenario where system must send an e-mail to the recipients, on the exection of a Process in the Process Chain.
This mail should contain a specific text file from SAP-Directory(AL11) as ATTACHMENT or the content of file should be directly read in to the mail, anything will work.To send an Alert e-mail when the process chain is executed
you need to create a message setting while creating the process chain.
Suppose you want to send a mail after execution of DTP
then just do the following
right click on the DTP process in the chain and you will get a option to create message.
you'll be asked when on what condition you want to send message 1Success 2 error 3always. select as per you r requirement
select that option and a new window will appear
in the new window press Reciepent button and add recipients of the mail as per you requiremnt
press back button and save, then press create message button
here you can enter the text you want to send, other then that message wil send the status and number od records added and transfered , by default.
hope this solves your problem ..:) -
Auto Alerts in Solution Manager!
I am tryting to configure Auto Alerts in Solution Manager 7.0 EHP1. I have configured the system landscape and created the RFC connections to satellite systems.
I want to configure system monitoring in SolMan for Satellite systems with Auto Alerts.
I first configured the system monitoring in SolMan and assigned the processes to be monitored. Then I tried to configure Auto Alerts as following..
1) created the ARM ( Auto Reaction Method in Tx-RZ21) copying the existing one. ex: ccms_onalert_email
2) Assigned the Auto Reaction Method to the MTEs that I want to monitor in satellite system ( in Tx-RZ20)
3) Created the distribution list ( Tx-SO01)
4) Tried to send the message manually from Tx - SO01 and successful
5) I changed the threshold values to check if I get any autoalerts but Failed...:-(
I searched alot for the sap notes but finally confused.....
Please let me know if I am missing anything here...Or gimme your working exprience in steps..
Thanks,
Shai.Srikishan,
Your article is a very helpful one. I did my configuration as it is in your article. But I do not get any auto alerts email notifications.
When I test the CCMS ping In RZ21. I get the below results.
CCMSPING: Test Results
Available Systems - CCMSPING call successful
Failed CCMSPING Calls
SID CCMS_SYSTEM_PING_DEST
Agents that are reporting errors
CCMS_SYSTEM_PING_DEST
And in RZ20 I get the below results:
Node display off
Availability and Performance Overview
Availability
RFC-Destinations
DDS
Availability: DDS
Availability 0 %
CCMSPING/Configuration Error Communication error when attempting to call CCMSPING; see CCMS_SelfMonitoring
For the Connection Data in monitoting and availability systems I did as following: ( ABAP Message server)
System : DDS
Description : Sandbox System
Message Server Host Name : bjrtssap1.ca.shainet.com
IP Service Name ms.sapDDS_DVEBMGS20
Router String
Please let me know if I am missing any configuration here.
Thanks,
Shai -
Separate program to send a smartform converted into pdf, thru mail
Hi Folks,
I had created a smartform and converted it into a PDF format.
Now I want a separate program where in if i submit this program it should sent it throuogh mail.
Note:-<b>I want a separate program not the one where in you design a smartform,convert into pdf and then send thru mail all in one program</b>
Points will be given.
K.Kiran.hi kiran
the program is as follows
The user is provided with
a) file name
b) email address to send mail
and it sends ANY FILE (.xls,.pdf .xyz..)
Instantaneously !
4. Make two things first :
1. Include with the name : ZAMI_INCLFOR_MAIL
2. Report with the name : ZAM_TEMP147 (any name will do)
3. Activate both and execute (2)
4. After providing filename, email adress
5. Code for Include :
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
receivers = reclist
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 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
CODE FOR PROGRAM
5.
REPORT zam_temp147 .
INCLUDE zami_inclfor_mail.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
regards,
navjot
reward if helpfull -
Attachment sent thru mail in PL/SQL code.
Hi.
I have a requirement..
I have to send bunch of an error description thru mail along with attachment says xls.All error should be club in xls and should be sent these attachement thru EMAIL.
Please provide a sample code for the same.
I have a code that mail can be send with the help of oracle supplied package UTL_SMTP.But how can I send the attachement thru mail.
Please provide a sample code.
ThanksHi!
Check this sample code - i don't know whether that satisfy ur requirement or not ------
CREATE OR REPLACE PROCEDURE CALL_SEND_MAIL
(p_sender varchar2,
p_recipients varchar2,
p_subject varchar2,
p_mailbody varchar2,
p_attachment varchar2 ) IS
v_recipients VARCHAR2(1000):=null;
flag number:=0;
fil BFILE;
file_len PLS_INTEGER;
MAX_LINE_WIDTH PLS_INTEGER := 54;
buf RAW(2100);
amt BINARY_INTEGER := 2000;
pos PLS_INTEGER := 1; /* pointer for each piece */
filepos PLS_INTEGER := 1; /* pointer for the file */
v_file_name VARCHAR2(100) ; /* ascii file attachment */
v_file_handle UTL_FILE.FILE_TYPE;
v_directory_name VARCHAR2(100) := '/utlpath';
v_line VARCHAR2(1000);
conn UTL_SMTP.CONNECTION;
mesg VARCHAR2(32767);
mesg_len NUMBER;
crlf VARCHAR2(2) := chr(13) || chr(10);
data RAW(2100);
chunks PLS_INTEGER;
len PLS_INTEGER;
modulo PLS_INTEGER;
pieces PLS_INTEGER;
err_num NUMBER;
err_msg VARCHAR2(100);
v_subject VARCHAR2(200);
v_mailbody varchar2(1000);
CURSOR C1 (p_proc_code varchar2) IS
select mail_id
from mat.mmat_mail
where mail_proc_code=p_proc_code
and mail_active='Y';
BEGIN
v_file_name := p_attachment;
if p_subject is null then
BEGIN
SELECT mail_subject
INTO v_subject
FROM mat.mmat_mail
WHERE mail_proc_code='VENDEXCH'
AND mail_subject is not null
AND rownum < 2;
EXCEPTION
WHEN no_data_found then
v_subject:=null;
END;
else
v_subject:=p_subject;
end if;
if p_mailbody is null then
BEGIN
SELECT mail_message
INTO v_mailbody
FROM mat.mmat_mail
WHERE mail_proc_code='VENDEXCH'
AND mail_message is not null
AND rownum < 2;
EXCEPTION
WHEN no_data_found then
v_mailbody:=null;
END;
else
v_mailbody:=p_mailbody;
end if;
if instr(p_recipients,'@') = 0 then
for vc1 in c1(p_recipients) loop
flag:=flag+1;
if flag=1 then
v_recipients:=vc1.mail_id;
else
v_recipients:=v_recipients||', '||vc1.mail_id;
end if;
end loop;
else
v_recipients:=p_recipients;
end if;
BEGIN
conn := mat.send_mail.begin_mail(
sender => p_sender,
recipients => v_recipients,
subject => v_subject,
mime_type => mat.send_mail.MULTIPART_MIME_TYPE);
END begin_mail;
BEGIN
mat.send_mail.attach_text(
conn => conn,
data => v_mailbody,
mime_type => 'text/html');
END attach_text;
if v_file_name is not null then
BEGIN
mat.send_mail.begin_attachment(
conn => conn,
mime_type => 'text/plain',
inline => TRUE,
filename => v_file_name,
transfer_enc => '7 bit');
begin
v_file_handle := utl_file.fopen(v_directory_name, v_file_name, 'r');
loop
utl_file.get_line(v_file_handle, v_line);
mesg := v_line || crlf;
mat.send_mail.write_text(conn => conn, message => mesg);
end loop;
exception
when others then
null;
end;
utl_file.fclose(v_file_handle);
mat.send_mail.end_attachment(conn => conn );
END begin_attachment;
end if;
mat.send_mail.end_mail(conn => conn);
exception
when no_data_found then
mat.send_mail.end_attachment( conn => conn );
dbms_lob.fileclose(fil);
when others then
mat.send_mail.end_attachment( conn => conn );
err_num := SQLCODE;
err_msg := SUBSTR(SQLERRM, 1, 100);
dbms_output.put_line('Error number is ' || err_num);
dbms_output.put_line('Error message is ' || err_msg);
dbms_lob.fileclose(fil);
END;
Regards.
Satyaki De.
Maybe you are looking for
-
"How do you build a filter based on the conditions of two columns?"
Hi all, line desc Period Amount1 Amount2 jan feb 0 10 jan mar 0 20 jan jan 0 30 jan apr 0 40 I have a report like this with four columns Line Descr is from one table and period from other table and amounts 1 and amounts 2 are respective a
-
Hi, Does anyone know how I can change the background color og a JTable header when I click on a column in the table. For example If I click on column 3 in the tabe the header for column 3 will change color. Thanking you in advance.
-
Hi experts, smartform mr_print
hi experts: i have to change mr_print sap script to smartform. what i want is 1. print prog. (in routine mrm_entry_ers is very complex to take print prog) 2. could anybody send me full print prog . 3. if some body has developed smartform, pl down
-
I am a web develper that just got a new schema (created by our DBA) where I need to create objects such as Tables, Queries, Constraints and maybe some triggers in an Oracle 9i database. Please advise what class I should start with on Oracle's Trainin
-
Removing background from plastic wrap
Hi all, I need to remove the background from this image while keeping the straw and plastic wrap. Have looked all over for a tutorial, but no luck. Any help on how to do this would be much appreciated! Thanks in advance,