Send Email & Store in mySAP Cfolders

Hi,
I have developed a WD application through which I populate a adobe form from SAP.Now user keys in some more fields.
When user clicks submit it should send an email which is already in that form  plus it should store in respective project (Hard Copies) folder of Mysap PLM Cfolders as We already have these folders bulit up for all projects.
FYi.. I don't need anything back to SAP. I have used Submit by ema.. button and it sends an XML file though.but I need to send PDF form which is filled by the user.
Also,I have hard coded my em..address but I want it be binded to my address which I will be prefilling.
Any ideas?
rgds
Vara
Edited by: Vara K on May 7, 2009 11:50 PM

Hi,
Thank you for the links.
My requirement made me follow the blog of Juergen.
https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/6676. [original link is broken] [original link is broken] [original link is broken]
Right now with submit button I can attach PDF and it is linking it to my EMAEL client but my EMAEL address is not showing up in TO address.
This is what I followed from Juergen Hauser blog.
I create the EMAEL button on the form based on the standard button. I drag and drop the button onto the form and then take a look at the properties. In the "field" tab of the object palette you can find the "control type". I just set it to "submit". Doing this I get an additional tab called "submit". This tab contains a field where you can enter the "Submit to URL". If you want to submit data via EMAEL you have to use an "EMAELto:" URL.
The EMAEL address shouldn't be contained in the form template. It should be data driven so that it can be changed without touching the template. So let's assume that the EMAEL address is contained in the form data (e.g. in a node that is not bound to any field on the form).
First of all we have to find out where the URL is stored in the template. The XFA Specification helps us here (see also my blog about where to find documentation on scripting for Interactive Forms). It tells us that a submit button has a node "event". This node has another subnode called "submit" and this node has a property called "target". To dynamically set the submit-to URL we have to script against this property.
To access the "target" property of the EMAEL button in JavaScript we have to use the function resolveNode. You can use the following JavaScript line to set the URL of a submit button:
I have used following Code in Initialize & also tried in ready event.
this.resolveNode("#event.#submit").target = "EMAELto:"+$record.EMAELaddress.value;
My plan is to use the EMAEL address from node.
It may by default bring the EMAEL address from database or else user-may also key in the EMAEL address and it should take that EMAEL whle sending the PDF.
What is going wrong with me.
resolved it basically I was misisng
TABLE name in code
this.resolveNode("#event.#submit").target = "mailto:"+$record.ITEM.PEMAI.value;
Rgds
Vara
Edited by: Vara K on May 11, 2009 4:06 PM
Edited by: Vara K on May 11, 2009 4:39 PM

