ODI Send Mail

Hi all,
I have few packages running every week in my project. Each package have an ODI send mail utility which sends an email notification whether the job is running successfully or not. I want to get the number of updates or inserts done by a particular package when it is run every week along with success or failure email. How can I achieve this. Please guide me.
Thanks

Hi,
under my opoinion the better way is to create a LOG_ODI_AUDIT table that logs for you some imformation.
An example (not tested) could be
insert into LOG_ODI_AUDIT
ODI_SESSION,
N_INS,
N_UPD,
N_DEL
SELECT
<%=odiRef.getSession("SESS_NO")%>,
<%=odiRef.getPrevStepLog("INSERT_COUNT")%>,
<%=odiRef.getPrevStepLog("UPDATE_COUNT")%>,
<%=odiRef.getPrevStepLog("DELETE_COUNT")%>
FROM DUALafter this you can retrieve all your information with a select from the table
Let me know your feedback

Similar Messages

  • Regarding odi send mail

    Hi all,
    There is problem with odi send mail error, after the all suggestions, i get answer for it requires jython procedure, and i downloaded from oracle site also...
    can any one please teach me where should need to implement/kept for sending mails.
    please help me....
    our network is popmail.bizmail.yahoo.com...
    please share any docs/links to this mail id: [email protected]
    Regards,
    surya.

    Here are two ways to send an e-mail
    1) Use the ODISendMail function in an ODI Package.
    To use this function drag the ODISendMail reference onto the Package window, join it to the Package flow, click on the function icon and supply Mail Server (SMTP Server Name), From (Me), To (Distribution), CC (Copy), BCC (Blind Copy), Subject, Attachment, and Message Body in the window that appears.
    I use this function to signal success or failure of a package or package step.
    To do this I only supply only the Mail Server, From, To and Subject. I don't need anything else to report success or failure.
    Here's a sample Subject:
    <%=snpRef.getSession("CONTEXT_NAME")%> <%=snpRef.getSession( "SESS_NAME" )%> <%=snpRef.getStep("STEP_NAME")%>
    The STEP_NAME holds the success/failure message
    I don't use the Message Body or Attachment.
    2) The procedure shown in the reply defines a Jython function to send an e-mail with Subject and Message Body using Mail Server, From and To values stored in a Jython dictionary. The Jython version is very old (release 2.1 or 2.2) so there are more elegant ways to write the function. Jython uses white space to control program flow which the Form editor deletes. Here's a verson of the code with leading periods in the code to preserve the white space and with comments on each line. Comments start with a # character and extend to the end of the line.
    Dict = {} # This holds the global parameters
    Dict['ToString'] = '[email protected]' # you supply the value
    Dict['FromString'] = 'FromFromFrom' # you supply the value
    Dict['SMTP'] = 'My Mail Server' # you supply the value
    import smtplib #These are the Jython library routines needed to send the e-mail
    def SendMail(MessageSubject,MessageLines): # This is the function definition
    . global Dict # Point to the Dictionary
    . Subject = '%s %s %s' % (Dict['Context'],Dict['Session'],MessageSubject) #Build the Subject Line
    . MessageString = '' #Initialize the Message String
    . for ReportLine in MessageLines: # Add the callers message lines to the Message String (each line here ends in a newline \n)
    . MessageString = '%s%s' % (MessageString,ReportLine)
    # The next statement builds the actual e-mail message according to a very strict format. Understanding the format is hard
    . Message="From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%s" % (Dict['FromString'],Dict['ToString'],Subject,MessageString)
    . server = smtplib.SMTP(Dict['SMTP']) # Setup the Mail Server
    . server.sendmail(Dict['FromString'],Dict['ToString'],Message) # Send The Message
    . server.quit() # Stop
    # Here we build a sample message
    ReportSubject = 'This is a Test Message'
    Report = []
    Report.append('First Line\n')
    Report.append('Second Line\n')
    Report.append('Last Line\n')
    # Send the Message
    SendMail(ReportSubject,Report)
    If you're not familiar with Jython, this still won't make much sense, but Jython is not hard to learn, and this example is not very complicated.

  • Using ODI send mail tool in procedure

    Hi,
    I want to use an ODI send mail option in procedure when certain condition is met.
    for example:
    I have one table "Dummy_table" as
    Dummy_table
    PRODUCTID
    PRODTYPE
    PRODCODE
    11111
    A
    11111
    22222
    A
    22222
    33333
    B
    33333
    00000
    A
    00000
    And a procedure which is trying to insert records in above table. In this procedure i want to add validation and when the validation is true, need to send mail.
    Mail to be triggered:
    If PRODUCTID already exists in table then do not insert record with same PRODUCTID in table. Instead of that, call an ODI send mail tool from the procedure which is trying to insert duplicate entry.
    Let's say my procedure is trying to insert record with PRODUCTID = "22222" . In this case, i dont want an entry to be inserted as it is already present. I want a mail to be triggered saying that this record is already present.
    Any help would be highly appreciated.
    Thanks in advance.
    Shilpa

    Sure, please follow the steps:
    1) First import one CKM to your project. If you are working with Oracle then you could use "CKM Oracle";
    2) Open your Interface and go to "Controls" tab and select your "CKM Oracle" in CKM Selector combo box. Pay attention to the CKM options and change them accordingly to your needs;
    3) Go to "Models" tab and search for your "Dummy_table" model;
    4) Expand "Dummy_table" model and right click "Constraints" -> New Condition
    5) Give it a name, select Type = "Oracle Data Integrator Condition" and then write down a SQL that will indicate which are the valid values that should be loaded to your target table. In your example, it should be something like this (DUM being the model table alias):
    DUM.PRODUCTID NOT IN (SELECT T1.PRODUCTID FROM Dummy_table T1)
    This query is telling ODI that only the rows with PRODUCTID that does not exists in the target table are valid. All the rest (in this case all rows that already exists in the target table) should be logged in E$ table.
    Please let me know if it worked.
    Thanks.

  • ODI Send Mail tool is sending thousands of mails

    Hi,
    In one of my ODI packages i have used ODI send mail to send the success notfication mails with error and log files attached.
    It worked fine for a long time but today we have received nearly 9000 mails from this.
    this package is loading data in to essbase and executing a calc script. while the package is in running mode, we killed the script from EAS as it is executing for more than double the time it do normally. Then immediately mails flow has been started. that too " success mails " . (we have two send mails- one for success and the other for failure notice).
    I tried to figure out the problem. there were no changes. Except the "To" field. we gave the all the recipients emails separated by commas instead of adding a new line for each recipient. I executed a new send mail command with the same way (TO field). It executed fine.
    Can any one help me to debug the error? is it caused by essbase/send mail? or any other reasons?
    Thanks in advance :)

    Thanks for your reply..
    yes it was looped. but how the success mail was kicked off ?. we killed the script in Essbase so the package should execute failure mail step. Instead it executed the success mail.
    any clue on this pls ?

  • ODI send mail problem

    Hi,
    i am trying to send mail via ODI send mail package and getting error below,
    com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.1 Client was not authenticated
    any advise pls
    thank you

    ODI is sending the email without a password which is the behavior of OdiSendMail.
    Where as your mail server is looking for a authenticated mail i.e. which has password , this is why you are getting this error.
    For OdiSendMail , use a mail server which does not requires an authentication
    Else use customized Jython mail sending procedure ... see details in ODIsendmail error

  • ODI Send Mail- To List

    Hi all,
    I want to use the odi send mail tool, and send the same mail to a large number of people, whose email id's have been retrieved from a database table.
    Kindly guide me as to how to retrieve a set of email id's from the databse and add them in the "to" list of Odi send mail tool.
    I thought of using a refreshing variable , but the refreshing variable should only return a single value. so this wont help.
    Kindly help.
    Thanks in advance.

    Hi,
    You can enter the email id's in table separating each with a comma (,). The email id's should be entered against a unique identifier, say your interface name.
    Insert a variable in ODI and in its refreshing tab put "select email_id from your_table where interface_name='your_interface_name".
    Use this variable in ODISendMail.
    Hope this helps!
    Ritika

  • Sending mail on successful execution of Interface in ODI

    HI,
    I am using ODI 11g  and I want to send a mail if the interface executed successfully but in the "ODI send mail"  page I am unable to give the values of the parameter.
    please help me if I want to send mail to my personal "Gmail" account , what would be the the value for :
    mail server: --------?
    From: ---------------?
    And why they are not asking for the authentication of the "from" mail ID.
    I am getting the following error when I am passing the "mail server" =216.58.220.5 (which is the IP of the "Gmail" server which I got by pinging on the website).
    ERROR:
    Caused By: javax.mail.MessagingException: Could not connect to SMTP host: 216.58.220.5, port: 25;
      nested exception is:
      java.net.ConnectException: Connection timed out
      at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
      at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
      at javax.mail.Service.connect(Service.java:275)
      at javax.mail.Service.connect(Service.java:156)
      at javax.mail.Service.connect(Service.java:105)
      at javax.mail.Transport.send0(Transport.java:168)
      at javax.mail.Transport.send(Transport.java:98)
      at com.sunopsis.dwg.tools.SendMail.actionExecute(SendMail.java:172)
      at com.sunopsis.dwg.function.SnpsFunctionBase.execute(SnpsFunctionBase.java:276)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execIntegratedFunction(SnpSessTaskSql.java:3437)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeOdiCommand(SnpSessTaskSql.java:1509)
      at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:44)
      at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:1)
      at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
      at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:577)
      at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:468)
      at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2128)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
      at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
      at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
      at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
      at java.lang.Thread.run(Thread.java:745)
    Caused by: java.net.ConnectException: Connection timed out
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      at java.net.Socket.connect(Socket.java:579)
      at java.net.Socket.connect(Socket.java:528)
      at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
      at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
      at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
      ... 26 more

    Dear Bhabani,
    Thanks for your attention.
    When I am trying to implement the first solution,I am unable to get the option by default,even when I am setting up the options manually it is throwing error.
    Can you please describe the procedure a little more or it would be great if it is through screen shots.
    ERROR:
    ODI-1217: Session EMP_RETAILSOLS (85001) fails with return code 7000.
    Caused By: com.sunopsis.tools.core.exception.SnpsSimpleMessageException: ODI-17517: Error during task interpretation.
    Task: 21
    java.lang.Exception: BeanShell script error: Sourced file: inline evaluation of: ``out.print("The application script threw an exception: com.sunopsis.tools.core.ex . . . '' Token Parsing Error: Lexical error at line 2, column 41.  Encountered: "\\" (92), after : "": <at unknown location>
    BSF info: Send_mail at line: 0 column: columnNo
      at com.sunopsis.dwg.codeinterpretor.SnpCodeInterpretor.transform(SnpCodeInterpretor.java:489)
      at com.sunopsis.dwg.dbobj.SnpSessStep.createTaskLogs(SnpSessStep.java:737)
      at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:465)
      at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2128)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
      at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
      at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
      at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
      at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.Exception: BeanShell script error: Sourced file: inline evaluation of: ``out.print("The application script threw an exception: com.sunopsis.tools.core.ex . . . '' Token Parsing Error: Lexical error at line 2, column 41.  Encountered: "\\" (92), after : "": <at unknown location>
    BSF info: Send_mail at line: 0 column: columnNo
      at com.sunopsis.dwg.codeinterpretor.SnpCodeInterpretor.transform(SnpCodeInterpretor.java:476)
      ... 11 more
    Caused by: org.apache.bsf.BSFException: BeanShell script error: Sourced file: inline evaluation of: ``out.print("The application script threw an exception: com.sunopsis.tools.core.ex . . . '' Token Parsing Error: Lexical error at line 2, column 41.  Encountered: "\\" (92), after : "": <at unknown location>
    BSF info: Send_mail at line: 0 column: columnNo
      at bsh.util.BeanShellBSFEngine.eval(Unknown Source)
      at bsh.util.BeanShellBSFEngine.exec(Unknown Source)
      at com.sunopsis.dwg.codeinterpretor.SnpCodeInterpretor.transform(SnpCodeInterpretor.java:471)
      ... 11 more
    Text: The application script threw an exception: com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Exception getOption("TEMP_JAVA_DIR") : Exception getOption("TEMP_JAVA_DIR") : Option does not exist ("TEMP_JAVA_DIR") BSF info: Send_mail at line: 0 column: columnNo
    out.print("<SunopsisExport><Admin RepositoryVersion=\"04.03.04.02\"/><Object class=\"com.sunopsis.dwg.dbobj.SnpTrt\"><Field name=\"ExtVersion\" type=\"java.lang.String\">null</Field><Field name=\"FirstDate\" type=\"java.sql.Timestamp\">2012-12-20 14:28:40.0</Field><Field name=\"FirstUser\" type=\"java.lang.String\">SUPERVISOR</Field><Field name=\"IndChange\" type=\"java.lang.String\">U</Field><Field name=\"IndJrnMethod\" type=\"java.lang.String\">S</Field><Field name=\"IndSuppSetBased\" type=\"java.lang.String\">null</Field><Field name=\"IntVersion\" type=\"com.sunopsis.sql.DbInt\">7</Field><Field name=\"IFolder\" type=\"com.sunopsis.sql.DbInt\">9091</Field><Field name=\"IProject\" type=\"com.sunopsis.sql.DbInt\">7091</Field><Field name=\"IScBaseTrt\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"IScOrigTrt\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"IScTrt\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"IState\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"ITxtTrtTxt\" type=\"com.sunopsis.sql.DbInt\">3311091</Field><Field name=\"KimMultiDserver\" type=\"java.lang.String\">0</Field><Field name=\"KmDefault\" type=\"java.lang.String\">0</Field><Field name=\"KmSrcTechno\" type=\"java.lang.String\">null</Field><Field name=\"KmTechno\" type=\"java.lang.String\">null</Field><Field name=\"KmVersion\" type=\"java.lang.String\">null</Field><Field name=\"LastDate\" type=\"java.sql.Timestamp\">2012-12-20 14:40:22.0</Field><Field name=\"LastUser\" type=\"java.lang.String\">SUPERVISOR</Field><Field name=\"LChecksum\" type=\"com.sunopsis.sql.DbInt\">2221</Field><Field name=\"LCode\" type=\"java.lang.String\">null</Field><Field name=\"OrdFolder\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"TrtName\" type=\"java.lang.String\">SendGmailTLS</Field><Field name=\"TrtType\" type=\"java.lang.String\">U</Field><Field name=\"VLastDate\" type=\"java.sql.Timestamp\">null</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpTxtHeader\"><Field name=\"Enc\" type=\"java.lang.String\">null</Field><Field name=\"EncKey\" type=\"java.lang.String\">null</Field><Field name=\"ITxt\" type=\"com.sunopsis.sql.DbInt\">3311091</Field><Field name=\"ITxtOrig\" type=\"com.sunopsis.sql.DbInt\">107</Field><Field name=\"SqlIndGrp\" type=\"java.lang.String\">0</Field><Field name=\"Txt\" type=\"java.lang.String\">COMPONENT NAME: SendGmailTLS\n\nAUTHOR: Bhabani Ranjan Mahapatra\nEMAIL    : [email protected]\nBLOG     : http://dwteam.in\n\n\nDESCRIPTION:\nThis procedure is required to send email using gmail credentials.</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpOrigTxt\"><Field name=\"ITxtOrig\" type=\"com.sunopsis.sql.DbInt\">107</Field><Field name=\"OrigineName\" type=\"java.lang.String\">Edit Command</Field><Field name=\"SnpsCol\" type=\"java.lang.String\">I_TXT_TRT_TXT</Field><Field name=\"SnpsTable\" type=\"java.lang.String\">SNP_TRT</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpUserExit\"><Field name=\"ExtVersion\" type=\"java.lang.String\">null</Field><Field name=\"IndChange\" type=\"java.lang.String\">I</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"ITxtUeHelp\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ITxtValue\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"IUserExit\" type=\"com.sunopsis.sql.DbInt\">756091</Field><Field name=\"Position\" type=\"com.sunopsis.sql.DbInt\">30</Field><Field name=\"ShortValue\" type=\"java.lang.String\">0</Field><Field name=\"UeName\" type=\"java.lang.String\">DELETE_TEMP_FILES</Field><Field name=\"UeSdesc\" type=\"java.lang.String\">Remove temp files</Field><Field name=\"UeType\" type=\"java.lang.String\">C</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpUserExit\"><Field name=\"ExtVersion\" type=\"java.lang.String\">null</Field><Field name=\"IndChange\" type=\"java.lang.String\">I</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"ITxtUeHelp\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ITxtValue\" type=\"com.sunopsis.sql.DbInt\">3312091</Field><Field name=\"IUserExit\" type=\"com.sunopsis.sql.DbInt\">758091</Field><Field name=\"Position\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ShortValue\" type=\"java.lang.String\">null</Field><Field name=\"UeName\" type=\"java.lang.String\">BODY</Field><Field name=\"UeSdesc\" type=\"java.lang.String\">null</Field><Field name=\"UeType\" type=\"java.lang.String\">T</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpTxtHeader\"><Field name=\"Enc\" type=\"java.lang.String\">null</Field><Field name=\"EncKey\" type=\"java.lang.String\">null</Field><Field name=\"ITxt\" type=\"com.sunopsis.sql.DbInt\">3312091</Field><Field name=\"ITxtOrig\" type=\"com.sunopsis.sql.DbInt\">110</Field><Field name=\"SqlIndGrp\" type=\"java.lang.String\">0</Field><Field name=\"Txt\" type=\"java.lang.String\">Its a Mail from ODI Studio.\\nThank You</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpOrigTxt\"><Field name=\"ITxtOrig\" type=\"com.sunopsis.sql.DbInt\">110</Field><Field name=\"OrigineName\" type=\"java.lang.String\">Text value</Field><Field name=\"SnpsCol\" type=\"java.lang.String\">I_TXT_VALUE</Field><Field name=\"SnpsTable\" type=\"java.lang.String\">SNP_USER_EXIT</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpUserExit\"><Field name=\"ExtVersion\" type=\"java.lang.String\">null</Field><Field name=\"IndChange\" type=\"java.lang.String\">I</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"ITxtUeHelp\" type=\"com.sunopsis.sql.DbInt\">3313091</Field><Field name=\"ITxtValue\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"IUserExit\" type=\"com.sunopsis.sql.DbInt\">759091</Field><Field name=\"Position\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ShortValue\" type=\"java.lang.String\"><?= java.lang.System.getProperty(\"java.home\").matches(\".*jre\")?java.lang.System.getProperty(\"java.home\")+\"/..\":java.lang.System.getProperty(\"java.home\") ?></Field><Field name=\"UeName\" type=\"java.lang.String\">JAVA_HOME</Field><Field name=\"UeSdesc\" type=\"java.lang.String\">Location of the JDK</Field><Field name=\"UeType\" type=\"java.lang.String\">V</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpTxtHeader\"><Field name=\"Enc\" type=\"java.lang.String\">null</Field><Field name=\"EncKey\" type=\"java.lang.String\">null</Field><Field name=\"ITxt\" type=\"com.sunopsis.sql.DbInt\">3313091</Field><Field name=\"ITxtOrig\" type=\"com.sunopsis.sql.DbInt\">111</Field><Field name=\"SqlIndGrp\" type=\"java.lang.String\">0</Field><Field name=\"Txt\" type=\"java.lang.String\">\nExamples:\n\t$ODI_JAVA_HOME on Unix \n\t%ODI_JAVA_HOME% on Windows\n\t/usr/lib/jvm/java-7-openjdk-amd64</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpOrigTxt\"><Field name=\"ITxtOrig\" type=\"com.sunopsis.sql.DbInt\">111</Field><Field name=\"OrigineName\" type=\"java.lang.String\">User Exit help</Field><Field name=\"SnpsCol\" type=\"java.lang.String\">I_TXT_UE_HELP</Field><Field name=\"SnpsTable\" type=\"java.lang.String\">SNP_USER_EXIT</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpUserExit\"><Field name=\"ExtVersion\" type=\"java.lang.String\">null</Field><Field name=\"IndChange\" type=\"java.lang.String\">I</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"ITxtUeHelp\" type=\"com.sunopsis.sql.DbInt\">3314091</Field><Field name=\"ITxtValue\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"IUserExit\" type=\"com.sunopsis.sql.DbInt\">765091</Field><Field name=\"Position\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ShortValue\" type=\"java.lang.String\">C:/oracle/product/11.1.1/Oracle_ODI_1/oracledi.sdk/lib/mail.jar</Field><Field name=\"UeName\" type=\"java.lang.String\">JAVA_CP_JAR</Field><Field name=\"UeSdesc\" type=\"java.lang.String\">Provide the jar name with location</Field><Field name=\"UeType\" type=\"java.lang.String\">V</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpTxtHeader\"><Field name=\"Enc\" type=\"java.lang.String\">null</Field><Field name=\"EncKey\" type=\"java.lang.String\">null</Field><Field name=\"ITxt\" type=\"com.sunopsis.sql.DbInt\">3314091</Field><Field name=\"ITxtOrig\" type=\"com.sunopsis.sql.DbInt\">111</Field><Field name=\"SqlIndGrp\" type=\"java.lang.String\">0</Field><Field name=\"Txt\" type=\"java.lang.String\">mail.jar is required for this java file.</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpUserExit\"><Field name=\"ExtVersion\" type=\"java.lang.String\">null</Field><Field name=\"IndChange\" type=\"java.lang.String\">I</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"ITxtUeHelp\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ITxtValue\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"IUserExit\" type=\"com.sunopsis.sql.DbInt\">761091</Field><Field name=\"Position\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ShortValue\" type=\"java.lang.String\">[email protected]</Field><Field name=\"UeName\" type=\"java.lang.String\">FROM</Field><Field name=\"UeSdesc\" type=\"java.lang.String\">FROM</Field><Field name=\"UeType\" type=\"java.lang.String\">V</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpUserExit\"><Field name=\"ExtVersion\" type=\"java.lang.String\">null</Field><Field name=\"IndChange\" type=\"java.lang.String\">I</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"ITxtUeHelp\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ITxtValue\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"IUserExit\" type=\"com.sunopsis.sql.DbInt\">762091</Field><Field name=\"Position\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ShortValue\" type=\"java.lang.String\">Mail From ODI</Field><Field name=\"UeName\" type=\"java.lang.String\">SUBJECT</Field><Field name=\"UeSdesc\" type=\"java.lang.String\">Subject</Field><Field name=\"UeType\" type=\"java.lang.String\">V</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpUserExit\"><Field name=\"ExtVersion\" type=\"java.lang.String\">null</Field><Field name=\"IndChange\" type=\"java.lang.String\">I</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"ITxtUeHelp\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ITxtValue\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"IUserExit\" type=\"com.sunopsis.sql.DbInt\">763091</Field><Field name=\"Position\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ShortValue\" type=\"java.lang.String\">C:/Users/Public</Field><Field name=\"UeName\" type=\"java.lang.String\">TEMP_JAVA_DIR</Field><Field name=\"UeSdesc\" type=\"java.lang.String\">Temp Java File Location</Field><Field name=\"UeType\" type=\"java.lang.String\">V</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpUserExit\"><Field name=\"ExtVersion\" type=\"java.lang.String\">null</Field><Field name=\"IndChange\" type=\"java.lang.String\">U</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"ITxtUeHelp\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ITxtValue\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"IUserExit\" type=\"com.sunopsis.sql.DbInt\">764091</Field><Field name=\"Position\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ShortValue\" type=\"java.lang.String\">null</Field><Field name=\"UeName\" type=\"java.lang.String\">USERNAME</Field><Field name=\"UeSdesc\" type=\"java.lang.String\">null</Field><Field name=\"UeType\" type=\"java.lang.String\">T</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpUserExit\"><Field name=\"ExtVersion\" type=\"java.lang.String\">null</Field><Field name=\"IndChange\" type=\"java.lang.String\">U</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"ITxtUeHelp\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ITxtValue\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"IUserExit\" type=\"com.sunopsis.sql.DbInt\">757091</Field><Field name=\"Position\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ShortValue\" type=\"java.lang.String\">null</Field><Field name=\"UeName\" type=\"java.lang.String\">PASSWORD</Field><Field name=\"UeSdesc\" type=\"java.lang.String\">null</Field><Field name=\"UeType\" type=\"java.lang.String\">T</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpUserExit\"><Field name=\"ExtVersion\" type=\"java.lang.String\">null</Field><Field name=\"IndChange\" type=\"java.lang.String\">I</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"ITxtUeHelp\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ITxtValue\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"IUserExit\" type=\"com.sunopsis.sql.DbInt\">760091</Field><Field name=\"Position\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ShortValue\" type=\"java.lang.String\">[email protected]</Field><Field name=\"UeName\" type=\"java.lang.String\">TO</Field><Field name=\"UeSdesc\" type=\"java.lang.String\">Target User ID</Field><Field name=\"UeType\" type=\"java.lang.String\">V</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpLineTrt\"><Field name=\"AlwaysExe\" type=\"java.lang.String\">0</Field><Field name=\"ColConnectId\" type=\"java.lang.String\">null</Field><Field name=\"ColContextCode\" type=\"java.lang.String\">null</Field><Field name=\"ColIndCommit\" type=\"java.lang.String\">null</Field><Field name=\"ColIsolLevel\" type=\"java.lang.String\">null</Field><Field name=\"ColITxt\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ColLschemaName\" type=\"java.lang.String\">null</Field><Field name=\"ColPlanComp\" type=\"java.lang.String\">null</Field><Field name=\"ColTechno\" type=\"java.lang.String\">null</Field><Field name=\"DefConnectId\" type=\"java.lang.String\">null</Field><Field name=\"DefContextCode\" type=\"java.lang.String\">null</Field><Field name=\"DefIndCommit\" type=\"java.lang.String\">null</Field><Field name=\"DefIsolLevel\" type=\"java.lang.String\">null</Field><Field name=\"DefITxt\" type=\"com.sunopsis.sql.DbInt\">3315091</Field><Field name=\"DefLschemaName\" type=\"java.lang.String\">null</Field><Field name=\"DefPlanComp\" type=\"java.lang.String\">null</Field><Field name=\"DefTechno\" type=\"java.lang.String\">SUNOPSIS_API</Field><Field name=\"FirstDate\" type=\"java.sql.Timestamp\">2012-12-20 14:28:40.0</Field><Field name=\"FirstUser\" type=\"java.lang.String\">SUPERVISOR</Field><Field name=\"IndErr\" type=\"java.lang.String\">0</Field><Field name=\"IndLogFinalCmd\" type=\"java.lang.String\">0</Field><Field name=\"IndLogMethod\" type=\"java.lang.String\">null</Field><Field name=\"IndLogNb\" type=\"java.lang.String\">null</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"KcmAk\" type=\"java.lang.String\">0</Field><Field name=\"KcmCond\" type=\"java.lang.String\">0</Field><Field name=\"KcmErrDel\" type=\"java.lang.String\">0</Field><Field name=\"KcmJoin\" type=\"java.lang.String\">0</Field><Field name=\"KcmNull\" type=\"java.lang.String\">0</Field><Field name=\"KcmPk\" type=\"java.lang.String\">0</Field><Field name=\"KimDrvdSel\" type=\"java.lang.String\">0</Field><Field name=\"KimIdx\" type=\"java.lang.String\">0</Field><Field name=\"KimJrn\" type=\"java.lang.String\">0</Field><Field name=\"KimJrnPop\" type=\"java.lang.String\">0</Field><Field name=\"KjmCreate\" type=\"java.lang.String\">0</Field><Field name=\"KjmDrop\" type=\"java.lang.String\">0</Field><Field name=\"KjmExtend\" type=\"java.lang.String\">0</Field><Field name=\"KjmLock\" type=\"java.lang.String\">0</Field><Field name=\"KjmPurge\" type=\"java.lang.String\">0</Field><Field name=\"KjmSetInstall\" type=\"java.lang.String\">0</Field><Field name=\"KjmSetUninstall\" type=\"java.lang.String\">0</Field><Field name=\"KjmSubscribe\" type=\"java.lang.String\">0</Field><Field name=\"KjmTableOrder\" type=\"java.lang.String\">0</Field><Field name=\"KjmUnlock\" type=\"java.lang.String\">0</Field><Field name=\"KjmUnsubscribe\" type=\"java.lang.String\">0</Field><Field name=\"KlmAfterInt\" type=\"java.lang.String\">0</Field><Field name=\"KlmIdx\" type=\"java.lang.String\">0</Field><Field name=\"KlmJrn\" type=\"java.lang.String\">0</Field><Field name=\"KxmUsed\" type=\"java.lang.String\">null</Field><Field name=\"LastDate\" type=\"java.sql.Timestamp\">2012-12-20 14:38:47.0</Field><Field name=\"LastUser\" type=\"java.lang.String\">SUPERVISOR</Field><Field name=\"LogLevDet\" type=\"java.lang.String\">3</Field><Field name=\"OrdTrt\" type=\"com.sunopsis.sql.DbInt\">30</Field><Field name=\"SqlName\" type=\"java.lang.String\">Delete temporary files</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpTxtHeader\"><Field name=\"Enc\" type=\"java.lang.String\">null</Field><Field name=\"EncKey\" type=\"java.lang.String\">null</Field><Field name=\"ITxt\" type=\"com.sunopsis.sql.DbInt\">3315091</Field><Field name=\"ITxtOrig\" type=\"com.sunopsis.sql.DbInt\">102</Field><Field name=\"SqlIndGrp\" type=\"java.lang.String\">0</Field><Field name=\"Txt\" type=\"java.lang.String\">OdiFileDelete \"-FILE=") ;
    out.print(odiRef.getOption("TEMP_JAVA_DIR")) ;
    out.print("/SendMailTLS*\"</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpOrigTxt\"><Field name=\"ITxtOrig\" type=\"com.sunopsis.sql.DbInt\">102</Field><Field name=\"OrigineName\" type=\"java.lang.String\">Target Technology</Field><Field name=\"SnpsCol\" type=\"java.lang.String\">DEF_I_TXT</Field><Field name=\"SnpsTable\" type=\"java.lang.String\">SNP_LINE_TRT</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpLineTrt\"><Field name=\"AlwaysExe\" type=\"java.lang.String\">1</Field><Field name=\"ColConnectId\" type=\"java.lang.String\">null</Field><Field name=\"ColContextCode\" type=\"java.lang.String\">null</Field><Field name=\"ColIndCommit\" type=\"java.lang.String\">null</Field><Field name=\"ColIsolLevel\" type=\"java.lang.String\">null</Field><Field name=\"ColITxt\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ColLschemaName\" type=\"java.lang.String\">null</Field><Field name=\"ColPlanComp\" type=\"java.lang.String\">null</Field><Field name=\"ColTechno\" type=\"java.lang.String\">null</Field><Field name=\"DefConnectId\" type=\"java.lang.String\">null</Field><Field name=\"DefContextCode\" type=\"java.lang.String\">null</Field><Field name=\"DefIndCommit\" type=\"java.lang.String\">null</Field><Field name=\"DefIsolLevel\" type=\"java.lang.String\">null</Field><Field name=\"DefITxt\" type=\"com.sunopsis.sql.DbInt\">3316091</Field><Field name=\"DefLschemaName\" type=\"java.lang.String\">null</Field><Field name=\"DefPlanComp\" type=\"java.lang.String\">null</Field><Field name=\"DefTechno\" type=\"java.lang.String\">SUNOPSIS_API</Field><Field name=\"FirstDate\" type=\"java.sql.Timestamp\">2012-12-20 14:28:40.0</Field><Field name=\"FirstUser\" type=\"java.lang.String\">SUPERVISOR</Field><Field name=\"IndErr\" type=\"java.lang.String\">0</Field><Field name=\"IndLogFinalCmd\" type=\"java.lang.String\">0</Field><Field name=\"IndLogMethod\" type=\"java.lang.String\">null</Field><Field name=\"IndLogNb\" type=\"java.lang.String\">null</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"KcmAk\" type=\"java.lang.String\">0</Field><Field name=\"KcmCond\" type=\"java.lang.String\">0</Field><Field name=\"KcmErrDel\" type=\"java.lang.String\">0</Field><Field name=\"KcmJoin\" type=\"java.lang.String\">0</Field><Field name=\"KcmNull\" type=\"java.lang.String\">0</Field><Field name=\"KcmPk\" type=\"java.lang.String\">0</Field><Field name=\"KimDrvdSel\" type=\"java.lang.String\">0</Field><Field name=\"KimIdx\" type=\"java.lang.String\">0</Field><Field name=\"KimJrn\" type=\"java.lang.String\">0</Field><Field name=\"KimJrnPop\" type=\"java.lang.String\">0</Field><Field name=\"KjmCreate\" type=\"java.lang.String\">0</Field><Field name=\"KjmDrop\" type=\"java.lang.String\">0</Field><Field name=\"KjmExtend\" type=\"java.lang.String\">0</Field><Field name=\"KjmLock\" type=\"java.lang.String\">0</Field><Field name=\"KjmPurge\" type=\"java.lang.String\">0</Field><Field name=\"KjmSetInstall\" type=\"java.lang.String\">0</Field><Field name=\"KjmSetUninstall\" type=\"java.lang.String\">0</Field><Field name=\"KjmSubscribe\" type=\"java.lang.String\">0</Field><Field name=\"KjmTableOrder\" type=\"java.lang.String\">0</Field><Field name=\"KjmUnlock\" type=\"java.lang.String\">0</Field><Field name=\"KjmUnsubscribe\" type=\"java.lang.String\">0</Field><Field name=\"KlmAfterInt\" type=\"java.lang.String\">0</Field><Field name=\"KlmIdx\" type=\"java.lang.String\">0</Field><Field name=\"KlmJrn\" type=\"java.lang.String\">0</Field><Field name=\"KxmUsed\" type=\"java.lang.String\">null</Field><Field name=\"LastDate\" type=\"java.sql.Timestamp\">2012-12-20 14:38:47.0</Field><Field name=\"LastUser\" type=\"java.lang.String\">SUPERVISOR</Field><Field name=\"LogLevDet\" type=\"java.lang.String\">3</Field><Field name=\"OrdTrt\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"SqlName\" type=\"java.lang.String\">Create Java File</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpTxtHeader\"><Field name=\"Enc\" type=\"java.lang.String\">null</Field><Field name=\"EncKey\" type=\"java.lang.String\">null</Field><Field name=\"ITxt\" type=\"com.sunopsis.sql.DbInt\">3316091</Field><Field name=\"ITxtOrig\" type=\"com.sunopsis.sql.DbInt\">102</Field><Field name=\"SqlIndGrp\" type=\"java.lang.String\">2</Field><Field name=\"Txt\" type=\"java.lang.String\">OdiOutFile \"-FILE=") ;
    out.print(odiRef.getOption("TEMP_JAVA_DIR")) ;
    out.print("/SendMailTLS.java\"\nimport java.util.Properties;\nimport javax.mail.Message;\nimport javax.mail.MessagingException;\nimport javax.mail.PasswordAuthentication;\nimport javax.mail.Session;\nimport javax.mail.Transport;\nimport javax.mail.internet.InternetAddress;\nimport javax.mail.internet.MimeMessage;\n \npublic class SendMailTLS {\n\tpublic static void main(String[] args) {\n\t\tfinal String username = \"") ;
    out.print(odiRef.getOption("USERNAME")) ;
    out.print("\";\n\t\tfinal String password = \"") ;
    out.print(odiRef.getOption("PASSWORD")) ;
    out.print("\";\n\t\tProperties props = new Properties();\n\t\tprops.put(\"mail.smtp.auth\", \"true\");\n\t\tprops.put(\"mail.smtp.starttls.enable\", \"true\");\n\t\tprops.put(\"mail.smtp.host\", \"smtp.gmail.com\");\n\t\tprops.put(\"mail.smtp.port\", \"587\");\nprops.put(\u201cmail.smtp.socketFactory.port\u201d, \u201c587\u2033);\nprops.put(\u201cmail.smtp.socketFactory.class\u201d,\u201djavax.net.tls.TLSSocketFactory\u201d);\n\n \n\t\tSession session = Session.getInstance(props,\n\t\t  new javax.mail.Authenticator() {\n\t\t\tprotected PasswordAuthentication getPasswordAuthentication() {\n\t\t\t\treturn new PasswordAuthentication(username, password);\n\t\t\t}\n\t\t  });\n \n\t\ttry {\n \n\t\t\tMessage message = new MimeMessage(session);\n\t\t\tmessage.setFrom(new InternetAddress(\"") ;
    out.print(odiRef.getOption("FROM")) ;
    out.print("\"));\n\t\t\tmessage.setRecipients(Message.RecipientType.TO,\n\t\t\t\t\tInternetAddress.parse(\"") ;
    out.print(odiRef.getOption("TO")) ;
    out.print("\"));\n\t\t\tmessage.setSubject(\"") ;
    out.print(odiRef.getOption("SUBJECT")) ;
    out.print("\");\n\t\t\tmessage.setText(\"") ;
    out.print(odiRef.getOption("BODY")) ;
    out.print("\");\n \n\t\t\tTransport.send(message);\n \n\t\t\tSystem.out.println(\"Done\");\n \n\t\t} catch (MessagingException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}\n}</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpLineTrt\"><Field name=\"AlwaysExe\" type=\"java.lang.String\">1</Field><Field name=\"ColConnectId\" type=\"java.lang.String\">null</Field><Field name=\"ColContextCode\" type=\"java.lang.String\">null</Field><Field name=\"ColIndCommit\" type=\"java.lang.String\">null</Field><Field name=\"ColIsolLevel\" type=\"java.lang.String\">null</Field><Field name=\"ColITxt\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ColLschemaName\" type=\"java.lang.String\">null</Field><Field name=\"ColPlanComp\" type=\"java.lang.String\">null</Field><Field name=\"ColTechno\" type=\"java.lang.String\">FILE</Field><Field name=\"DefConnectId\" type=\"java.lang.String\">null</Field><Field name=\"DefContextCode\" type=\"java.lang.String\">null</Field><Field name=\"DefIndCommit\" type=\"java.lang.String\">null</Field><Field name=\"DefIsolLevel\" type=\"java.lang.String\">null</Field><Field name=\"DefITxt\" type=\"com.sunopsis.sql.DbInt\">3317091</Field><Field name=\"DefLschemaName\" type=\"java.lang.String\">null</Field><Field name=\"DefPlanComp\" type=\"java.lang.String\">null</Field><Field name=\"DefTechno\" type=\"java.lang.String\">SUNOPSIS_API</Field><Field name=\"FirstDate\" type=\"java.sql.Timestamp\">2012-12-20 14:28:40.0</Field><Field name=\"FirstUser\" type=\"java.lang.String\">SUPERVISOR</Field><Field name=\"IndErr\" type=\"java.lang.String\">0</Field><Field name=\"IndLogFinalCmd\" type=\"java.lang.String\">0</Field><Field name=\"IndLogMethod\" type=\"java.lang.String\">null</Field><Field name=\"IndLogNb\" type=\"java.lang.String\">null</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"KcmAk\" type=\"java.lang.String\">0</Field><Field name=\"KcmCond\" type=\"java.lang.String\">0</Field><Field name=\"KcmErrDel\" type=\"java.lang.String\">0</Field><Field name=\"KcmJoin\" type=\"java.lang.String\">0</Field><Field name=\"KcmNull\" type=\"java.lang.String\">0</Field><Field name=\"KcmPk\" type=\"java.lang.String\">0</Field><Field name=\"KimDrvdSel\" type=\"java.lang.String\">0</Field><Field name=\"KimIdx\" type=\"java.lang.String\">0</Field><Field name=\"KimJrn\" type=\"java.lang.String\">0</Field><Field name=\"KimJrnPop\" type=\"java.lang.String\">0</Field><Field name=\"KjmCreate\" type=\"java.lang.String\">0</Field><Field name=\"KjmDrop\" type=\"java.lang.String\">0</Field><Field name=\"KjmExtend\" type=\"java.lang.String\">0</Field><Field name=\"KjmLock\" type=\"java.lang.String\">0</Field><Field name=\"KjmPurge\" type=\"java.lang.String\">0</Field><Field name=\"KjmSetInstall\" type=\"java.lang.String\">0</Field><Field name=\"KjmSetUninstall\" type=\"java.lang.String\">0</Field><Field name=\"KjmSubscribe\" type=\"java.lang.String\">0</Field><Field name=\"KjmTableOrder\" type=\"java.lang.String\">0</Field><Field name=\"KjmUnlock\" type=\"java.lang.String\">0</Field><Field name=\"KjmUnsubscribe\" type=\"java.lang.String\">0</Field><Field name=\"KlmAfterInt\" type=\"java.lang.String\">0</Field><Field name=\"KlmIdx\" type=\"java.lang.String\">0</Field><Field name=\"KlmJrn\" type=\"java.lang.String\">0</Field><Field name=\"KxmUsed\" type=\"java.lang.String\">null</Field><Field name=\"LastDate\" type=\"java.sql.Timestamp\">2012-12-20 14:38:47.0</Field><Field name=\"LastUser\" type=\"java.lang.String\">SUPERVISOR</Field><Field name=\"LogLevDet\" type=\"java.lang.String\">3</Field><Field name=\"OrdTrt\" type=\"com.sunopsis.sql.DbInt\">10</Field><Field name=\"SqlName\" type=\"java.lang.String\">Complie The java file</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpTxtHeader\"><Field name=\"Enc\" type=\"java.lang.String\">null</Field><Field name=\"EncKey\" type=\"java.lang.String\">null</Field><Field name=\"ITxt\" type=\"com.sunopsis.sql.DbInt\">3317091</Field><Field name=\"ITxtOrig\" type=\"com.sunopsis.sql.DbInt\">102</Field><Field name=\"SqlIndGrp\" type=\"java.lang.String\">0</Field><Field name=\"Txt\" type=\"java.lang.String\">OdiOSCommand \"-COMMAND=") ;
    out.print( odiRef.getOption("JAVA_HOME") ) ;
    out.print("/bin/javac -cp ") ;
    out.print(odiRef.getOption("JAVA_CP_JAR")) ;
    out.print("  ") ;
    out.print(odiRef.getOption("TEMP_JAVA_DIR")) ;
    out.print("/SendMailTLS.java\" \"-ERR_FILE=") ;
    out.print(odiRef.getOption("TEMP_JAVA_DIR")) ;
    out.print("/SendMailTLS_err.txt\" \"-OUT_FILE=") ;
    out.print(odiRef.getOption("TEMP_JAVA_DIR")) ;
    out.print("/SendMailTLS_out.txt\"</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpLineTrt\"><Field name=\"AlwaysExe\" type=\"java.lang.String\">1</Field><Field name=\"ColConnectId\" type=\"java.lang.String\">null</Field><Field name=\"ColContextCode\" type=\"java.lang.String\">null</Field><Field name=\"ColIndCommit\" type=\"java.lang.String\">null</Field><Field name=\"ColIsolLevel\" type=\"java.lang.String\">null</Field><Field name=\"ColITxt\" type=\"com.sunopsis.sql.DbInt\">null</Field><Field name=\"ColLschemaName\" type=\"java.lang.String\">null</Field><Field name=\"ColPlanComp\" type=\"java.lang.String\">null</Field><Field name=\"ColTechno\" type=\"java.lang.String\">FILE</Field><Field name=\"DefConnectId\" type=\"java.lang.String\">null</Field><Field name=\"DefContextCode\" type=\"java.lang.String\">null</Field><Field name=\"DefIndCommit\" type=\"java.lang.String\">null</Field><Field name=\"DefIsolLevel\" type=\"java.lang.String\">null</Field><Field name=\"DefITxt\" type=\"com.sunopsis.sql.DbInt\">3318091</Field><Field name=\"DefLschemaName\" type=\"java.lang.String\">null</Field><Field name=\"DefPlanComp\" type=\"java.lang.String\">null</Field><Field name=\"DefTechno\" type=\"java.lang.String\">SUNOPSIS_API</Field><Field name=\"FirstDate\" type=\"java.sql.Timestamp\">2012-12-20 14:28:40.0</Field><Field name=\"FirstUser\" type=\"java.lang.String\">SUPERVISOR</Field><Field name=\"IndErr\" type=\"java.lang.String\">0</Field><Field name=\"IndLogFinalCmd\" type=\"java.lang.String\">0</Field><Field name=\"IndLogMethod\" type=\"java.lang.String\">null</Field><Field name=\"IndLogNb\" type=\"java.lang.String\">null</Field><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"KcmAk\" type=\"java.lang.String\">0</Field><Field name=\"KcmCond\" type=\"java.lang.String\">0</Field><Field name=\"KcmErrDel\" type=\"java.lang.String\">0</Field><Field name=\"KcmJoin\" type=\"java.lang.String\">0</Field><Field name=\"KcmNull\" type=\"java.lang.String\">0</Field><Field name=\"KcmPk\" type=\"java.lang.String\">0</Field><Field name=\"KimDrvdSel\" type=\"java.lang.String\">0</Field><Field name=\"KimIdx\" type=\"java.lang.String\">0</Field><Field name=\"KimJrn\" type=\"java.lang.String\">0</Field><Field name=\"KimJrnPop\" type=\"java.lang.String\">0</Field><Field name=\"KjmCreate\" type=\"java.lang.String\">0</Field><Field name=\"KjmDrop\" type=\"java.lang.String\">0</Field><Field name=\"KjmExtend\" type=\"java.lang.String\">0</Field><Field name=\"KjmLock\" type=\"java.lang.String\">0</Field><Field name=\"KjmPurge\" type=\"java.lang.String\">0</Field><Field name=\"KjmSetInstall\" type=\"java.lang.String\">0</Field><Field name=\"KjmSetUninstall\" type=\"java.lang.String\">0</Field><Field name=\"KjmSubscribe\" type=\"java.lang.String\">0</Field><Field name=\"KjmTableOrder\" type=\"java.lang.String\">0</Field><Field name=\"KjmUnlock\" type=\"java.lang.String\">0</Field><Field name=\"KjmUnsubscribe\" type=\"java.lang.String\">0</Field><Field name=\"KlmAfterInt\" type=\"java.lang.String\">0</Field><Field name=\"KlmIdx\" type=\"java.lang.String\">0</Field><Field name=\"KlmJrn\" type=\"java.lang.String\">0</Field><Field name=\"KxmUsed\" type=\"java.lang.String\">null</Field><Field name=\"LastDate\" type=\"java.sql.Timestamp\">2012-12-20 14:38:47.0</Field><Field name=\"LastUser\" type=\"java.lang.String\">SUPERVISOR</Field><Field name=\"LogLevDet\" type=\"java.lang.String\">3</Field><Field name=\"OrdTrt\" type=\"com.sunopsis.sql.DbInt\">20</Field><Field name=\"SqlName\" type=\"java.lang.String\">Run the java file</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpTxtHeader\"><Field name=\"Enc\" type=\"java.lang.String\">null</Field><Field name=\"EncKey\" type=\"java.lang.String\">null</Field><Field name=\"ITxt\" type=\"com.sunopsis.sql.DbInt\">3318091</Field><Field name=\"ITxtOrig\" type=\"com.sunopsis.sql.DbInt\">102</Field><Field name=\"SqlIndGrp\" type=\"java.lang.String\">0</Field><Field name=\"Txt\" type=\"java.lang.String\">OdiOSCommand \"-COMMAND=") ;
    out.print( odiRef.getOption("JAVA_HOME") ) ;
    out.print("/bin/java -cp ") ;
    out.print(odiRef.getOption("JAVA_CP_JAR")) ;
    out.print(";") ;
    out.print(odiRef.getOption("TEMP_JAVA_DIR")) ;
    out.print(" SendMailTLS\" \"-ERR_FILE=") ;
    out.print(odiRef.getOption("TEMP_JAVA_DIR")) ;
    out.print("/SendMailTLS_err.txt\" \"-OUT_FILE=") ;
    out.print(odiRef.getOption("TEMP_JAVA_DIR")) ;
    out.print("/SendMailTLS_out.txt\"</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpLineTrtUe\"><Field name=\"ITrt\" type=\"com.sunopsis.sql.DbInt\">123091</Field><Field name=\"IUserExit\" type=\"com.sunopsis.sql.DbInt\">756091</Field><Field name=\"OrdTrt\" type=\"com.sunopsis.sql.DbInt\">30</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpImportRep\"><Field name=\"RepShortId\" type=\"com.sunopsis.sql.DbInt\">91</Field><Field name=\"RepTimestamp\" type=\"java.lang.String\">1334831213366</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpImportRep\"><Field name=\"RepShortId\" type=\"com.sunopsis.sql.DbInt\">92</Field><Field name=\"RepTimestamp\" type=\"java.lang.String\">1343117459745</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpImportRep\"><Field name=\"RepShortId\" type=\"com.sunopsis.sql.DbInt\">81</Field><Field name=\"RepTimestamp\" type=\"java.lang.String\">1334307846215</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpImportRep\"><Field name=\"RepShortId\" type=\"com.sunopsis.sql.DbInt\">3</Field><Field name=\"RepTimestamp\" type=\"java.lang.String\">1321309358956</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpImportRep\"><Field name=\"RepShortId\" type=\"com.sunopsis.sql.DbInt\">2</Field><Field name=\"RepTimestamp\" type=\"java.lang.String\">1277905827008</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpImportRep\"><Field name=\"RepShortId\" type=\"com.sunopsis.sql.DbInt\">11</Field><Field name=\"RepTimestamp\" type=\"java.lang.String\">1322240471835</Field></Object><Object class=\"com.sunopsis.dwg.dbobj.SnpImportRep\"><Field name=\"RepShortId\" type=\"com.sunopsis.sql.DbInt\">12</Field><Field name=\"RepTimestamp\" type=\"java.lang.String\">1330677667361</Field></Object><Object class=\"com.sunopsis.dwg.DwgExportSummary\"><Field name=\"ExpTxtNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"InstObjNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"JoinColNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"JoinNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"KeyColNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"KeyNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"LinkDiagNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"MorigTxtNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"MtxtNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"OrigTxtNb\" type=\"com.sunopsis.sql.DbInt\">4</Field><Field name=\"OtherObjectsNb\" type=\"com.sunopsis.sql.DbInt\">16</Field><Field name=\"PlanAgentNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"StepNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"TxtNb\" type=\"com.sunopsis.sql.DbInt\">8</Field><Field name=\"UeOrigNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"UeUsedNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"VarPlanAgentNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"ScenTxtNb\" type=\"com.sunopsis.sql.DbInt\">0</Field><Field name=\"OdiVersion\" type=\"java.lang.String\">11.1.1.6.0 - 19/12/2011</Field><Field name=\"OriginRepositoryID\" type=\"com.sunopsis.sql.DbInt\">91</Field><Field name=\"RepositoryVersion\" type=\"java.lang.String\">04.03.04.02</Field></Object></SunopsisExport>") ;
    ****** ORIGINAL TEXT ******
    <SunopsisExport><Admin RepositoryVersion="04.03.04.02"/><Object class="com.sunopsis.dwg.dbobj.SnpTrt"><Field name="ExtVersion" type="java.lang.String">null</Field><Field name="FirstDate" type="java.sql.Timestamp">2012-12-20 14:28:40.0</Field><Field name="FirstUser" type="java.lang.String">SUPERVISOR</Field><Field name="IndChange" type="java.lang.String">U</Field><Field name="IndJrnMethod" type="java.lang.String">S</Field><Field name="IndSuppSetBased" type="java.lang.String">null</Field><Field name="IntVersion" type="com.sunopsis.sql.DbInt">7</Field><Field name="IFolder" type="com.sunopsis.sql.DbInt">9091</Field><Field name="IProject" type="com.sunopsis.sql.DbInt">7091</Field><Field name="IScBaseTrt" type="com.sunopsis.sql.DbInt">null</Field><Field name="IScOrigTrt" type="com.sunopsis.sql.DbInt">null</Field><Field name="IScTrt" type="com.sunopsis.sql.DbInt">null</Field><Field name="IState" type="com.sunopsis.sql.DbInt">null</Field><Field name="ITrt" type="com.sunopsis.sql.DbInt">123091</Field><Field name="ITxtTrtTxt" type="com.sunopsis.sql.DbInt">3311091</Field><Field name="KimMultiDserver" type="java.lang.String">0</Field><Field name="KmDefault" type="java.lang.String">0</Field><Field name="KmSrcTechno" type="java.lang.String">null</Field><Field name="KmTechno" type="java.lang.String">null</Field><Field name="KmVersion" type="java.lang.String">null</Field><Field name="LastDate" type="java.sql.Timestamp">2012-12-20 14:40:22.0</Field><Field name="LastUser" type="java.lang.String">SUPERVISOR</Field><Field name="LChecksum" type="com.sunopsis.sql.DbInt">2221</Field><Field name="LCode" type="java.lang.String">null</Field><Field name="OrdFolder" type="com.sunopsis.sql.DbInt">null</Field><Field name="TrtName" type="java.lang.String">SendGmailTLS</Field><Field name="TrtType" type="java.lang.String">U</Field><Field name="VLastDate" type="java.sql.Timestamp">null</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpTxtHeader"><Field name="Enc" type="java.lang.String">null</Field><Field name="EncKey" type="java.lang.String">null</Field><Field name="ITxt" type="com.sunopsis.sql.DbInt">3311091</Field><Field name="ITxtOrig" type="com.sunopsis.sql.DbInt">107</Field><Field name="SqlIndGrp" type="java.lang.String">0</Field><Field name="Txt" type="java.lang.String">COMPONENT NAME: SendGmailTLS
    AUTHOR: Bhabani Ranjan Mahapatra
    EMAIL    : [email protected]
    BLOG     : http://dwteam.in
    DESCRIPTION:
    This procedure is required to send email using gmail credentials.</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpOrigTxt"><Field name="ITxtOrig" type="com.sunopsis.sql.DbInt">107</Field><Field name="OrigineName" type="java.lang.String">Edit Command</Field><Field name="SnpsCol" type="java.lang.String">I_TXT_TRT_TXT</Field><Field name="SnpsTable" type="java.lang.String">SNP_TRT</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpUserExit"><Field name="ExtVersion" type="java.lang.String">null</Field><Field name="IndChange" type="java.lang.String">I</Field><Field name="ITrt" type="com.sunopsis.sql.DbInt">123091</Field><Field name="ITxtUeHelp" type="com.sunopsis.sql.DbInt">null</Field><Field name="ITxtValue" type="com.sunopsis.sql.DbInt">null</Field><Field name="IUserExit" type="com.sunopsis.sql.DbInt">756091</Field><Field name="Position" type="com.sunopsis.sql.DbInt">30</Field><Field name="ShortValue" type="java.lang.String">0</Field><Field name="UeName" type="java.lang.String">DELETE_TEMP_FILES</Field><Field name="UeSdesc" type="java.lang.String">Remove temp files</Field><Field name="UeType" type="java.lang.String">C</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpUserExit"><Field name="ExtVersion" type="java.lang.String">null</Field><Field name="IndChange" type="java.lang.String">I</Field><Field name="ITrt" type="com.sunopsis.sql.DbInt">123091</Field><Field name="ITxtUeHelp" type="com.sunopsis.sql.DbInt">null</Field><Field name="ITxtValue" type="com.sunopsis.sql.DbInt">3312091</Field><Field name="IUserExit" type="com.sunopsis.sql.DbInt">758091</Field><Field name="Position" type="com.sunopsis.sql.DbInt">null</Field><Field name="ShortValue" type="java.lang.String">null</Field><Field name="UeName" type="java.lang.String">BODY</Field><Field name="UeSdesc" type="java.lang.String">null</Field><Field name="UeType" type="java.lang.String">T</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpTxtHeader"><Field name="Enc" type="java.lang.String">null</Field><Field name="EncKey" type="java.lang.String">null</Field><Field name="ITxt" type="com.sunopsis.sql.DbInt">3312091</Field><Field name="ITxtOrig" type="com.sunopsis.sql.DbInt">110</Field><Field name="SqlIndGrp" type="java.lang.String">0</Field><Field name="Txt" type="java.lang.String">Its a Mail from ODI Studio.\nThank You</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpOrigTxt"><Field name="ITxtOrig" type="com.sunopsis.sql.DbInt">110</Field><Field name="OrigineName" type="java.lang.String">Text value</Field><Field name="SnpsCol" type="java.lang.String">I_TXT_VALUE</Field><Field name="SnpsTable" type="java.lang.String">SNP_USER_EXIT</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpUserExit"><Field name="ExtVersion" type="java.lang.String">null</Field><Field name="IndChange" type="java.lang.String">I</Field><Field name="ITrt" type="com.sunopsis.sql.DbInt">123091</Field><Field name="ITxtUeHelp" type="com.sunopsis.sql.DbInt">3313091</Field><Field name="ITxtValue" type="com.sunopsis.sql.DbInt">null</Field><Field name="IUserExit" type="com.sunopsis.sql.DbInt">759091</Field><Field name="Position" type="com.sunopsis.sql.DbInt">null</Field><Field name="ShortValue" type="java.lang.String"><?= java.lang.System.getProperty("java.home").matches(".*jre")?java.lang.System.getProperty("java.home")+"/..":java.lang.System.getProperty("java.home") ?></Field><Field name="UeName" type="java.lang.String">JAVA_HOME</Field><Field name="UeSdesc" type="java.lang.String">Location of the JDK</Field><Field name="UeType" type="java.lang.String">V</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpTxtHeader"><Field name="Enc" type="java.lang.String">null</Field><Field name="EncKey" type="java.lang.String">null</Field><Field name="ITxt" type="com.sunopsis.sql.DbInt">3313091</Field><Field name="ITxtOrig" type="com.sunopsis.sql.DbInt">111</Field><Field name="SqlIndGrp" type="java.lang.String">0</Field><Field name="Txt" type="java.lang.String">
    Examples:
      $ODI_JAVA_HOME on Unix
      %ODI_JAVA_HOME% on Windows
      /usr/lib/jvm/java-7-openjdk-amd64</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpOrigTxt"><Field name="ITxtOrig" type="com.sunopsis.sql.DbInt">111</Field><Field name="OrigineName" type="java.lang.String">User Exit help</Field><Field name="SnpsCol" type="java.lang.String">I_TXT_UE_HELP</Field><Field name="SnpsTable" type="java.lang.String">SNP_USER_EXIT</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpUserExit"><Field name="ExtVersion" type="java.lang.String">null</Field><Field name="IndChange" type="java.lang.String">I</Field><Field name="ITrt" type="com.sunopsis.sql.DbInt">123091</Field><Field name="ITxtUeHelp" type="com.sunopsis.sql.DbInt">3314091</Field><Field name="ITxtValue" type="com.sunopsis.sql.DbInt">null</Field><Field name="IUserExit" type="com.sunopsis.sql.DbInt">765091</Field><Field name="Position" type="com.sunopsis.sql.DbInt">null</Field><Field name="ShortValue" type="java.lang.String">C:/oracle/product/11.1.1/Oracle_ODI_1/oracledi.sdk/lib/mail.jar</Field><Field name="UeName" type="java.lang.String">JAVA_CP_JAR</Field><Field name="UeSdesc" type="java.lang.String">Provide the jar name with location</Field><Field name="UeType" type="java.lang.String">V</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpTxtHeader"><Field name="Enc" type="java.lang.String">null</Field><Field name="EncKey" type="java.lang.String">null</Field><Field name="ITxt" type="com.sunopsis.sql.DbInt">3314091</Field><Field name="ITxtOrig" type="com.sunopsis.sql.DbInt">111</Field><Field name="SqlIndGrp" type="java.lang.String">0</Field><Field name="Txt" type="java.lang.String">mail.jar is required for this java file.</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpUserExit"><Field name="ExtVersion" type="java.lang.String">null</Field><Field name="IndChange" type="java.lang.String">I</Field><Field name="ITrt" type="com.sunopsis.sql.DbInt">123091</Field><Field name="ITxtUeHelp" type="com.sunopsis.sql.DbInt">null</Field><Field name="ITxtValue" type="com.sunopsis.sql.DbInt">null</Field><Field name="IUserExit" type="com.sunopsis.sql.DbInt">761091</Field><Field name="Position" type="com.sunopsis.sql.DbInt">null</Field><Field name="ShortValue" type="java.lang.String">[email protected]</Field><Field name="UeName" type="java.lang.String">FROM</Field><Field name="UeSdesc" type="java.lang.String">FROM</Field><Field name="UeType" type="java.lang.String">V</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpUserExit"><Field name="ExtVersion" type="java.lang.String">null</Field><Field name="IndChange" type="java.lang.String">I</Field><Field name="ITrt" type="com.sunopsis.sql.DbInt">123091</Field><Field name="ITxtUeHelp" type="com.sunopsis.sql.DbInt">null</Field><Field name="ITxtValue" type="com.sunopsis.sql.DbInt">null</Field><Field name="IUserExit" type="com.sunopsis.sql.DbInt">762091</Field><Field name="Position" type="com.sunopsis.sql.DbInt">null</Field><Field name="ShortValue" type="java.lang.String">Mail From ODI</Field><Field name="UeName" type="java.lang.String">SUBJECT</Field><Field name="UeSdesc" type="java.lang.String">Subject</Field><Field name="UeType" type="java.lang.String">V</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpUserExit"><Field name="ExtVersion" type="java.lang.String">null</Field><Field name="IndChange" type="java.lang.String">I</Field><Field name="ITrt" type="com.sunopsis.sql.DbInt">123091</Field><Field name="ITxtUeHelp" type="com.sunopsis.sql.DbInt">null</Field><Field name="ITxtValue" type="com.sunopsis.sql.DbInt">null</Field><Field name="IUserExit" type="com.sunopsis.sql.DbInt">763091</Field><Field name="Position" type="com.sunopsis.sql.DbInt">null</Field><Field name="ShortValue" type="java.lang.String">C:/Users/Public</Field><Field name="UeName" type="java.lang.String">TEMP_JAVA_DIR</Field><Field name="UeSdesc" type="java.lang.String">Temp Java File Location</Field><Field name="UeType" type="java.lang.String">V</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpUserExit"><Field name="ExtVersion" type="java.lang.String">null</Field><Field name="IndChange" type="java.lang.String">U</Field><Field name="ITrt" type="com.sunopsis.sql.DbInt">123091</Field><Field name="ITxtUeHelp" type="com.sunopsis.sql.DbInt">null</Field><Field name="ITxtValue" type="com.sunopsis.sql.DbInt">null</Field><Field name="IUserExit" type="com.sunopsis.sql.DbInt">764091</Field><Field name="Position" type="com.sunopsis.sql.DbInt">null</Field><Field name="ShortValue" type="java.lang.String">null</Field><Field name="UeName" type="java.lang.String">USERNAME</Field><Field name="UeSdesc" type="java.lang.String">null</Field><Field name="UeType" type="java.lang.String">T</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpUserExit"><Field name="ExtVersion" type="java.lang.String">null</Field><Field name="IndChange" type="java.lang.String">U</Field><Field name="ITrt" type="com.sunopsis.sql.DbInt">123091</Field><Field name="ITxtUeHelp" type="com.sunopsis.sql.DbInt">null</Field><Field name="ITxtValue" type="com.sunopsis.sql.DbInt">null</Field><Field name="IUserExit" type="com.sunopsis.sql.DbInt">757091</Field><Field name="Position" type="com.sunopsis.sql.DbInt">null</Field><Field name="ShortValue" type="java.lang.String">null</Field><Field name="UeName" type="java.lang.String">PASSWORD</Field><Field name="UeSdesc" type="java.lang.String">null</Field><Field name="UeType" type="java.lang.String">T</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpUserExit"><Field name="ExtVersion" type="java.lang.String">null</Field><Field name="IndChange" type="java.lang.String">I</Field><Field name="ITrt" type="com.sunopsis.sql.DbInt">123091</Field><Field name="ITxtUeHelp" type="com.sunopsis.sql.DbInt">null</Field><Field name="ITxtValue" type="com.sunopsis.sql.DbInt">null</Field><Field name="IUserExit" type="com.sunopsis.sql.DbInt">760091</Field><Field name="Position" type="com.sunopsis.sql.DbInt">null</Field><Field name="ShortValue" type="java.lang.String">[email protected]</Field><Field name="UeName" type="java.lang.String">TO</Field><Field name="UeSdesc" type="java.lang.String">Target User ID</Field><Field name="UeType" type="java.lang.String">V</Field></Object><Object class="com.sunopsis.dwg.dbobj.SnpLineTrt"><Field name="AlwaysExe" type="java.lang.String">0</Field><Field name="ColConnectId" type="java.lang.String">null</Field><Field name="ColContextCode" type="java.lang.String">null</Field><Field name="ColIndCommit" type="java.lang.String">null</Field><Field name="ColIsolLevel" type="java.lang.String">null</Field><Field name="ColITxt" type="com.sunopsis.sql.DbInt">null</Field><Field name="ColLschemaName" type="java.lang.String">null</Field><Field name="ColPlanComp" type="java.lang.String">null</Field><Field name="ColTechno" type="java.lang.String">null</Field><Field name="DefConnectId" type="java.lang.String">null</Field><Field name="DefContextCode" type="java.lang.String">null</Field><Field name="DefIndCommit" type="java.lang.String">null</Field><Field name="DefIsolLevel" type="java.lang.String">null</Field><Field name="DefITxt" type="com.sunopsis.sql.DbInt">3315091</Field><Field name="DefLschemaName" type="java.lang.String">null</Field><Field name="DefPlanComp" type="java.lang.String">null</Field><Field name="DefTechno" type="java.lang.String">SUNOPSIS_API</Field><Field name="FirstDate" type="java.sql.Timestamp">2012-12-20 14:28:40.0</Field><Field name="FirstUser" type="java.lang.String">SUPERVISOR</Field><Field name="IndErr" type="java.lang.String">0</Field><Field name="IndLogFinalCmd" type="java.lang.String">0</Field><Field name="IndLogMethod" type="java.lang.String">null</Field><Field name="IndLogNb" type="java.lang.String">null</Field><Field name="ITrt" type="com.sunopsis.sql.DbInt">123091</Field><Field name="KcmAk" type="java.lang.String">0</Field><Field name="KcmCond" type="java.lang.String">0</Field><Field name="KcmErrDel" type="java.lang.String">0</Field><Field name="KcmJoin" type="java.lang.String">0</Field><Field name="KcmNull" type="java.lang.String">0</Field><Field name="KcmPk" type="java.lang.String">0</Field><Field name="KimDrvdSel" type="java.lang.String">0</Field><Field name="KimIdx" type="java.lang.String">0</Field><Field name="KimJrn" type="java.lang.String">0</Field><Field name="KimJrnPop" type="java.lang.String">0</Field><Field name="KjmCreate" type="java.lang.String">0</Field><Field name="KjmDrop" type="java.lang.String">0</Field><Field name="KjmExtend" type="java.lang.String">0</Field><Field name="KjmLock" type="java.lang.String">0</Field><Field name="KjmPurge" type="java.lang.String">0</Field><Field name="KjmSetInstall" type="java.lang.String">0</Field><Field name="KjmSetUninstall" type="java.lang.String">0</Field><Field name="KjmSubscribe" type="java.lang.String">0</Field><Field name="KjmTableOrder" type="java.lang.String">0</Field><Field name="KjmUnlock" type="java.lang.String">0</Field><Field name="KjmUnsubscribe" type="java.lang.String">0</Field><Field name="KlmAfterInt" type="java.lang.String">0&

  • ODI HTML Mail error

    Hello All,
    I am unable to send a mail using ODI send Mail. As an alternative i downloaded the jython script "TRT_Send_Jython_HTML_Email.xml" from the oracle support.
    When i am trying to execute the above procedure i am getting the following error.
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (most recent call last):
    File "<string>", line 3, in <module>
    File "C:\ODI11\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\Lib\smtplib.py", line 676, in sendmail
    if not (200 <= self.ehlo()[0] <= 299):
    File "C:\ODI11\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\Lib\smtplib.py", line 398, in ehlo
    (code,msg)=self.getreply()
    File "C:\ODI11\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\Lib\smtplib.py", line 352, in getreply
    line = self.file.readline()
    File "C:\ODI11\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\Lib\socket.py", line 1347, in readline
    data = self._sock.recv(self._rbufsize)
    File "C:\ODI11\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\Lib\socket.py", line 902, in recv
    raise mapexception(jlx)
    socket.error: (55, 'Software caused connection abort')
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
         at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:346)
         at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:170)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java:2458)
         at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:48)
         at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:1)
         at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2906)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2609)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:540)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:453)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1740)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:338)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:214)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:272)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:263)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:822)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:123)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:83)
         at java.lang.Thread.run(Thread.java:662)
    please help me in this...
    thanks
    Ravikiran

    Why can't you use ODI sendmail? Are you getting an error from it? I've used it successfully for some time now.
    The socket error tells me there's a network problem. Are you able to send e-mail from the machine where the ODI agent is? Did you try telnet <your SMTP server IP> 25 ?

  • Flat file to table - send mail report on error

    Hello,
    I've created simple project - loading data from csv flat file to oracle database table, using this tutorial: http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_flatfile-to-table/odi_project_flatfile-to-table.htm. Now, I need to add support for sending mail to this project. Mail, with error descritpion should be sent to Administrator via smtp server when error occurs.
    Can you provide any step by step description how to add this feature in my case? I know this should be possible via ODISendMail, but I was unable to find any basic, step by step tutorial. Can you help me?

    960949 wrote:
    Ok, so is there any other solution to send mail? I found this post: Send Jython HTML Email Error but link to procedure is inactive: https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=HOWTO&id=424304.1
    You need to login to My Oracle Support in order to download the procedure code .
    For this you need a valid Oracle CSI

  • How to send Mail in case of Output Determination - Transmission medium 5

    Dear Friends,
    I have a below requirement.
    - Create custom output type having Transmission medium 5, which triggers on creation of order.
    - Write driver program attached to that output type that sends e-mail to the person who has created the order.
    - Mail contain information regarding pricing for individual line item wise.
    I have gone through many posts but not sure about process of generate the mail in case of Transmission medium 5.
    My query is:
    Do we require to write FM (SO_NEW_DOCUMENT_ATT_SEND_API1) to send e-mail to respective person or it will take care by system (Transmission medium 5)?
    If FM not required then how can we write code that triggers the mail to specific mail ID?
    Nilay

    Yes, for your custom requirement you will have to create a Z report.
    LIke your requirement must be to put something specific in mail body or attach something with mail. All this will not be catered by the standard report maintained against your output type and transmission medium.
    As i understand for any output type a message is triggerd and stored in database table (like NAST) and then these requests are picked by standard report (like RSNAST00). These reports then in return call the Program/form maintained against the ouptut type and transmission medium (table TNAPR).
    So i would suggest that create a custom report and use the FM for sending mails. These FMs are pretty simple to use. Find a sample code in the below link:
    [http://wiki.sdn.sap.com/wiki/display/ABAP/SendExternalMailwithattachment]

  • Sending mail with multiple attachment

    hi.
    i want to send mail with multiple attachment.
    i m succeed in sending multiple attachment but the second pdf is not open.
    its given error like "This file is damaged and could not be open.
    pls check my code. and
    give the solution....
    point should be assured...........
    hope all u r understand my problem..
    & tell me where is i m missing something.
    REPORT  YSDPASALE1_MAIL LINE-SIZE 110.
    data : year_month(6) type c.
    data : from_date like sy-datum,to_date like sy-datum.
    INITIALIZATION.
    year_month = sy-datum+0(6).
    CONCATENATE year_month '01' into from_date.
    to_date = sy-datum.
    ranges : temp for mkpf-budat.
    temp-low = from_date.
    temp-high = to_date.
    append temp to temp.
    DATA: P_JOBCNT LIKE TBTCJOB-JOBCOUNT,
           jobname like TBTCJOB-JOBNAME,
           L_RELEASE(1) TYPE c.
    CONSTANTS : l_c_device(4)    VALUE 'LOCL'.
    DATA : t type i value 0.
    DATA : p_email1 like somlreci1-receiver,
            p_sender LIKE somlreci1-receiver.
    Data Declaration
    DATA: gd_recsize TYPE i,gd_recsize1 TYPE i.
    Spool IDs
    TYPES: BEGIN OF t_tbtcp.
            INCLUDE STRUCTURE tbtcp.
    TYPES: END OF t_tbtcp.
    DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
          wa_tbtcp TYPE t_tbtcp.
    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.
    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,
          it_mess_att1 LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          it_mess_att2 LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          gd_sender_type     LIKE soextreci1-adr_typ,
          gd_attachment_desc TYPE so_obj_nam,
          gd_attachment_desc1 TYPE so_obj_nam,
          gd_attachment_name TYPE so_obj_des,
          gd_mtitle LIKE sodocchgi1-obj_descr.
    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.
    CONSTANTS: c_dev LIKE  sy-sysid VALUE 'DEV',
               c_no(1)     TYPE c   VALUE ' ',
               c_device(4) TYPE c   VALUE 'LOCL'.
    Binary store for PDF
    DATA: BEGIN OF it_pdf_output OCCURS 0.
            INCLUDE STRUCTURE tline.
    DATA: END OF it_pdf_output.
    DATA: BEGIN OF mailstr OCCURS 0,
            p_email like somlreci1-receiver,
          END OF mailstr.
    DATA: mailtab like STANDARD TABLE OF mailstr WITH HEADER LINE.
    DATA: ypp18tab like STANDARD TABLE OF mailstr WITH HEADER LINE,
          ymis008tab like STANDARD TABLE OF mailstr WITH HEADER LINE,
          ysd15tab like STANDARD TABLE OF mailstr WITH HEADER LINE,
          ymis10tab like STANDARD TABLE OF mailstr WITH HEADER LINE.
    SUBMIT YSDPASALE1 with bdt in temp
                           to sap-spool
                          with line-size = '255'
                           with KEEP_IN_SPOOL = 'X'
                           with IMMEDIATELY = ' '
                           WITHOUT SPOOL DYNPRO
                           AND RETURN
       NEW-PAGE PRINT ON
       DESTINATION l_c_device
       IMMEDIATELY ' '
       KEEP IN SPOOL 'X'
       NEW LIST IDENTIFICATION 'X'
       NO DIALOG.
       new-page print off.
      IF sy-batch EQ 'X'.
        PERFORM get_job_details.
        PERFORM obtain_spool_id.
        PERFORM convert_spool_to_pdf.
        select yemail as p_email into CORRESPONDING FIELDS OF TABLE ymis008tab
          from ymail
          where ytcode = 'YMIS008'.
    ELSE.
       SKIP.
       WRITE:/ 'Program must be executed in background in-order for spool & mail sending',
               'request to be created.'.
      ENDIF.
    wait up to 3 seconds.
      submit YSD_MONTHLY_SALES
                                USING SELECTION-SET 'MAIL'
                                to sap-spool
                               with KEEP_IN_SPOOL = 'X'
                               with IMMEDIATELY = ' ' "SPACE
                               WITHOUT SPOOL DYNPRO
                               AND RETURN
       NEW-PAGE PRINT ON
       DESTINATION l_c_device
       IMMEDIATELY ' '
       KEEP IN SPOOL 'X'
       NEW LIST IDENTIFICATION 'X'
       NO DIALOG.
       new-page print off.
        IF sy-batch EQ 'X'.
        gd_attachment_desc1  = 'YMIS10'.
        gd_mtitle = 'Monthly Sales Report'.
        PERFORM get_job_details.
        PERFORM obtain_spool_id.
        PERFORM convert_spool_to_pdf1.
       loop at it_mess_att.
        move it_mess_att1 to it_mess_att.
        APPEND it_mess_att.
       endloop.
       APPEND LINES OF it_mess_att1 to it_mess_att.
       free it_mess_att1.
        it_mess_att[] = it_mess_att1[].
        insert LINES OF it_mess_att1 into it_mess_att.
        APPEND LINES OF it_mess_att2 to it_mess_att .
         insert LINES OF it_mess_att1 into it_mess_att.
         insert LINES OF it_mess_att2 into it_mess_att.
       loop at ymis008tab into mailstr.
         p_email1 = mailstr-p_email.
          p_email1 = '[email protected]'.
           PERFORM process_email.
       endloop.
           clear mailstr.
          wait up to 5 seconds.
          SUBMIT rsconn01 WITH mode   = 'INT'
                          WITH output = 'X'
                          AND RETURN.
      ELSE.
        SKIP.
      ENDIF.
          FORM obtain_spool_id                                          *
    FORM obtain_spool_id.
      CHECK NOT ( gd_jobname IS INITIAL ).
      CHECK NOT ( gd_jobcount IS INITIAL ).
      SELECT * FROM  tbtcp
                     INTO TABLE it_tbtcp
                     WHERE      jobname     = gd_jobname
                     AND        jobcount    = gd_jobcount
                     AND        stepcount   = gd_stepcount
                     AND        listident   <> '0000000000'
                     ORDER BY   jobname
                                jobcount
                                stepcount.
      READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
      IF sy-subrc = 0.
        message s004(zdd) with gd_spool_nr.
        gd_spool_nr = wa_tbtcp-listident.
        MESSAGE s004(zdd) WITH gd_spool_nr.
      ELSE.
        MESSAGE s005(zdd).
      ENDIF.
    ENDFORM.
          FORM get_job_details                                          *
    FORM get_job_details.
    Get current job details
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
           IMPORTING
                eventid                 = gd_eventid
                eventparm               = gd_eventparm
                external_program_active = gd_external_program_active
                jobcount                = gd_jobcount
                jobname                 = gd_jobname
                stepcount               = gd_stepcount
           EXCEPTIONS
                no_runtime_info         = 1
                OTHERS                  = 2.
    ENDFORM.
          FORM convert_spool_to_pdf                                     *
    FORM convert_spool_to_pdf.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount            = gd_bytecount
           TABLES
                pdf                      = it_pdf_output
           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.
      CHECK sy-subrc = 0.
    Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output 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.
    ENDFORM.
    FORM convert_spool_to_pdf1.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount            = gd_bytecount
           TABLES
                pdf                      = it_pdf_output
           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.
      CHECK sy-subrc = 0.
    Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att1 = gd_buffer.
        APPEND it_mess_att1.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.
          FORM process_email                                            *
    FORM process_email.
      DESCRIBE TABLE it_mess_att LINES gd_recsize.
      DESCRIBE TABLE it_mess_att1 LINES gd_recsize1.
      CHECK gd_recsize > 0 or gd_recsize1 > 0.
      PERFORM send_email." USING p_email1.
    perform send_email using p_email2.
    ENDFORM.
          FORM send_email                                               *
    -->  p_email                                                       *
    FORM send_email." USING p_email.
    CHECK NOT ( p_email IS INITIAL ).
      REFRESH it_mess_bod.
    Default subject matter
      gd_subject         = 'Subject'.
      gd_attachment_desc = gd_attachment_desc1 .
    gd_attachment_desc = 'YPP18 - Daily Highlights'.
    CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
      it_mess_bod        = 'Dear Sir,'.
      APPEND it_mess_bod.
    it_mess_bod        = ' '.
    APPEND it_mess_bod.
      it_mess_bod        = ' '.
      APPEND it_mess_bod.
      it_mess_bod        = 'kindly find the attached document'.
      APPEND it_mess_bod.
    it_mess_bod        = ' '.
    APPEND it_mess_bod.
    it_mess_bod        = 'Do not reply on this mail, It is generated from SAP'.
    APPEND it_mess_bod.
    it_mess_bod        = ' '.
    APPEND it_mess_bod.
      it_mess_bod        = ' '.
      APPEND it_mess_bod.
      it_mess_bod        = 'Regards,'.
      APPEND it_mess_bod.
      it_mess_bod        = 'Arpit Shah'.
      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
                                          it_mess_att1
                                    using "p_email
                                          gd_mtitle
                                         'Testing mail generated from SAP'
                                         'Daily Highlights Abstract Report - YPP18'
                                          'PDF'
                                          gd_attachment_name
                                          gd_attachment_desc
                                          p_sender
                                          gd_sender_type
                                 changing gd_error
                                          gd_reciever.
    ENDFORM.
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    FORM send_file_as_email_attachment tables it_message
                                              it_attach
                                              it_attach1
                                        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,w_doc_data1 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_address.
      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_data1-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[].
    For 2nd Attachments
    * Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach1 INDEX w_cnt.
      w_doc_data-doc_size = w_doc_data1-doc_size +
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach1 ).
      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.
    APPEND LINES OF it_attach1 to t_attachment.
      t_attachment[] = it_attach1[].
    APPEND LINES OF it_attach1 to t_attachment.
    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   = 0.
      t_packing_list-body_start = 1.
    DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
    DESCRIBE TABLE it_mess_att LINES t_packing_list-body_num.
      DESCRIBE TABLE it_attach LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  'YMIS008'."ld_attdescription.
      t_packing_list-obj_name   =  'YMIS008'."ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
      clear t_packing_list.
    for 2 attachments
      data : a type i,b type i.
       a = t_packing_list-body_num.
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 0.
      t_packing_list-body_start = a + 1. "1
    DESCRIBE TABLE it_mess_att1 LINES t_packing_list-body_num.
      DESCRIBE TABLE it_attach1 LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  'YMIS10'."ld_attdescription.
      t_packing_list-obj_name   =  'YMIS10'."ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    a = t_packing_list-body_num.
    clear 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 = a + 1.
    t_packing_list-body_num = t_packing_list-body_num + 1.
    DESCRIBE TABLE it_mess_att1 LINES t_packing_list-body_num.
    t_packing_list-body_num = a + t_packing_list-body_num .
    t_packing_list-doc_type   =  ld_format.
    t_packing_list-obj_descr  =  'YMIS10'."ld_attdescription.
    t_packing_list-obj_name   =  'YMIS10'."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.
    loop at ymis008tab into mailstr.
      t_receivers-receiver = mailstr-p_email.  "ld_email.
      t_receivers-receiver = p_email1.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'. "X   "Read Acknoledgement
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
    endloop.
       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.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    Rgds.
    Arpit

    Hi Arpit,
    Take a look at the documentation of FM 'SO_DOCUMENT_SEND_API1' for parameter PACKING_LIST. I think you should set t_packing_list-head_num to a different value than 0 for the second attachment.
    Regards,
    John.

  • Sender Mail Adapter

    Hi,
      I am working on Sender Mail Adapter. I have done the total configuration but unable to sucess the scenarios. In the CC monitoring, it is saying that "Not Intialised" Even though i send and receive the messages from My Lotus Notes Inbox. I activated all the objects.
    I have done the following examples:
    Transport Protocal: POP3
    Message Protocal: XIALL
    Given the URL and UserId and PWD also
    Poll Intevel: 1 (Mins)
    Adapter Status: Active
    Please help to me solve this problem. I already raised the one more thread today but didn't get solutions.
    <b>Note: Do i need to do any setting from the Lotus notes(Mail Server) to diver my messages.</b>
    Thanks in Advance,
    <b>I found the problem with SMTP Address. Can i use the SMTP Url for POP3 or IMP4 protocal. Is there any thing else because if i use the Same SMTP Address, it is giving exception</b>
    Best Regards,
    Vijay
    Message was edited by:
            Gangisetty Vijaya Bhaskarudu
    Message was edited by:
            Gangisetty Vijaya Bhaskarudu

    Hi Gangisetty,
        SMTP is the out going server(for sending mails out) while POP3 is the in coming(receiving mails) server. So for a sender channel, you need to use the POP server details not SMTP.
    cheers
    danus

  • Sender Mail Adapter - forcing content as an attachement

    Hi all,
    We are using the Sender Mail Adapter to pull emails from the inboxes of some users of an exchange server.  We use the Mail Package option.
    We have noticed that the content of the emails are by-default added as attachments when there are no real attachments to the emails.  However the content is not added as an attachment when one or more attachments are present in these emails.
    Is there a way of forcing the Sender Mail Adapter to always add the content as an attachment and keeping the other attachments as well?  and of course maintain the Mail Package message type as the main payload...?
    Many thanks,
    Aldo

    Hi Stefan,
    Thanks for your reply.  I am glad to hear that I am wrong again )
    In your opinion is it possible to force the Outlook Exchange server to add the content attachment every time?  I mean by doing some configuration on it...?
    The reason why we would like to do this is because when - in the content tag of a Mail Package message - we have MIME message parts that are of content-type text/html we are having problems in decoding the html back to a readable format.
    To do this we use the apache QuotedPrintableCodec Java class.
    This works fine when the content type of the message is just text/plain but we get an exception when we try with text/html.
    The exception we get is:
    org.apache.commons.codec.DecoderException: Invalid URL encoding: not a valid digit (radix 16): 13
    I don't know if this is because of the two character sets we have in the payload (utf-8 and iso-8859-1) or if it is for other reasons...
    If you could help me figure out how to forward any HTML email to another system in a readable format it would be great.
    Thanks for your support,
    Aldo

  • Sender Mail Adapter Configuration - Process Multiple Attachments

    Dear sirs,
    I need to process several attachments at the same mail message as individual payloads.
    In default configuration of sender mail adapter only the body of message is used as payload.
    So I added PayloadSwapBean Module at Processing Sequence and it processed the attachment I set in Module Configuration.  I'm not able to process all attachments available, just one attachment is sent to PI pipeline.
    How can I process all attachments of a single mail message?
    Thank you in advance.
    Fabio Purcino

    Hi Jose,
    We are trying to implement reading multiple attachment in sender mail adapter. 
    Our Requirement is : Reading a mail having multiple .xls files. This should be read and converted to payload .
    package multiswap;
    //import com.sap.aii.adapter.xi.ms.XIMessage;
    import com.sap.aii.af.lib.mp.module.*;
    import com.sap.aii.af.lib.trace.Trace;
    import com.sap.aii.af.sdk.xi.mo.Message;
    import com.sap.aii.af.sdk.xi.mo.MessageContext;
    import com.sap.aii.af.sdk.xi.mo.xmb.XMBMessageOperator;
    import com.sap.aii.af.sdk.xi.mo.xmb.XMBPayload;
    import com.sap.aii.af.sdk.xi.util.PayloadType;
    import com.sap.aii.af.service.auditlog.Audit;
    import com.sap.aii.af.service.cpa.*;
    import com.sap.engine.interfaces.messaging.api.MessageDirection;
    import com.sap.engine.interfaces.messaging.api.MessageKey;
    import com.sap.engine.interfaces.messaging.api.Payload;
    import com.sap.engine.interfaces.messaging.api.auditlog.AuditLogStatus;
    import java.util.Hashtable;
    import java.util.Iterator;
    import java.util.Locale;
    import javax.ejb.*;
    public class MultiSwapRead
        implements SessionBean, Module
        private static final String VERSION_ID = "$Id: //tc/xpi.af/NW731EXT_07_REL/src/_af_application_ejb_module/ejbm/api/com/sap" +
    "/aii/af/app/modules/PayloadSwapBean.java#1 $"
        private static final Trace TRACE = new Trace("$Id: //tc/xpi.af/NW731EXT_07_REL/src/_af_application_ejb_module/ejbm/api/com/sap" +
    "/aii/af/app/modules/PayloadSwapBean.java#1 $"
        private static final String SIGNATURE_PROCESS = "process(ModuleContext , ModuleData)";
        protected Hashtable cachedChannels;
        protected SessionContext myContext;
        public MultiSwapRead()
            cachedChannels = new Hashtable();
        public void ejbRemove()
        public void ejbActivate()
        public void ejbPassivate()
        public void setSessionContext(SessionContext context)
            myContext = context;
        public void ejbCreate()
            throws CreateException
        public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
            throws ModuleException
            if(TRACE.beLogged(200))
                TRACE.entering("process(ModuleContext , ModuleData)", new Object[] {
                    moduleContext, inputModuleData
            ModuleData outputModuleData;
            Iterator itr;
            outputModuleData = inputModuleData;
            String chid = moduleContext.getChannelID();
            TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, (new StringBuilder()).append("performing payload swap for channel ").append(chid).toString());
            LookupManager lman = LookupManager.getInstance();
            Channel chan = null;
      try {
      chan = (Channel)LookupManager.getInstance().getCPAObject(CPAObjectType.CHANNEL, chid);
      } catch (CPAObjectNotFoundException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
      } catch (CPAException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
            Direction direction = chan.getDirection();
            String swapkey = moduleContext.getContextData("swap.keyName");
            String keyvalue = moduleContext.getContextData("swap.keyValue");
            Object obj = inputModuleData.getPrincipalData();
            Object pivotedObj = inputModuleData.getSupplementalData("mp.pivoted");
            boolean pivoted = pivotedObj == null || !(pivotedObj instanceof Boolean) ? false : ((Boolean)pivotedObj).booleanValue();
            Message mo = null;
            if(obj instanceof com.sap.engine.interfaces.messaging.api.Message)
                mo = (Message)((com.sap.engine.interfaces.messaging.api.Message)obj);
            } else
            if(obj instanceof MessageContext)
                mo = ((MessageContext)obj).getMessage();
            } else
                TRACE.warningT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, "no message found");
            if(mo != null && XMBMessageOperator.numberOfPayloads(mo) > 0)
               // String midstr = XMBMessageOperator.getMessageId(mo).toString();
                MessageKey auditkey = new MessageKey(((com.sap.engine.interfaces.messaging.api.Message) mo).getMessageId(), com.sap.engine.interfaces.messaging.api.MessageDirection.INBOUND);
                itr = (Iterator) mo.getAttachments();
                if(swapkey != null && keyvalue != null)
                    StringBuffer textSwappingbyBuf = new StringBuffer();
                    textSwappingbyBuf.append("Swap: swapping by '").append(swapkey).append("' ? '").append(keyvalue).append("'");
                    String textSwappingby = textSwappingbyBuf.toString();
                    TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, textSwappingby);
                    Audit.addAuditLogEntry(auditkey, AuditLogStatus.SUCCESS, textSwappingby);
                   while (itr.hasNext()){
                    boolean swappedp = swapPayloads(mo, swapkey, keyvalue);
                    String swappedStatus = swappedp ? "Swap: successfully swapped" : "Swap: no matching payload found";
                    Audit.addAuditLogEntry(auditkey, AuditLogStatus.SUCCESS, swappedStatus);
                } else
                    StringBuffer textInvalidBuf = new StringBuffer();
                    textInvalidBuf.append("Swap: parameter missing ");
                    if(swapkey == null)
                        textInvalidBuf.append("swap.keyName");
                    if(swapkey == null && keyvalue == null)
                        textInvalidBuf.append(" and ");
                    if(keyvalue == null)
                        textInvalidBuf.append("swap.keyValue");
                    String textInvalid = textInvalidBuf.toString();
                    TRACE.warningT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, textInvalid);
                    Audit.addAuditLogEntry(auditkey, AuditLogStatus.WARNING, textInvalid);
            } else
                String messageEmpty = "Swap: message is empty or has no payload";
                TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, messageEmpty);
            return outputModuleData;
        private static boolean swapPayloads(Message mo, String swapkey, String keyvalue)
            swapkey = swapkey.toUpperCase(Locale.ENGLISH);
            keyvalue = keyvalue.toUpperCase(Locale.ENGLISH);
            int ifound = -1;
            for(int i = 0; i < XMBMessageOperator.numberOfPayloads(mo); i++)
                XMBPayload pldi = XMBMessageOperator.getPayload(mo, i);
                String pldivalue = null;
                if(swapkey.equals("PAYLOAD-DESCRIPTION"))
                    pldivalue = pldi.getPayloadDescription();
                } else
                if(swapkey.equals("PAYLOAD-NAME"))
                    pldivalue = pldi.getPayloadName();
                } else
                    pldivalue = pldi.getContentAttribute(swapkey);
                if(pldivalue == null)
                    continue;
                pldivalue = pldivalue.toUpperCase(Locale.ENGLISH);
                if(pldivalue.indexOf(keyvalue) < 0)
                    continue;
                ifound = i;
                break;
            if(ifound >= 0)
                XMBPayload pldfound = XMBMessageOperator.getPayload(mo, ifound);
                if(pldfound.getPayloadType() != PayloadType.APPLICATION)
                    XMBPayload pldapp = XMBMessageOperator.getApplicationPayload(mo);
                    if(pldapp == null)
                        pldfound.setPayloadType(PayloadType.APPLICATION);
                    } else
                        pldapp.setPayloadType(PayloadType.APPLICATION_ATTACHMENT);
                        pldfound.setPayloadType(PayloadType.APPLICATION);
                    TRACE.infoT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, "successfully swapped");
                return true;
            } else
                TRACE.warningT("process(ModuleContext , ModuleData)", ModuleCategories.SAP_MODULE_ROOT, "no matching found");
                return false;
    We couldn't go further. Please have a look in highlighted code.
    Regards,
    Kesava.

  • Sender Mail adapter encounters MalformedInputException

    I have a sender mail adapter that processes the attached .csv file.  All is working fine.  I use FCC in module to convert the attachment and pass to an IDOC adapter for processing in SAP system.
    My problem is sometimes the sender mail CC fails with ...........
    exception caught during processing mail message[1]; com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
    It only fails with some files.  At the moment when we test we FORWARD the email to our email account.  If I detach the failed email attachment and attach it to a NEW email it will then work.
    So why does it not work when forwarding emails?  But it works when I attach the same file to a new email and send?
    Other threads for this error seem to point to encoding.  But how do I know which to use.  I currently use the following in my module config:
    Transfer.ContentType     application/octet-stream;charset="ISO-8859-1"

    I have this in my configuration:
    localejbs/AF_Modules/PayloadSwapBean   on local
    TRANSFORM
    localejbs/AF_Modules/MessageTransformBean   on local
    txtxml
    TRANSFORM   swap.keyName   payload-name
    TRANSFORM   swap.keyValue   MailAttachment-1
    txtxml   Transfer.ContentType   application/octet-stream;charset="ISO-8859-1"
    txtxml   Transform.Class   com.sap.aii.messaging.adapter.Conversion
    txtxml   Transform.ContentDescription   MailAttachment-1
    txtxml   Transform.ContentDisposition   attachment;filename="MailAttachment-1.bin"
    txtxml   xml.conversionType   SimplePlain2XML
    txtxml   xml.documentName   MT_BCD_INVOICES
    txtxml   xml.documentNamespace   urn://federalmogul.com/BCDTRAVEL/FINGLOBCD001/00
    txtxml   xml.fieldNames   COST_CENTRE,EMPLOYEE_ID,PRODUCT_GROUP,COMP_CODE,BCD_ACCOUNT,INVOICE_DATE,TRAVELER_NAME,TRAVELER_FIRST_NAME,INVOICE_NO,AMOUNT_EXCL_VAT,CURRENCY1,AMOUNT_VAT,CURRENCY2,AMOUNT_DOC_CURRENCY,CURRENCY3
    txtxml   xml.fieldSeparator   ;
    txtxml   xml.lastFieldsOptional   YES
    txtxml   xml.processFieldNames  fromConfiguration
    txtxml   xml.structureTitle   RECORDSET

Maybe you are looking for