Similar Messages

  • My camera and iBooks have stopped sending emails, the function and ability to create the email is still there but my iPad will no loner send the email or even store a draft on my account to suggest the email was ever written; please help I need thability

    My camera and iBooks have stopped sending emails, the function and ability to create the email is still there but my iPad will no loner send the email or even store a draft on my account to suggest the email was ever written; please help I really need this functionality.

    Can you send any emails at all indicating that the mail app is working? Did you try any basic stuff yet?
    Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Close those affected apps and restart the iPad. Go to the home screen first by tapping the home button. Quit/close open apps by double tapping the home button and the task bar will appear with all of you recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner to close the apps. Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.

  • Cannot get/send email-server down-went to apple store genius bar today-when is it going to be working-this is a huge problem

    have not been able to get/send email for 1 1/2 days now - went to genius bar this morning and was told that THE UNIVERSAL SERVER IS DOWN AND THERE IS NO WAY TO GET TO MY EMAIL - WHEN IS THIS GOING TO BE RESOLVED??  Huge issue

    Unless it's confirmed officially that your phone is defective, then you can ask for a replacement. Or you have to live with you. However you can trade it for a new one if you don't care the price drop.

  • Cannot send email from an iPhone to a Outlook group.

    Hi,
    My question is simple and I'd like an exactly same answer : Can iPhone users send emails from their iPhone's to one or more groups created in Outlook?
    This is my situation: our organization is using iPhone to provide email, calendar, contact, task etc. to some of their employees. We are using Airwatch MDM Agent on user's iPhone because we have an Airwatch server in place. I have an user and she has an iPhone 5 and she has created some groups in Outlook but these groups are not reflected in her Contacts in the iPhone. I have update her phone with the latest update, although I was almost sure that this was not the issue, then I've found some interesting posts on internet saying that this was a known problem for the users with the previous iOS but I thought this might has been corrected with the iOS, apparently not.
    Also I've tried ''the trick'' that is posted on several forums with the iCloud but neither so it's working. I am looking for a straight answer, if this works or not on iPhone's?
    Thanks,
    Sebastian.

    There indeed ARE apps in the app store that will do what you want.  Just search and find the one that best fits your needs.

  • "Cannot send email from this device"?

    I recently purchased the Easy Release App from the ITunes store and when I try to email the release to my email address it says "Cannot send email from this device". Is it the app that is preventing the sending or is it something to do with the iPod? I've tried sending an email from the iPod to see and it is sent fine from the iPod but the app still won't send from the iPod.
    Has this ever happened to someone else? Do I have to change settings on my iPod?
    I have the IPod 4th generation if that helps

    I had the same problem. You have to go into Settings in your ipod touch, scroll down and find "mail, contacts, calendars." Set up your email in there. It will give you a list I.e. yahoo, hotmail, gmail. After you've dont that you'll be able to sent the model release.

  • How do I fix Mail in Snow Leopard where I cannot send emails from my account to another account I've set up in Mail, but the reverse works fine?

    I have a problem with Mail in Snow Leopard in that I cannot set up two email accounts for myself and my wife with the same ISP and have them operate properly.  I've set up the accounts in strict accordance with my ISP's instructions for setting up email accounts on Mac Mail but I cannot send an email from my account to my wife's without a drop-down message appearing that Mail 'cannot send the email from this server.  Please edit the server list'.  No amount of tweaking appears to work.  Applecare consultants have so far been unable to get it to work and a recent visit to the local Genius Bar in the Apple Store was fruitless also.  My ISP's help line was unable to solve the problem even with a supervisor level consultant.  The ISP concluded it was some kind of 'bug' in Mail.
    I could send emails from my wife's account to mine, but not vice versa; I could send emails to other addresees without any problem and I can send emails from my account to my wife's using the ISP's webmail.
    Does anyone please have a solution to my problem?  At the moment we're operating one account (mine) on my Macbook and my wife's is set up on her iPad2.  As we prefer to use the Macbook for storage and (using Time Machine) for back-up of our data, the two accounts on separate machines is a nuisance.
    Another factor is that I prefer to control when I download emails and set my preferences accordingly.  One of the so-called 'fixes' that were tried wound up downloading emails regardless of settings, even after removing my wife's account; the matter was remedied only after I had removed all accounts form Mail and started afresh from scratch.

    You'll have to pardon my ignorance of some  computer terminology; I'm a retired manager and not a computer technician, hence my muddling up of client and server terminology.
    Re your comment about Port 339: I did qualify this with (?).  As I wrote, it all happened at lightining speed and the guy at the Genius Bar didn't bother explaining what he was doing.  Port designation contained 3s and 9s to the best of my recollection.
    That said, you seem to be spot on re setting up a 'dummy' client in Mail.  I set it up as you suggested and I can send to and receive from this client without a problem.  You appear to have identified the solution, notwithstanding the claims of the ISP's 'experts'.
    The next problem I have now is sorting out my wife's mailbox that is so troublesome whenever I set it up on Mail.
    All the other set-up advice to date yielded a similar result; inability to send from my account to her inbox.  Perhaps deleting her details from the account altogether and setting them up again from scratch may be the solution and I shall try that in due course.  The impediment that I have with this at the moment is that my ISP admits that it has 'a technical problem with its email servers' and some of its related web pages that prevent my doing this myself.  I will have to go through the telephone 'help' line and ask the technician to set it up at their end on my instructions.  This has some disadvantages in that I have to divulge the password to the account to the operator rather than keeping it anonymous by doing it on-line.   You may have solved the problem, but until I can successfully sort out a working mailbox for my wife i cannot definitively say so.
    Many thanks for your perseverance.  You've made more sense than anyone else so far and that deserves some points, surely?

  • Cannot send email after update on iphone 5

    cannot send email from one account after update,  states my password and/or user name incorrect.  I have it written down,it's not incorrect.

    After the iOS 7 update, in order to send email from my iPhone5 and my daughters (also from our iPads) I had do follow Apples reset instructions. Hold the HOME buttton and the START/AWAKE button until your device restarts and you see the Apple logo when your device restarts. You do not have to swipe the message bar which shows up sometimes as your iPhone is shutting down. Sadly to say, but on my daughters iPhone 5, I had to do this 5 times.
    If you live near an Apple store, make them do it so that someone at Apple will send a fix for other people. I looked for a simple way to contact Apple and there is none. There is a series of prompts and links that are time consuming to be able to reach support about even a simple problem.

  • Sending email to multiple address using Utl_Smtp

    Hi,
    I want to send email to multiple address using the Utl_Smtp feature.
    When I am sending email to one email address in the To:Field it works fine.However, when I send
    to multiple address I am getting the below error.I am using a table(Email_test) to store all email id.
    Error report:
    ORA-29279: SMTP permanent error: 501 5.1.3 Invalid address
    ORA-06512: at "SYS.UTL_SMTP", line 20
    ORA-06512: at "SYS.UTL_SMTP", line 98
    ORA-06512: at "SYS.UTL_SMTP", line 240
    ORA-06512: at line 48
    29279. 00000 - "SMTP permanent error: %s"
    *Cause:    A SMTP permanent error occurred.
    *Action:   Correct the error and retry the SMTP operation.
    I am trying two options both ways I am getting error
    Option 1:
    Selecting two email id indivually in the select query as below
    select email into v_Recipient1 from Email_test where Key_name='U1';
    select email into v_Recipient2 from Email_test where Key_name='U2';
    v_Recipient := v_Recipient1||';'||v_Recipient2;
    Option 2:
    Is there a way to use option
    select email into v_Recipient1 from Email_test where Key_name='U4';
    ===========================================================
    Create table Script
    ===========================================================
    create table Email_test (Email varchar2(100),Key_name varchar2(10));
    insert into Email_test values ('[email protected]','U1');
    insert into Email_test values ('[email protected]','U2');
    insert into Email_test values ('[email protected]','U3')
    insert into Email_test values ('[email protected];[email protected];[email protected]','U4');
    select * from Email_test
    [email protected]                         U1
    [email protected]                         U2
    [email protected]                         U3
    [email protected];[email protected];[email protected]     U4
    select * from Email_test where Key_name in ('U1','U2','U3')
    [email protected]     U1
    [email protected]     U2
    [email protected]     U3
    select * from Email_test where Key_name='U4'
    [email protected];[email protected];[email protected]
    =======================================================
    PL/SQL Block
    ===========================================================
    declare
    v_From VARCHAR2(80) := '[email protected]';
    v_cc VARCHAR2(80);
    v_Recipient VARCHAR2(80) ;
    v_Recipient1 VARCHAR2(80) ;
    v_Recipient2 VARCHAR2(80) ;
    v_Subject VARCHAR2(80);
    v_Mail_Host VARCHAR2(50);
    v_Mail_Conn utl_smtp.Connection;
    crlf VARCHAR2(2) := chr(13)||chr(10);
    begin
    --Mail Host name
    select VALUE into v_Mail_Host from Server_info where server_name = 'SMTPServer';
    select email into v_Recipient1 from Email_test where Key_name='U1';
    select email into v_Recipient2 from Email_test where Key_name='U2';
    v_Recipient := v_Recipient1||';'||v_Recipient2;
    --for CC
    select email into v_cc from Email_test where Key_name='U3';
    v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
    utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
    utl_smtp.Mail(v_Mail_Conn, v_From);
    utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
    utl_smtp.Rcpt(v_Mail_Conn, v_cc); -- To CC recepient
    utl_smtp.Rcpt(v_Mail_Conn, v_BCC); To BCC recepient
    utl_smtp.Data(v_Mail_Conn,
    'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
    'From: ' || v_From || crlf ||
    'Subject: '|| v_Subject || crlf ||
    'To: ' || v_Recipient || crlf ||
    'Cc: ' || v_cc || crlf ||
    'Content-Type: text/html;' ||crlf ||
    --'Hello this is a test email');
    crlf || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf );
    utl_smtp.Quit(v_mail_conn);
    end;
    Any suggestion how to approach this issue.
    Thank you

    Simple Mail Transfer Protocol RFC 5321 specifications.
          RCPT TO:<forward-path> [ SP <rcpt-parameters> ] <CRLF>
       The first or only argument to this command includes a forward-path
       (normally a mailbox and domain, always surrounded by "&gt;" and "&lt;"
       brackets) identifying one recipient.In other words, you can only define a SINGLE mailbox address at a time. Multiple addresses requires multiple repeats of this command verb, once per maibox.
    Do not confuse this and the To: tag line in the Mime header that contains a comma delimited list of recipients. That tag line can contain anything - it is not parsed, not checked, and not verified as matching the actual recipient mailboxes as specified via the RCPT TO verb.

  • Error while sending email to external mail - Urgent

    Hi All,
    I am getting error while sending email with attachement. The Error code is 02.
    I am not able to identify the error. bold Please help me in solving this problem.
    Is it anything wrong with the code or Any Configuration with SCOT/SOST.bold
    the code i am using is :
    REPORT YVR_F MESSAGE-ID XX .
    TABLES : EDIDC, EDIDS, EDPAR.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    PARAMETERS : P_STATUS LIKE EDIDC-STATUS DEFAULT '51'.
    SELECT-OPTIONS : S_DIRECT FOR EDIDC-DIRECT,
                     S_MESTYP FOR EDIDC-MESTYP,
                     S_CREDAT FOR EDIDC-CREDAT.
    SELECTION-SCREEN END OF BLOCK B1 .
    PARAMETER: P_EMAIL LIKE SOMLRECI1-RECEIVER,
               P_SENDER LIKE SOMLRECI1-RECEIVER no-display,
               P_DELSPL  AS CHECKBOX,
               P_ONLINE NO-DISPLAY.
    DATA : TB_EDIDC LIKE STANDARD TABLE OF EDIDC INITIAL SIZE 0 WITH HEADER
    LINE.
    DATA : TB_EDPAR LIKE STANDARD TABLE OF EDPAR INITIAL SIZE 0 WITH HEADER
    LINE.
    DATA : TB_KNA1 LIKE STANDARD TABLE OF KNA1 INITIAL SIZE 0 WITH HEADER
    LINE.
    DATA : TB_ADRC LIKE STANDARD TABLE OF ADRC INITIAL SIZE 0 WITH HEADER
    LINE.
    DATA: INT_PDF TYPE TABLE OF TLINE WITH HEADER LINE.
    DATA : BEGIN OF TB_ED OCCURS 0,
             SNDPRN LIKE EDIDC-SNDPRN,
             LOC    LIKE ADRC-BUILDING,
             DOCNUM LIKE EDIDC-DOCNUM,
             IDOCTP LIKE EDIDC-IDOCTP,
             MESTYP LIKE EDIDC-MESTYP,
             DIRECT LIKE EDIDC-DIRECT,
             CREDAT LIKE EDIDC-CREDAT,
             STATUS LIKE EDIDC-STATUS,
           END OF TB_ED.
    DATA:   IT_MESSAGE TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   IT_ATTACH TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
                    WITH HEADER LINE.
    Job Runtime Parameters
    DATA: GD_EVENTID LIKE TBTCM-EVENTID,
          GD_EVENTPARM LIKE TBTCM-EVENTPARM,
          GD_EXTERNAL_PROGRAM_ACTIVE LIKE TBTCM-XPGACTIVE,
          GD_JOBCOUNT LIKE TBTCM-JOBCOUNT,
          GD_JOBNAME LIKE TBTCM-JOBNAME,
          GD_STEPCOUNT LIKE TBTCM-STEPCOUNT,
          GD_ERROR    TYPE SY-SUBRC,
          GD_RECIEVER TYPE SY-SUBRC.
    DATA:  W_RECSIZE TYPE I,
           W_SPOOL_NR LIKE SY-SPONO.
          %_print LIKE pri_params.
    DATA: GD_SUBJECT   LIKE SODOCCHGI1-OBJ_DESCR,
          IT_MESS_BOD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
          IT_MESS_ATT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
          GD_SENDER_TYPE     LIKE SOEXTRECI1-ADR_TYP,
          GD_ATTACHMENT_DESC TYPE SO_OBJ_NAM,
          GD_ATTACHMENT_NAME TYPE SO_OBJ_DES.
    Spool to PDF conversions
    DATA: GD_SPOOL_NR LIKE TSP01-RQIDENT,
          GD_DESTINATION LIKE RLGRAP-FILENAME,
          GD_BYTECOUNT LIKE TST01-DSIZE,
          GD_BUFFER TYPE STRING.
    Binary store for PDF
    DATA: BEGIN OF IT_PDF_OUTPUT OCCURS 0.
            INCLUDE STRUCTURE TLINE.
    DATA: END OF IT_PDF_OUTPUT.
    DATA: GD_RECSIZE TYPE I.
    CONSTANTS: C_DEV LIKE  SY-SYSID VALUE 'DEV',
               C_NO(1)     TYPE C   VALUE ' ',
               C_DEVICE(4) TYPE C   VALUE 'LOCL'.
    DATA:   T_PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
            T_CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
            T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
            T_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
            T_OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
            W_CNT TYPE I,
            W_SENT_ALL(1) TYPE C,
            W_DOC_DATA LIKE SODOCCHGI1.
    DATA : MSTR_PRINT_PARMS LIKE PRI_PARAMS,
           MC_VALID,
           P_REPID LIKE SY-REPID,
           WF_ID  LIKE TSP01-RQIDENT,
           LOC_BYTECOUNT TYPE I.
    *start-of-selection.
    MSTR_PRINT_PARMS-PDEST = 'LOCL'.
    P_REPID = SY-REPID.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
        authority= ' '
       COPIES                       = '1'
       COVER_PAGE                   = SPACE
       DATA_SET                     = SPACE
       DEPARTMENT                   = SPACE
       DESTINATION                  = 'LP01'
       EXPIRATION                   = '1'
       IMMEDIATELY                  = 'X'
       LAYOUT                       = 'X_65_132'
       MODE                         = SPACE
       NEW_LIST_ID                  = 'X'
       NO_DIALOG                    = 'X'
       USER                         = SY-UNAME
    IMPORTING
       OUT_PARAMETERS               = MSTR_PRINT_PARMS
       VALID                        = MC_VALID
    EXCEPTIONS
       ARCHIVE_INFO_NOT_FOUND       = 1
       INVALID_PRINT_PARAMS         = 2
       INVALID_ARCHIVE_PARAMS       = 3
       OTHERS                       = 4.
         SUBMIT (P_REPID) TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                          SPOOL PARAMETERS MSTR_PRINT_PARMS.
                          AND RETURN.
    NEW-PAGE PRINT ON NO DIALOG PARAMETERS
    MSTR_PRINT_PARMS.
    perform data.
    NEW-PAGE PRINT OFF. "This marks the end of the screen for which the
    *SPOOL NO WAS GENERATED.
    WF_ID = SY-SPONO.
    *converting spool to pdf
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
         EXPORTING
              SRC_SPOOLID              = WF_ID  "SPOOL NUMBER
              NO_DIALOG                = SPACE
              PDF_DESTINATION          = 'X'
         IMPORTING
              PDF_BYTECOUNT =
                 LOC_BYTECOUNT "NUMBER OF BYTES TRANSFERRED
         TABLES
              PDF                      = INT_PDF  "TABLE FOR PDF REPORT
         EXCEPTIONS
              ERR_NO_ABAP_SPOOLJOB     = 1
              ERR_NO_SPOOLJOB          = 2
              ERR_NO_PERMISSION        = 3
              ERR_CONV_NOT_POSSIBLE    = 4
              ERR_BAD_DESTDEVICE       = 5
              USER_CANCELLED           = 6
              ERR_SPOOLERROR           = 7
              ERR_TEMSEERROR           = 8
              ERR_BTCJOB_OPEN_FAILED   = 9
              ERR_BTCJOB_SUBMIT_FAILED = 10
              ERR_BTCJOB_CLOSE_FAILED  = 11
              OTHERS                   = 12.
    *CALL FUNCTION 'DOWNLOAD'
    *EXPORTING
    *bin_filesize = loc_bytecount "NO. OF BYTES
    *filename = 'C:/EMAILPDF.PDF'
    *filetype = 'BIN'
    **IMPORTING
    **act_filename = loc_filename
    *TABLES
    *data_tab = int_pdf.
    IF P_DELSPL EQ 'X'.
      PERFORM DELETE_SPOOL.
    ENDIF.
    Transfer the 132-long strings to 255-long strings
    LOOP AT INT_PDF.
      TRANSLATE INT_PDF USING ' ~'.
      CONCATENATE GD_BUFFER INT_PDF INTO GD_BUFFER.
    ENDLOOP.
    TRANSLATE GD_BUFFER USING '~ '.
    DO.
      IT_MESS_ATT = GD_BUFFER.
      APPEND IT_MESS_ATT.
      SHIFT GD_BUFFER LEFT BY 255 PLACES.
      IF GD_BUFFER IS INITIAL.
        EXIT.
      ENDIF.
    ENDDO.
    DESCRIBE TABLE IT_MESS_ATT LINES GD_RECSIZE.
    CHECK GD_RECSIZE > 0.
    PERFORM SENDMAIL USING P_EMAIL..
    *&      Form  sendmail
          text
    -->  p1        text
    <--  p2        text
    FORM SENDMAIL USING P_EMAIL.
      CHECK NOT ( P_EMAIL IS INITIAL ).
      REFRESH IT_MESS_BOD.
    Default subject matter
      GD_SUBJECT         = 'Subject'.
      GD_ATTACHMENT_DESC = 'IDOC LIST'.
    CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
      IT_MESS_BOD        = 'List Of Failed Idocs'.
      APPEND IT_MESS_BOD.
      IT_MESS_BOD        = 'List Of Failed Idocs'.
      APPEND IT_MESS_BOD.
    If no sender specified - default blank
      IF P_SENDER EQ SPACE.
        GD_SENDER_TYPE  = SPACE.
      ELSE.
        GD_SENDER_TYPE  = 'INT'.
      ENDIF.
    Send file by email as .xls speadsheet
      PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
                                   TABLES IT_MESS_BOD
                                          IT_MESS_ATT
                                    USING P_EMAIL
                                          'Document attachment'
                                          'PDF'
                                          GD_ATTACHMENT_NAME
                                          GD_ATTACHMENT_DESC
                                          P_SENDER
                                          GD_SENDER_TYPE
                                 CHANGING GD_ERROR
                                          GD_RECIEVER.
    ENDFORM.                    " sendmail
    *&      Form  DELETE_SPOOL
          text
    -->  p1        text
    <--  p2        text
    FORM DELETE_SPOOL.
      DATA: LD_SPOOL_NR TYPE TSP01_SP0R-RQID_CHAR.
      LD_SPOOL_NR = WF_ID.   "GD_SPOOL_NR.
      CHECK P_DELSPL <> C_NO.
      CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
           EXPORTING
                SPOOLID = LD_SPOOL_NR.
    ENDFORM.                    " DELETE_SPOOL
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          text
         -->P_IT_MESS_BOD  text
         -->P_IT_MESS_ATT  text
         -->P_P_EMAIL  text
         -->P_0846   text
         -->P_0847   text
         -->P_GD_ATTACHMENT_NAME  text
         -->P_GD_ATTACHMENT_DESC  text
         -->P_P_SENDER  text
         -->P_GD_SENDER_TYPE  text
         <--P_GD_ERROR  text
         <--P_GD_RECIEVER  text
    FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES   IT_MESSAGE
                                              IT_ATTACH
                                        USING P_EMAIL
                                              P_MTITLE
                                              P_FORMAT
                                              P_FILENAME
                                              P_ATTDESCRIPTION
                                              P_SENDER_ADDRESS
                                              P_SENDER_ADDRES_TYPE
                                     CHANGING P_ERROR
                                              P_RECIEVER.
      DATA: LD_ERROR    TYPE SY-SUBRC,
             LD_RECIEVER TYPE SY-SUBRC,
             LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,
             LD_EMAIL LIKE  SOMLRECI1-RECEIVER,
             LD_FORMAT TYPE  SO_OBJ_TP ,
             LD_ATTDESCRIPTION TYPE  SO_OBJ_NAM ,
             LD_ATTFILENAME TYPE  SO_OBJ_DES ,
             LD_SENDER_ADDRESS LIKE  SOEXTRECI1-RECEIVER,
             LD_SENDER_ADDRESS_TYPE LIKE  SOEXTRECI1-ADR_TYP,
             LD_RECEIVER LIKE  SY-SUBRC.
      DATA:   T_PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
              T_CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
              T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
              T_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
              T_OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
              W_CNT TYPE I,
              W_SENT_ALL(1) TYPE C,
              W_DOC_DATA LIKE SODOCCHGI1.
      LD_EMAIL   = P_EMAIL.
      LD_MTITLE = P_MTITLE.
      LD_FORMAT              = P_FORMAT.
      LD_ATTDESCRIPTION      = P_ATTDESCRIPTION.
      LD_ATTFILENAME         = P_FILENAME.
      LD_SENDER_ADDRESS      = P_SENDER.
      LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.
    Fill the document data.
      W_DOC_DATA-DOC_SIZE = 1.
    Populate the subject/generic message attributes
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME  = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE .
      W_DOC_DATA-SENSITIVTY = 'F'.
    Fill the document data and get size of attachment
      CLEAR W_DOC_DATA.
      READ TABLE IT_ATTACH INDEX W_CNT.
      W_DOC_DATA-DOC_SIZE =
         ( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
      W_DOC_DATA-OBJ_LANGU  = SY-LANGU.
      W_DOC_DATA-OBJ_NAME   = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR  = LD_MTITLE.
      W_DOC_DATA-SENSITIVTY = 'F'.
      CLEAR T_ATTACHMENT.
      REFRESH T_ATTACHMENT.
      T_ATTACHMENT[] = IT_ATTACH[].
    Describe the body of the message
      CLEAR T_PACKING_LIST.
      REFRESH T_PACKING_LIST.
      T_PACKING_LIST-TRANSF_BIN = SPACE.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 0.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = 'RAW'.
      APPEND T_PACKING_LIST.
    Create attachment notification
      T_PACKING_LIST-TRANSF_BIN = 'X'.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM   = 1.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE   =  LD_FORMAT.
      T_PACKING_LIST-OBJ_DESCR  =  LD_ATTDESCRIPTION.
      T_PACKING_LIST-OBJ_NAME   =  LD_ATTFILENAME.
      T_PACKING_LIST-DOC_SIZE   =  T_PACKING_LIST-BODY_NUM * 255.
      APPEND T_PACKING_LIST.
    Add the recipients email address
      CLEAR T_RECEIVERS.
      REFRESH T_RECEIVERS.
      T_RECEIVERS-RECEIVER = p_EMAIL.
      T_RECEIVERS-REC_TYPE = 'U'.
      T_RECEIVERS-COM_TYPE = 'INT'.
      T_RECEIVERS-NOTIF_DEL = 'X'.
      T_RECEIVERS-NOTIF_NDEL = 'X'.
      APPEND T_RECEIVERS.
      DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
    W_SENT_ALL = 'X'.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           EXPORTING
                DOCUMENT_DATA              = W_DOC_DATA
                PUT_IN_OUTBOX              = 'X'
               SENDER_ADDRESS             = LD_SENDER_ADDRESS
               SENDER_ADDRESS_TYPE        = LD_SENDER_ADDRESS_TYPE
                COMMIT_WORK                = 'X'
           IMPORTING
                SENT_TO_ALL                = W_SENT_ALL
           TABLES
                PACKING_LIST               = T_PACKING_LIST
                object_header              = objhead
                CONTENTS_BIN               = T_ATTACHMENT
                CONTENTS_TXT               = IT_MESSAGE
                RECEIVERS                  = T_RECEIVERS
           EXCEPTIONS
                TOO_MANY_RECEIVERS         = 1
                DOCUMENT_NOT_SENT          = 2
                OPERATION_NO_AUTHORIZATION = 4
                OTHERS                     = 99.
      IF SY-SUBRC NE 0.
        MESSAGE E000 WITH 'Error occurred while sending'.
      ELSE.
        MESSAGE I000 WITH 'The document was sent'.
      ENDIF.
    ENDFORM.                    " SEND_FILE_AS_EMAIL_ATTACHMENT
    *&      Form  data
          text
    -->  p1        text
    <--  p2        text
    FORM data.
    SELECT SNDPRN
             DOCNUM
             IDOCTP
             MESTYP
             DIRECT
             CREDAT
             STATUS
             FROM EDIDC
             INTO CORRESPONDING FIELDS
             OF TABLE TB_EDIDC
             WHERE STATUS = P_STATUS
             AND MESTYP IN S_MESTYP
             AND DIRECT IN S_DIRECT
             AND CREDAT IN S_CREDAT.
    SELECT KUNNR
           INPNR
           FROM EDPAR
           INTO CORRESPONDING FIELDS
           OF TABLE TB_EDPAR
           FOR ALL ENTRIES IN TB_EDIDC
           WHERE KUNNR = TB_EDIDC-SNDPRN.
    SELECT KUNNR
           ADRNR
           FROM KNA1
           INTO CORRESPONDING FIELDS
           OF TABLE TB_KNA1
           FOR ALL ENTRIES IN TB_EDPAR
           WHERE KUNNR = TB_EDPAR-INPNR.
    SELECT ADDRNUMBER
           BUILDING
           FROM ADRC
           INTO CORRESPONDING FIELDS
           OF TABLE TB_ADRC
           FOR ALL ENTRIES IN TB_KNA1
           WHERE ADDRNUMBER = TB_KNA1-ADRNR.
    LOOP AT TB_EDIDC WHERE STATUS = P_STATUS
                     AND MESTYP IN S_MESTYP
                     AND DIRECT IN S_DIRECT
                     AND CREDAT IN S_CREDAT.
      TB_ED-SNDPRN = TB_EDIDC-SNDPRN.
      TB_ED-DOCNUM = TB_EDIDC-DOCNUM.
      TB_ED-IDOCTP = TB_EDIDC-IDOCTP.
      TB_ED-MESTYP = TB_EDIDC-MESTYP.
      TB_ED-DIRECT = TB_EDIDC-DIRECT.
      TB_ED-CREDAT = TB_EDIDC-CREDAT.
      TB_ED-STATUS = TB_EDIDC-STATUS.
      READ TABLE TB_EDPAR WITH KEY KUNNR = TB_EDIDC-SNDPRN.
      READ TABLE TB_KNA1 WITH KEY KUNNR = TB_EDPAR-INPNR.
      READ TABLE TB_ADRC WITH KEY ADDRNUMBER = TB_KNA1-ADRNR.
      TB_ED-LOC = TB_ADRC-BUILDING.
      APPEND TB_ED.
    ENDLOOP.
    WRITE :/02 'CustomerNo',
            15 'Location Code',
            30 'Idoc Number',
            55 'Basic Type',
            70 'Message Type',
            95 'Direction',
            110 'Received Date',
            130 'Status'.
    ULINE.
    LOOP AT TB_ED.
      WRITE :/02 TB_ED-SNDPRN,
              15 TB_ED-LOC,
              30 TB_ED-DOCNUM,
              55 TB_ED-IDOCTP,
              70 TB_ED-MESTYP,
              95 TB_ED-DIRECT,
              110 TB_ED-CREDAT,
              130 TB_ED-STATUS.
    ENDLOOP.
    ENDFORM.                    " data
    Kindly help me in solving the issue.
    Thanks in advance.
    Suki.

    Hi,
    Check in transaction SCOT. If your mail is in error status in SCOT, you can assure that there is no problem with your code. If your message has not reached till SCOT, then the problem will be with the code.
    If the mail is there in scot with error status tell the BASIS to configure it. I feel this could be the problem.
    Regards,
    Renjith Michael.

  • How to prevent exchange email account from sending emails in Outlook

    Hello,
    I'm using Outlook 2010 with two email accounts. First account is set up with pop/smtp (hosted email), Second account is set up with local exchange server 2003 (not full exchange, only used to store emails, calendars, public folders). For sending & receiving
    emails we use hosted email account pop/smtp, which is default account.
    The problem is when I receive meeting request.....if i hit Accept > Send the Response Now, for some reason it will try to send from the Exchange account (which is not set up for sending emails).
    The only workaround I know is to hit Accept > Edit the Response before Sending > change account from exchange to pop and send.
    Would you please help me if there is a fix or any way to disable exchange account from sending emails !!
    Thanks a lot !!!

    When the meeting is added to the exchange calendar, it wants to send the response. One way to solve it (and i think the easiest) is to configure the exchange account to send mail using a smart host. Configure your hosted email address as the default smtp
    address - the server will send any mail it receives and the address on it will be your correct internet address.
    Diane Poremsky [MVP - Outlook]
    Outlook & Exchange Solutions Center
    Outlook Tips
    Subscribe to Exchange Messaging Outlook weekly newsletter

  • Outlook 2013 crashed when user sending email from Adobe Writer xi pro ver 11.0.07

    I ask Adobe, but they are signaling to Outlook problem
    PC-HP, Windows 8.1 Pro X64 connected to Windows 2008 R2 DC
    Adobe Acrobat Pro ver 11,x
    When user trying to send email from Adobe direct, Outlook 2013 Pro is crashing
    The only way to send email is to save adobe ( PDF) file and attached to the email
    All patches are installed

    Log Name:      Application
    Source:        Application Error
    Date:          7/15/2014 8:05:38 AM
    Event ID:      1000
    Task Category: (100)
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      Liz7PM-HP.armadale.local
    Description:
    Faulting application name: Acrobat.exe, version: 11.0.7.79, time stamp: 0x536b812b
    Faulting module name: SendMail.api, version: 11.0.7.79, time stamp: 0x536b7fd0
    Exception code: 0xc0000005
    Fault offset: 0x0003390b
    Faulting process id: 0x139c
    Faulting application start time: 0x01cfa024deec4218
    Faulting application path: C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Acrobat.exe
    Faulting module path: C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\plug_ins\SendMail.api
    Report Id: 553a89c7-0c18-11e4-be97-80c16ee27020
    Faulting package full name: 
    Faulting package-relative application ID: 
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Application Error" />
        <EventID Qualifiers="0">1000</EventID>
        <Level>2</Level>
        <Task>100</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2014-07-15T12:05:38.000000000Z" />
        <EventRecordID>66128</EventRecordID>
        <Channel>Application</Channel>
        <Computer>Liz7PM-HP.armadale.local</Computer>
        <Security />
      </System>
      <EventData>
        <Data>Acrobat.exe</Data>
        <Data>11.0.7.79</Data>
        <Data>536b812b</Data>
        <Data>SendMail.api</Data>
        <Data>11.0.7.79</Data>
        <Data>536b7fd0</Data>
        <Data>c0000005</Data>
        <Data>0003390b</Data>
        <Data>139c</Data>
        <Data>01cfa024deec4218</Data>
        <Data>C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Acrobat.exe</Data>
        <Data>C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\plug_ins\SendMail.api</Data>
        <Data>553a89c7-0c18-11e4-be97-80c16ee27020</Data>
        <Data>
        </Data>
        <Data>
        </Data>
      </EventData>
    </Event>
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Log Name:      Application
    Source:        Windows Error Reporting
    Date:          7/15/2014 8:05:55 AM
    Event ID:      1001
    Task Category: None
    Level:         Information
    Keywords:      Classic
    User:          N/A
    Computer:      Liz7PM-HP.armadale.local
    Description:
    Fault bucket 73304412188, type 1
    Event Name: APPCRASH
    Response: Not available
    Cab Id: 0
    Problem signature:
    P1: Acrobat.exe
    P2: 11.0.7.79
    P3: 536b812b
    P4: SendMail.api
    P5: 11.0.7.79
    P6: 536b7fd0
    P7: c0000005
    P8: 0003390b
    P9: 
    P10: 
    Attached files:
    C:\Users\ewhitton\Desktop\140.pdf
    C:\Users\ewhitton\AppData\Local\Temp\WER8000.tmp.WERInternalMetadata.xml
    C:\Users\ewhitton\AppData\Local\Temp\WER8BB9.tmp.appcompat.txt
    minidump.mdmp
    These files may be available here:
    C:\Users\ewhitton\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_Acrobat.exe_2a26ba191a528da71b85271ed9509f7e426babf8_0d6f35c4_1735c074
    Analysis symbol: 
    Rechecking for solution: 0
    Report Id: 553a89c7-0c18-11e4-be97-80c16ee27020
    Report Status: 4104
    Hashed bucket: f6a7a946597169e4aea5077b3b7f0848
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Windows Error Reporting" />
        <EventID Qualifiers="0">1001</EventID>
        <Level>4</Level>
        <Task>0</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2014-07-15T12:05:55.000000000Z" />
        <EventRecordID>66131</EventRecordID>
        <Channel>Application</Channel>
        <Computer>Liz7PM-HP.armadale.local</Computer>
        <Security />
      </System>
      <EventData>
        <Data>73304412188</Data>
        <Data>1</Data>
        <Data>APPCRASH</Data>
        <Data>Not available</Data>
        <Data>0</Data>
        <Data>Acrobat.exe</Data>
        <Data>11.0.7.79</Data>
        <Data>536b812b</Data>
        <Data>SendMail.api</Data>
        <Data>11.0.7.79</Data>
        <Data>536b7fd0</Data>
        <Data>c0000005</Data>
        <Data>0003390b</Data>
        <Data>
        </Data>
        <Data>
        </Data>
        <Data>
    C:\Users\ewhitton\Desktop\140.pdf
    C:\Users\ewhitton\AppData\Local\Temp\WER8000.tmp.WERInternalMetadata.xml
    C:\Users\ewhitton\AppData\Local\Temp\WER8BB9.tmp.appcompat.txt
    minidump.mdmp</Data>
        <Data>C:\Users\ewhitton\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_Acrobat.exe_2a26ba191a528da71b85271ed9509f7e426babf8_0d6f35c4_1735c074</Data>
        <Data>
        </Data>
        <Data>0</Data>
        <Data>553a89c7-0c18-11e4-be97-80c16ee27020</Data>
        <Data>4104</Data>
        <Data>f6a7a946597169e4aea5077b3b7f0848</Data>
      </EventData>
    </Event>
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Log Name:      Application
    Source:        Outlook
    Date:          7/15/2014 8:06:05 AM
    Event ID:      50
    Task Category: None
    Level:         Information
    Keywords:      Classic
    User:          N/A
    Computer:      Liz7PM-HP.armadale.local
    Description:
    The following providers do not implement fast shutdown APIs, but are being shut down using fast shutdown:
    MDConnector.dll (MAPI Store Provider)
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Outlook" />
        <EventID Qualifiers="16384">50</EventID>
        <Level>4</Level>
        <Task>0</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2014-07-15T12:06:05.000000000Z" />
        <EventRecordID>66132</EventRecordID>
        <Channel>Application</Channel>
        <Computer>Liz7PM-HP.armadale.local</Computer>
        <Security />
      </System>
      <EventData>
        <Data>MDConnector.dll (MAPI Store Provider)
    </Data>
      </EventData>
    </Event>

  • Trouble with SAPconnect / sending email in ABAP-code

    Hi,
    with the code below I try to send an email from ABAP outside
    to an mail-account in the internet.
    I'll get no error/exceptions but the mail will be not send
    to the internet-mail-account.
    In Transaktion SCOT I checked the SAPconnect-Node "INT"-"SMTP".
    There is a mailserver with the right IP und the right Port. So I don't understand
    what could be the problem!?
    Can anybody help me and say me why the code below doesn't works?
    Best wishes!
    * For API
    data: maildata type sodocchgi1.
    data: mailtxt  type table of solisti1 with header line.
    data: mailrec  type table of somlrec90 with header line.
    start-of-selection.
      clear:    maildata, mailtxt,  mailrec.
      refresh:  mailtxt, mailrec.
      maildata-obj_name = 'TEST'.
      maildata-obj_descr = 'Test'.
      maildata-obj_langu = sy-langu.
      mailtxt-line = 'This is a test'.
      append mailtxt.
      mailrec-receiver = '[email protected]'.
      mailrec-rec_type  = 'U'.
      append mailrec.
        call function 'SO_NEW_DOCUMENT_SEND_API1'
             exporting
                  document_data              = maildata
                  document_type              = 'RAW'
                  put_in_outbox              = 'X'
             tables
                  object_header              = mailtxt
                  object_content             = mailtxt
                  receivers                  = mailrec
             exceptions
                  too_many_receivers         = 1
                  document_not_sent          = 2
                  document_type_not_exist    = 3
                  operation_no_authorization = 4
                  parameter_error            = 5
                  x_error                    = 6
                  enqueue_error              = 7
                  others                     = 8.
        if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
    * Start the send process using the following statement
    submit rsconn01 with mode = 'int' and return.
    Message was edited by:
            sebastian eckes

    SAP is a robust system, which gives many facilities in the form of Function Modules (FMs) for connecting to external systems or for use within the system. With a clever use of these FMs we can achieve a lot of things through ABAP code.
    This article focuses on ways to send E-mails and SAP Mails using ABAP code.
    Firstly SAP Mail
    A SAP mail is a mail internal to the SAP system. It is a very good forum to exchange information with other users. Using a SAP mail in ABAP code facilitates exchange of automatic messages at various stages of the business process. It is easy to use and saves many hassles involved in using workflows for exchanging messages.
    The ABAP code to send a sap mail is built around the FM SO_OBJECT_SEND which has the following pattern.
    call function 'SO_OBJECT_SEND'
    exporting
    EXTERN_ADDRESS = ' '
    FOLDER_ID = ' '
    FORWARDER = ' '
    OBJECT_FL_CHANGE = ' '
    OBJECT_HD_CHANGE = ' '
    OBJECT_ID = ' '
    OBJECT_TYPE = ' '
    OUTBOX_FLAG = ' '
    OWNER = ' '
    STORE_FLAG = ' '
    DELETE_FLAG = ' '
    SENDER = ' '
    CHECK_ALREADY_SENT = ' '
    importing
    object_id_new =
    sent_to_all =
    tables
    OBJCONT =
    OBJHEAD =
    OBJPARA =
    OBJPARB =
    receivers =
    PACKING_LIST =
    ATT_CONT =
    ATT_HEAD =
    NOTE_TEXT =
    exceptions
    active_user_not_exist = 1
    communication_failure = 2
    component_not_available = 3
    folder_not_exist = 4
    folder_no_authorization = 5
    forwarder_not_exist = 6
    note_not_exist = 7
    object_not_exist = 8
    object_not_sent = 9
    object_no_authorization = 10
    object_type_not_exist = 11
    operation_no_authorization = 12
    owner_not_exist = 13
    parameter_error = 14
    substitute_not_active = 15
    substitute_not_defined = 16
    system_failure = 17
    too_much_receivers = 18
    user_not_exist = 19
    x_error = 20
    others = 21.
    In the next article we will understand the main parameters and table interfaces of the FM.
    Import Parameters Name and Description     Field name     Field function
    Object_hd_change (structure) Contains the process to be done when SAP mail is marked for execution.When the Execute Icon in the SAP mail is clicked the corresponding object is executed     vmtyp     ‘D’ for dialog module ‘F’ for function module‘R’ for report‘T’ for transaction‘U’ for transaction with export
         Acnam     Name of the object which is to be executed, like name of transaction/report
         Skips     ‘X’ to execute first screen in background
         Objsns     Indicates sensitivity of the object. ‘P’ for private object‘F’ for functional object‘O’ for confidential object‘C’ for company confidential objectSensitivity level is restricted to ‘O’ for documents in shared folders
         Objla     Language of the document ‘E’ for Englishsy-langu for system language
         Objnam     Name of the document
         Objdes     Short description (Title) of the document
         Objsrt     Name of the sort field. This is used to group documents based on certain criteria
    Object_type Type of document to be sent with mail           ‘RAW’ for raw text (default) ‘DOC’ for word file ‘XLS’ for excel fileAll classes can be used except for folders (‘FOL’) and distribution lists (‘DLI’)
    Outbox_flag           ‘X’ to indicate that mail should also be stored in outbox of the user after sending (default ‘ ‘)
    Owner           Sap login of the user responsible for transmission
    Table Parameters Name and Description     Field Name     Field function
    Objcont Table to hold the body of the mail     Line     Text lines up to 255 characters
    Objhead Table to hold number of lines in the body of the mail, i.e size of the table in lines     Line     Text lines up to 255 characters
    Objpara Table to hold the set/get parameters to be transferred to the processing element     Name     Name of the parameter. Only first three characters are used
         Option     Not used
         Low     Value of the parameter in name
         High     Not used
    Objparb Table to hold information for mails to which a certain processing type is assigned. For a report or transaction with transfer of values to global memory, the table has to contain the parameters with relevant values. The memory id is taken from the first row. For a FM or dialog module, data in table will be transferred as table parameter msgdial     Name     For report or transaction with transfer of values to global memory, the field for first row should hold the name of the memory id used for export and the other rows should hold the parameter names. For FM or dialog module this field should hold the values as per the usage of the module
         Value     For report or transaction with transfer of values to global memory, the field for first row should remain empty and the other rows should hold values of the parameters. For FM or dialog module this field should hold the values as per the usage of the module
    Receivers Table to hold recipient details     Recnam     SAP login of the recipient. Append all the recipients to this table
         Sndcp     X for sending mail as a copy
         Sndex     X for sending as express document. This will prompt a logged on recipient saying that he or she has received an express mail
         Recesc     ‘B’ for SAP user ‘E’ for external email address‘U’ for unix address
    Export Parameters Name and Description     Field name     Field function
    Object_id_new Contains object id of document created during send process            
    Sent_to_all X indicates that document was sent to all recipients. Flag is not activated if sending fails in one or more cases           
    Main Exceptions Name and Description     Description
    Too_much_receivers      Number of recipients is greater than number for which sender is authorised to send
    Object_not_sent     Document was not delivered to any of the recipients
    Object_not_exist     Document class specified does not exist or cannot be sent
    Object_no_authorisation     Document could not be sent as one of the required authorisations does not exist
    Parameter_error     Invalid combination of parameter values transferred to FM
    X_error     Internal error occurred
    Once all the parameters and table interfaces are properly filled, call the function module to send the SAP mail to the recipient inbox.
    Care should be taken to report the status of execution of the function module to the user using one of the exceptions defined (refer function module pattern above)
    Though SAP mail is a very robust method of interacting with users within SAP system, it is always good to receive email in Microsoft inbox. This also works like an additional notification to users in case they do not check SAP mail regularly. The next article covers sending E-mails using ABAP.
    Sending Email to a non-SAP system:
    Though SAP mail is a very robust method of interacting with users within SAP system, it is always good to receive email in Microsoft inbox. This also works like an additional notification to users in case they do not check SAP mail regularly.
    Sending an email to the Microsoft Inbox is a way of interacting with a non SAP system through ABAP code and hence is very interesting. A fair knowledge of UNIX shell scripting is assumed here.
    The ABAP code to send an email to Microsoft inbox revolves around following UNIX script
    Echo "From:" "<"$1">" > <unix file path name>
    Echo "To:" "<"$2">" >> <unix file path name>
    Echo "Subject:" "<"$3">" >> <unix file path name>
    Cat $4 >> <unix file path name>
    Uuencode $5 $6 >> <unix file path name>
    Cat <unix file path name> | /usr/sbin/sendmail –f $fraddr $toaddr
    (Note : the commands in the above script can be case sensitive. Check the actual case on the unix installation in question)
    Let us understand the various parts of the above script.
    $1 = Sender email address
    $2 = Recipient email address
    $3 = Subject of the email
    $4 = Path of unix server file having email body
    Form email body as an internal table in ABAP program, download it to a unix server file
    $5 = Path of unix server file to be sent as email attachment
    $6 = Name to be given to the attachment (like test1.doc, test1.xls). The corresponding Microsoft icon
    will be shown in the email for the type of file attached ( Word document, excel document etc)
    The script builds a temporary file and pipes the file to the sendmail command to achieve the mission.
    This script can be invoked from SAP to send the mail to the intended recipient. Store this small script on the unix server. (Assume script name is sndmail )
    To do this we should define a link in the SAP system between a customized command and this unix script.
    The FM to define a customized command in SAP system has the following pattern.
    call function 'SXPG_CALL_SYSTEM'
    exporting
    commandname =
    PARAMETERS = ' '
    importing
    status =
    tables
    exec_protocol =
    exceptions
    no_permission = 1
    command_not_found = 2
    parameters_too_long = 3
    security_risk = 4
    wrong_check_call_interface = 5
    program_start_error = 6
    program_termination_error = 7
    x_error = 8
    parameter_expected = 9
    too_many_parameters = 10
    illegal_command = 11
    others = 12.
    In the next article we will understand the main parameters and table interfaces of the FM.
    Import Parameters Name and Description     Field name     Field function
    Commandname Name of unix shell script or command to be executed by SAP           Name of unix shell script to be invoked
    Parameters           The parameters to be sent to unix shell script ($1, $2 etc). Send parameters as a concatenated string separated by space and length not exceeding 128 characters For eg in UNIX environment the above shell script would be executed as Sndmail [email protected] [email protected] Trial /home/test.doc testmail.We will be simulating this command using the FM from SAP system
    Table Parameters Name and Description     Field Name     Field function
    Exec_protocol (structure) Table to get messages from unix server after shell script is executed     Length     Length of the message from external program i.e unix
         Message     Log message from external program i.e unix
    Export Parameters Name and Description     Field name     Field function
    Status Contains the status of execution of external program            Scheduling status of external program i.e unix
    Once the above FM is invoked with the necessary parameters the unix program sendmail will send a mail to the inbox of the recipient in Microsoft.
    The restriction on the parameter string length of 128 characters can be removed to make way for very long email addresses and subjects. Build the parameters into an internal table and download it as a file on the unix server. Instead of passing each parameter individually, pass the unix server path of this file as the parameter to the unix shell script (sndmail mentioned above). Modify the shell script to read every line of this parameter file as variables to be used in the shell script.
    In the next article we will see an example of the ABAP code you can use to send SAP Mails.
    REPORT ZTSAPMAIL.
    DATA: X_OBJECT_TYPE LIKE SOOD-OBJTP.
    DATA: BEGIN OF X_OBJECT_HD_CHANGE.
    INCLUDE STRUCTURE SOOD1.
    DATA: END OF X_OBJECT_HD_CHANGE.
    DATA: BEGIN OF X_OBJCONT OCCURS 10.
    INCLUDE STRUCTURE SOLI.
    DATA: END OF X_OBJCONT.
    DATA: BEGIN OF X_OBJHEAD OCCURS 0.
    INCLUDE STRUCTURE SOLI.
    DATA: END OF X_OBJHEAD.
    DATA: BEGIN OF RAW_HEAD.
    INCLUDE STRUCTURE SORH.
    DATA: END OF RAW_HEAD.
    DATA: BEGIN OF X_RECEIVERS OCCURS 0.
    INCLUDE STRUCTURE SOOS1.
    DATA: END OF X_RECEIVERS.
    PARAMETERS: RECEIVER LIKE X_RECEIVERS-RECNAM. " Name
    *BUILD MESSAGE HEADER
    MOVE 'Sort field goes here' TO X_OBJECT_HD_CHANGE-OBJSRT. " Sort field
    MOVE 'Name of the object goes here' TO X_OBJECT_HD_CHANGE-OBJNAM. " Name
    MOVE 'Document title goes here' TO X_OBJECT_HD_CHANGE-OBJDES. " Title
    MOVE 'F' TO X_OBJECT_HD_CHANGE-OBJSNS. " Functional OBJECT
    MOVE 'E' TO X_OBJECT_HD_CHANGE-OBJLA. " Language
    Object type of the new document
    MOVE 'RAW' TO X_OBJECT_TYPE.
    CLEAR X_OBJCONT.
    MOVE 'Contents of mail' TO X_OBJCONT-LINE.
    APPEND X_OBJCONT.
    CLEAR X_OBJCONT-LINE. APPEND X_OBJCONT.
    MOVE 'More contents' TO X_OBJCONT-LINE.
    APPEND X_OBJCONT.
    MOVE 'Still more contents'
    to x_objcont-line.
    APPEND X_OBJCONT.
    MOVE ' ' TO X_OBJCONT-LINE.
    APPEND X_OBJCONT.
    Specific header (Dependent on the object type, here RAW)
    REFRESH X_OBJHEAD.
    DESCRIBE TABLE X_OBJCONT LINES RAW_HEAD-RAWSIZ.
    MOVE RAW_HEAD TO X_OBJHEAD.
    APPEND X_OBJHEAD.
    *RECEIVERS table
    CLEAR X_RECEIVERS.
    REFRESH X_RECEIVERS.
    MOVE RECEIVER TO X_RECEIVERS-RECNAM. " Name
    MOVE 'B' TO X_RECEIVERS-RECESC. " Receiver type
    MOVE 'X' TO X_RECEIVERS-SNDCP. " Send as a copy
    MOVE 'X' TO X_RECEIVERS-SNDEX. " EXPRESS DOCUMENT
    APPEND X_RECEIVERS.
    CALL FUNCTION 'SO_OBJECT_SEND'
    EXPORTING
    folder_id = 'OUTBOX'
    forwarder = x_forwarder
    object_fl_change = x_object_fl_change
    OBJECT_HD_CHANGE = X_OBJECT_HD_CHANGE
    object_id = x_object_id
    OBJECT_TYPE = X_OBJECT_TYPE
    OUTBOX_FLAG = 'X'
    OWNER = SY-UNAME
    store_flag = x_store_flag
    importing
    object_id_new = x_object_id_new
    sent_to_all = x_sent_to_all "May need to use
    TABLES
    OBJCONT = X_OBJCONT
    OBJHEAD = X_OBJHEAD
    objpara = x_objpara
    objparb = x_objparb
    RECEIVERS = X_RECEIVERS.
    REPORT ZTUNIXMAIL.
    DATA : TO_ADDRESS LIKE SY_LISEL,
    FROM_ADDRESS LIKE SY-LISEL,
    SUBJECT LIKE SY-LISEL,
    ATTACHMENT_NAME LIKE SY_LISEL,
    DATA_FILE_PATH LIKE SXPGCOLIST-PARAMETERS,
    BODY_FILE_PATH LIKE SXPGCOLIST-PARAMETERS.
    DATA : BEGIN OF INT_EMAIL_ATTACH OCCURS 0,
    TXTLINE CHAR(255),
    END OF INT_EMAIL_ATTACH.
    DATA : BEGIN OF INT_EMAIL_BODY OCCURS 0,
    TXTLINE CHAR(255),
    END OF INT_EMAIL_BODY.
    CLEAR : INT_EXEC_PROTOCOL,INT_EMAIL_ATTACH,INT_EMAIL_BODY.
    REFRESH : INT_EXEC_PROTOCOL,INT_EMAIL_ATTACH,INT_EMAIL_BODY.
    INT_EMAIL_ATTACH-TXTLINE = 'Put all attachment text in this table'.
    APPEND INT_EMAIL_ATTACH. CLEAR INT_EMAIL_ATTACH.
    INT_EMAIL_BODY-TXTLINE = 'Put all attachment text in this table'.
    APPEND INT_EMAIL_BODY. CLEAR INT_EMAIL_BODY.
    CONCATENATE TO_ADDRESS
    FROM_ADDRESS
    SUBJECT
    BODY_FILE_PATH
    DATA_FILE_PATH
    ATTACHMENT_NAME
    INTO V_PARAMETERS.
    IF NOT INT_EMAIL_ATTACH[] IS INITIAL.
    OPEN DATASET DATA_FILE_PATH FOR OUTPUT IN TEXT MODE.
    LOOP AT INT_EMAIL_ATTACH.
    TRANSFER INT_EMAIL_ATTACH-TXTLINE TO DATA_FILE_PATH.
    ENDLOOP.
    CLOSE DATASET DATA_FILE_PATH.
    ENDIF.
    IF NOT INT_EMAIL_BODY[] IS INITIAL.
    OPEN DATASET BODY_FILE_PATH FOR OUTPUT IN TEXT MODE.
    LOOP AT INT_EMAIL_BODY.
    TRANSFER INT_EMAIL_BODY-TXTLINE TO BODY_FILE_PATH.
    ENDLOOP.
    CLOSE DATASET BODY_FILE_PATH.
    ENDIF.
    CALL FUNCTION 'SXPG_CALL_SYSTEM'
    EXPORTING
    COMMANDNAME = 'Z_EMAIL' - Command calling unix script
    PARAMETERS = V_PARAMETERS
    importing
    status = ''
    TABLES
    EXEC_PROTOCOL = INT_EXEC_PROTOCOL
    EXCEPTIONS
    NO_PERMISSION = 1
    COMMAND_NOT_FOUND = 2
    PARAMETERS_TOO_LONG = 3
    SECURITY_RISK = 4
    WRONG_CHECK_CALL_INTERFACE = 5
    PROGRAM_START_ERROR = 6
    PROGRAM_TERMINATION_ERROR = 7
    X_ERROR = 8
    PARAMETER_EXPECTED = 9
    TOO_MANY_PARAMETERS = 10
    ILLEGAL_COMMAND = 11
    OTHERS = 12.
    regards,
    srinivas
    <b>*Reward points for useful answers*</b>

  • Send email default sender to match email settings of logged in user

    Hi,
    I was wondering how i could add this into my site.
    If you look at other sites the user can put in their email settings and then view their inbox from within the site when logged in.
    1st Question is:  What settings do I need to store in a table for the user to setup their email settings.  I assume the obvious server name, username and password.
    2nd Question is: Does anyone know how to add in an email view, free would be good.
    3rd Question which is the most important to addt is this:  I want the user to input their email settings in their user profile page so hence need to know what settings to store in the table.  From their i want to when using the addt send email SB to check the user logged in session and match the userid and use their settings to send the email.
    I know how to use the recordset to get the settings of the person who has logged in as that is not too difficult but instead of using the kt default sender which you input in control panel i would want it to use the person who has logged ins email settings,  how can i stop addt from using the default sender and what code would i use in my page for addt to send the email using that person email settings?
    Hope someone can help.
    Many thanks

    hi,
    thanks for getting back to me.  what i was hoping was that the user could send the email via the site suing their own email settings?
    so say the domain is domain.com which the newsletter application sits on.  but the user has his own domain of example.com with his own email settings.
    what i have done is create a mini newsletter system using addt.  i wanted to allow the user to input their own mail server settings and when it clicked send addt would use the email settings to send the email via php.
    there is newsletter system like "constant contact" which you can use to send using their system however it comes into the inbox as if from the person who sent it.
    hope you can help.
    many thanks

  • Sending email notifications in oim 11g approval flow dynamically

    Hi,
    I have 4 level approval workflow in oim 11g and developed custom composite to get all the approver ids and and assigning these ids into 4 variables.
    And used these variables in my custom 4 level sequential workflow. This workflow is working fine. Now I need to update this composite to send email notifications to the approver. So updated code to retrieve email ids and to store them in 4 more vairables. I cannot send all emails at a time thru the code. I need to send email only to the corresponding approver only when the flow reaches to that particular level.
    Subject and body will be same but the email address will vary.
    Can you please let me know the step by step process to implement notifications to these many levels.
    If you think, this is not correct approach (storing all email ids in variables and then sending notifications), please let me know correct approach.
    Thanks,
    Mary

    The way to do it would be to put your human task inside a while loop. This while loop would set a variable to the approver's userid and would continue till all the four approve it. In your human task you need just one approver and that would be the variable which the while loop sets.
    If you do it this way, then you can use the OOTB notification tab in the .task and select the 'Assignee' as the email notification receiver and you won't have to worry about getting the email ids as well.
    As for the current approach which you have, that is of using the sequential approvers in the human task, I haven't tried it, but just try setting the notification tab in the .task to 'Assignee' and event 'On Assignment'. That should do it as well.
    -Bikash

  • Trying to send email with contents in the body of the message

    Hi,
    Has anyone been successful in modifying the RW_EMAIL_NOTIFICATION script in such a way that allows the contents of the email "body" to be sent as a parameter from a calling script? Thanks.
    Regards,
    David Carr

    David,
    Here is the solution I use which hopefully will suit your requirements and is a little more elegant than the workarounds for using rwmail.  Oracle has the ability to send SMTP emails once you enable the UTL_SMTP package. 
    Log in to Oracle as the SYS user and run the Oracle supplied script to create the UTL_SMTP package - utlsmtp.sql in the Oracle rdbms/admin directory.
    Now create a procedure that you can call subsequently in your scripts to send emails using the UTL_SMTP package.  I created this script under the SYSJCS schema as I'm only going to call it from there, but you could create it as SYS and then create a public synonym for it.
    I called my procedure send_mail (see below).  The enabling of the UTL_SMTP and the creation of the send_mail procedures are one-offs and don't have to be repeated (unless you want to change something about send_mail).  Just change the name of the mailhost in the procedure to one appropriate for your  company.
    NB: I have had to substitute the "at symbol" with *at* otherwise the forum wouldn't accept the post.
    CREATE OR REPLACE PROCEDURE send_mail (
    pSender    VARCHAR2,
    pRecipient VARCHAR2,
    pSubject   VARCHAR2,
    pMessage   VARCHAR2) IS
    mailhost  CONSTANT VARCHAR2(30) := 'yoursmtpcapable.mailserver.corp';
    crlf      CONSTANT VARCHAR2(2):= CHR(13) || CHR(10);
    mesg      VARCHAR2(1000);
    mail_conn utl_smtp.connection;
    BEGIN
       mail_conn := utl_smtp.open_connection(mailhost, 25);
       mesg := 'Date: ' ||
            TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss') || crlf ||
               'From: <'|| pSender ||'>' || crlf ||
               'Subject: '|| pSubject || crlf ||
               'To: '||pRecipient || crlf || '' || crlf || pMessage;
       utl_smtp.helo(mail_conn, mailhost);
       utl_smtp.mail(mail_conn, pSender);
       utl_smtp.rcpt(mail_conn, pRecipient);
       utl_smtp.data(mail_conn, mesg);
       utl_smtp.quit(mail_conn);
    END send_mail;
    Now you can call the send_mail procedure with, e.g.
    send_mail(pSender=>'redwood**at**mycompany.com',pRecipient=>'basisteam**at**mycompany.com',pSubject=>'Alert: Redwood job failure',pMessage=>'There has been a job failure that should be addressed a.s.a.p.');
    Here is a practical application of this email facility.  I created a trigger for ON_JOB_STATUS_CHANGE called _ERROR and here is the code that is executed.  We store contact details for business users that need to be notified of a job failure in the Comment field of the script definition, so for a failed job we grab that info and email it to a power user dlist which includes 24/7 Ops that will call-out the contacts specified.
    Any Comment field that starts with the text CRITICAL_JOB results in an email to the Ops that will perform the call-out, otherwise the email goes to a less critical dlist.
    procedure SYSJCS.ON_JOB_STATUS_CHANGE_ERROR (
      p_job_id     in integer
    , p_old_status in varchar2
    , p_new_status in varchar2
    is   
        v_script       varchar2(30);                                   
        v_step_id      varchar2(9);
        v_description  VARCHAR2(80);
        v_comment_text VARCHAR2(4000);
    begin
        if p_new_status in ('E', 'O') -- Error or Console
        then
            select script_name, decode(step_id, null,'JOB/CHAIN','STEP')
            into v_script, v_step_id
            from jcs_jobs
            where job_id = p_job_id;                              
            select description, comment_text
            into v_description, v_comment_text     
            from jcs_scripts
            where name = v_script;                              
            if ( SUBSTR(v_comment_text,1,12) = 'CRITICAL_JOB' )
            then    
               send_mail(pSender=>'redwood**at**mycompany.com',
                         pRecipient=>'criticaljobalerts**at**mycompany.com',
                         pSubject=>'CRITICAL ALERT: Job failure in '||v_script||' ('||p_job_id||')',
                         pMessage=>'Job Description: '||v_description||chr(13)||chr(13)||'Operations Team please ensure you contact one of the following people via telephone a.s.a.p.'||chr(13)||chr(13)||'Comments: '||chr(13)||v_comment_text);
            else
               send_mail(pSender=>'redwood**at**mycompany.com',
                         pRecipient=>'basisteam**at**mycompany.com',
                         pSubject=>'Alert: Job failure in '||v_script||' ('||p_job_id||')',
                         pMessage=>'Job Description: '||v_description||chr(13)||'Comments: '||chr(13)||v_comment_text);
            end if;
        end if;
    end;
    Hope this was useful.
    Regards
    Guy

Maybe you are looking for