How to Put a mail to designated User with txt format

Hi Friends,
I have a small in  mailing concept of BDC's. Can any one check my code and tell me why my code is not poping any message in txt file. I am not getting any data in text file but the mail is getting trigerred.
here below is the code regarding mail Concept. Please help me ASAP. This is very important. Please revert where I am wrong and correct me if you can.
Points will defintely be rewarded.
*         To Send a mail to the conserned user when we get the 824 detailed
    DATA: V_USRID TYPE PA0105-USRID,    " variable for usrid
          V_SUBJECT(100) TYPE C,               " variable for subject line
          V_SENT_ALL(1) TYPE C.               " variable to  sent messages
    CONSTANTS: C_U(1) TYPE C VALUE 'U',     " constant for U
               C_X(1)       TYPE C VALUE 'X',     " constant for X
               C_INT(3)     TYPE C VALUE 'INT',   " constant for INT
               C_SAPRPT(6)  TYPE C VALUE 'SAPRPT'," constant for SAPRPT
               C_1(1)       TYPE C VALUE '1',     " constant for 1
               C_0(1)       TYPE C VALUE '0',     " constant for 0
               C_B(1)       TYPE C VALUE 'B',      " Constant for B
               C_RAW(3)     TYPE C VALUE 'RAW',   " constant for RAW
               C_TXT(3)     TYPE C VALUE 'TXT',   " constant for TXT
               C_ERR(30)    TYPE C VALUE 'Error 824 detailed file', " constant for Obj description
               C_INTFC(15)  TYPE C VALUE 'Interface', "constant for Obj Name in attachment
               C_F(1)       TYPE C VALUE 'F'.     " constant for F
    DATA : T_MESSAGE      TYPE STANDARD TABLE OF SOLISTI1, "Segment e1edk01
           T_PACKING_LIST TYPE TABLE OF  SOPCKLSTI1," table for packing list
           T_RECEIVERS    TYPE TABLE OF  SOMLRECI1, " table for receivers
           WA_PACKING_LIST TYPE  SOPCKLSTI1,     " work area for mail list
           WA_CONTENTS     TYPE  SOLISTI1,       " work area for contents
           WA_RECEIVERS    TYPE SOMLRECI1,       " work area for recivers
           WA_MESSAGE      TYPE  SOLISTI1,       " work area for messages
           T_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
           V_LINES_TXT TYPE I,
           V_LINES_BIN TYPE I,
           WA_DOC_DATA     TYPE SODOCCHGI1.      " work area for doc data
*To prepare the subject line
    CONCATENATE TEXT-003 P_FILE1  INTO V_SUBJECT SEPARATED BY SPACE.
    CLEAR P_FILE1.
Create Message Body
Title and Description
    T_OBJTXT = 'test with dat file Attachment!'.
    APPEND T_OBJTXT.
    DESCRIBE TABLE T_OBJTXT LINES V_LINES_TXT.
    READ TABLE T_OBJTXT INDEX V_LINES_TXT.
   *To append the first line description
    WA_MESSAGE-LINE+1(10) = TEXT-001.
    WA_MESSAGE-LINE+41(20) = TEXT-002.
    APPEND WA_MESSAGE TO T_MESSAGE.
    CLEAR WA_MESSAGE.
*Add the recipients email address
    CLEAR WA_RECEIVERS.
    REFRESH T_RECEIVERS.
    WA_RECEIVERS-RECEIVER   = '[email protected]'."V_USRID.
    WA_RECEIVERS-REC_TYPE   = C_U.
    WA_RECEIVERS-COM_TYPE   = C_INT.
    WA_RECEIVERS-NOTIF_DEL  = C_X.
    WA_RECEIVERS-NOTIF_NDEL = C_X.
    APPEND WA_RECEIVERS TO T_RECEIVERS.
    CLEAR WA_RECEIVERS.
    CLEAR WA_RECEIVERS.
    WA_RECEIVERS-RECEIVER = 'VSATISHRAJU'.  " replace with <login name>
    WA_RECEIVERS-REC_TYPE = 'B'.
    WA_RECEIVERS-EXPRESS = C_X.
    APPEND WA_RECEIVERS TO T_RECEIVERS.
    CLEAR WA_RECEIVERS.
Describe the body of the message
    CLEAR WA_PACKING_LIST.
    REFRESH T_PACKING_LIST.
    WA_PACKING_LIST-TRANSF_BIN = SPACE.
    WA_PACKING_LIST-HEAD_START = C_1.
    WA_PACKING_LIST-HEAD_NUM   = C_0.
    WA_PACKING_LIST-BODY_START = C_1.
   WA_PACKING_LIST-BODY_NUM = V_LINES_TXT.
    DESCRIBE TABLE T_MESSAGE LINES WA_PACKING_LIST-BODY_NUM.
    WA_PACKING_LIST-DOC_TYPE   = C_RAW.
    APPEND WA_PACKING_LIST TO T_PACKING_LIST.
  *    **** Attachment
(pdf-Attachment)
    WA_PACKING_LIST-TRANSF_BIN = C_X.
    WA_PACKING_LIST-HEAD_START = C_1.
    WA_PACKING_LIST-HEAD_NUM = C_0.
    WA_PACKING_LIST-BODY_START = C_1.
   WA_PACKING_LIST-BODY_NUM = V_LINES_BIN.      "satish
    WA_PACKING_LIST-BODY_NUM = V_LINES_TXT + 1 .
   WA_PACKING_LIST-DOC_TYPE = 'PDF'.      "comments by siva
    WA_PACKING_LIST-DOC_TYPE = C_TXT.       " changes by siva
    WA_PACKING_LIST-OBJ_NAME = C_INTFC.
   WA_PACKING_LIST-doc_size   = 255 * ( V_LINES_TXT + 1 ).
    WA_PACKING_LIST-OBJ_DESCR =  C_ERR.
    APPEND WA_PACKING_LIST TO T_PACKING_LIST.
    CLEAR WA_PACKING_LIST.
*Populate the subject/generic message attributes
    WA_DOC_DATA-OBJ_LANGU   = SY-LANGU.
    WA_DOC_DATA-OBJ_NAME    = C_SAPRPT.
    WA_DOC_DATA-OBJ_DESCR   = V_SUBJECT.
    WA_DOC_DATA-SENSITIVTY  = C_F.
    CLEAR : V_SUBJECT.
*Call the FM to post the message to SAPMAIL
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        DOCUMENT_DATA              = WA_DOC_DATA
        PUT_IN_OUTBOX              = C_X
      IMPORTING
        SENT_TO_ALL                = V_SENT_ALL
      TABLES
        PACKING_LIST               = T_PACKING_LIST
        CONTENTS_TXT               = T_MESSAGE
       CONTENTS_BIN               = T_OBJBIN
        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.
   IF SY-SUBRC NE 0.
     RAISE NO_MAIL.
   ENDIF.
    COMMIT WORK.
  ENDIF.

Why dont you see output type 5 in the output condition itself?  You dont have to code for this.
Albert

Similar Messages

  • How to send a mail to the user with attachement

    Hi Experts,
    I have a requirement where user needs to get the automatic mail which has the updated information sheet as the attachement.
    Kindly give me a clue on this.
    if any body has model program for this...kidnly send it to [email protected]
    Thanks in Advance,
    Aiswarya

    HI
    good
    go throug this link
    http://help.sap.com/saphelp_nw04s/helpdata/en/38/71f865c2c9a94ab1dce95792187c16/content.htm
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    go through this report=>
    : Report  ZSAPTALK                                                   :
    : Author  SAPdev.co.uk                                               :
    : Description :                                                      :
    : Send mail message to SAP mail inbox.                               :
    :                     Please visit www.sapdev.co.uk for further info :
    REPORT ZSAPMAIL NO STANDARD PAGE HEADING.
    TABLES: DRAD,
            QINF,
            DRAW,
            SOUC,
            SOFD,
            DRAP.
    DATA: P_RETURN_CODE LIKE SY-SUBRC.
    data: d_username LIKE DRAP-PRNAM.
    mail declarations
    DATA : BEGIN OF NEW_OBJECT_ID.         " the newly created email object
            INCLUDE STRUCTURE SOODK.
    DATA : END OF NEW_OBJECT_ID.
    DATA : BEGIN OF FOLDER_ID.             " the folder id of the outbox
            INCLUDE STRUCTURE SOODK.
    DATA : END OF FOLDER_ID.
    DATA : BEGIN OF REC_TAB OCCURS 5.     " the table which will contain the
            INCLUDE STRUCTURE SOOS1.       " information on the destination
    DATA : END OF REC_TAB.
    DATA : BEGIN OF OBJECT_HD_CHANGE.      " the table which contains the
            INCLUDE STRUCTURE SOOD1.       " info for the object we will be
    DATA : END OF OBJECT_HD_CHANGE.        " creating
    DATA : OBJECT_TYPE LIKE SOOD-OBJTP.    " the type of object
    DATA : BEGIN OF OBJHEAD OCCURS 5.      " the header of the object
            INCLUDE STRUCTURE SOLI.
    DATA : END OF OBJHEAD.
    DATA : BEGIN OF OBJCONT OCCURS 0.      " the contents of the object
            INCLUDE STRUCTURE SOLI.        " i.e. the text etc
    DATA : END OF OBJCONT.
    DATA : BEGIN OF OBJPARA OCCURS 5.      " formatting options
            INCLUDE STRUCTURE SELC.
    DATA : END OF OBJPARA.
    DATA : BEGIN OF OBJPARB OCCURS 5.      " formatting options
            INCLUDE STRUCTURE SOOP1.
    DATA : END OF OBJPARB.
    DATA : BEGIN OF T_MAIL_TEXT OCCURS 0,  "Message table for messages to
            STRING(255),                   "user via mailbox
           END OF T_MAIL_TEXT.
    Parameter: p_uname like sy-uname.
    **START-OF-SELECTION
    START-OF-SELECTION.
        d_username = p_uname.
        PERFORM POPULATE_EMAIL_TEXT.
        PERFORM SETUP_TRX_AND_RTX_MAILBOXES USING P_RETURN_CODE.
        PERFORM CREATE_AND_SEND_MAIL_OBJECT.
          FORM POPULATE_EMAIL_TEXT                                      *
          Inserts text for email message                                *
    FORM POPULATE_EMAIL_TEXT.
      CLEAR T_MAIL_TEXT-STRING.            "puts a blank line in
      APPEND T_MAIL_TEXT.
      APPEND T_MAIL_TEXT.
    adds failed list  on to end of success list.
      T_MAIL_TEXT-STRING = 'Test email message line 1'.
      APPEND T_MAIL_TEXT.
      T_MAIL_TEXT-STRING = 'Test email message line 1'.
      APPEND T_MAIL_TEXT.
      CLEAR T_MAIL_TEXT-STRING.            "puts a blank line in
      APPEND T_MAIL_TEXT.
      T_MAIL_TEXT-STRING = 'Header1    Header2    Header3'.
      APPEND T_MAIL_TEXT.
      T_MAIL_TEXT-STRING = '----
      APPEND T_MAIL_TEXT.
    ENDFORM.
    *&      Form  SETUP_TRX_&_RTX_MAILBOXES
      Ensure that the mailboxes of the sender (INTMGR) are set up OK
    FORM SETUP_TRX_AND_RTX_MAILBOXES USING P_RETURN_CODE.
    get the user no of the sender in order to add the mail to the
    user name's outbox for future reference
      SELECT SINGLE * FROM SOUC
               WHERE SAPNAM = SY-UNAME.    "SAP name of a SAPoffice user
      IF SY-SUBRC NE 0.
        "Error finding the SAPoffice user info for the user
        MESSAGE E064(ZR53) WITH SY-UNAME.
        P_RETURN_CODE = 1.
        EXIT.
      ENDIF.
    *Get the outbox No for the sender from the user No where the folder
                                           " type is an outbox
      SELECT * FROM SOFD WHERE OWNTP = SOUC-USRTP   "Owner type from ID
                           AND OWNYR = SOUC-USRYR   "Owner year from the ID
                           AND OWNNO = SOUC-USRNO   "Owner number from the I
                           AND FOLRG = 'O'."Output box
      ENDSELECT.
      IF SY-SUBRC NE 0.
        " Error getting folder information for the user
        MESSAGE E065(ZR53) WITH SY-UNAME.
        P_RETURN_CODE = 1.
        EXIT.
      ENDIF.
    ENDFORM.                               " SETUP_TRX_&_RTX_MAILBOXES
    *&      Form  CREATE_AND_SEND_MAIL_OBJECT
    FORM CREATE_AND_SEND_MAIL_OBJECT.
      FOLDER_ID-OBJTP = SOFD-FOLTP.        " the folder type ( usually FOL )
      FOLDER_ID-OBJYR = SOFD-FOLYR.        " the folder year ( usually 22 )
      FOLDER_ID-OBJNO = SOFD-FOLNO.        " the folder no.
      OBJECT_TYPE     = 'RAW'.             " the type of object being added
    build up the object information for creating the object
      OBJECT_HD_CHANGE-OBJLA  = SY-LANGU.  " the language of the email
      OBJECT_HD_CHANGE-OBJNAM = 'PS to DM Interface'. " the object name
    mail subject 'Mass Linking of QA, pass/fail'
      MOVE TEXT-002 TO OBJECT_HD_CHANGE-OBJDES.
      OBJECT_HD_CHANGE-DLDAT = SY-DATUM.   " the date of the email
      OBJECT_HD_CHANGE-DLTIM = SY-UZEIT.   " the time of the email
      OBJECT_HD_CHANGE-OBJPRI = '1'.       " the priority ( highest )
      OBJECT_HD_CHANGE-OBJSNS = 'F'.       " the object sensitivity
    F is functional, C - company sensitive
    object_hd_change-skips  = ' '.       " Skip first screen
    object_hd_change-acnam  = 'SM35'.    " Batch imput transaction
    object_hd_change-vmtyp  = 'T'.       " Transaction type
    add the text lines into the contents of the email
      CLEAR OBJCONT.
      REFRESH OBJCONT.
    free objcont.      " added this to delete the mail contents records
      LOOP AT T_MAIL_TEXT.
        OBJCONT-LINE = T_MAIL_TEXT-STRING.
        APPEND OBJCONT.
      ENDLOOP.
      CLEAR OBJCONT.
    build up the table of receivers for the email
      REC_TAB-RCDAT = SY-DATUM.            " the date to send the email
      REC_TAB-RCTIM = SY-UZEIT.            " the time to send the email
    the SAP username of the person who will receive the email
      REC_TAB-RECNAM = D_USERNAME.
    the user type of the person who will send the email ( USR )
      REC_TAB-SNDTP = SOUC-USRTP.
    the user year of the person who will send the email ( 22 )
      REC_TAB-SNDYR = SOUC-USRYR.
    the user number of the person who will send the email
      REC_TAB-SNDNO = SOUC-USRNO.
    the sap username of the person who will send the email
      REC_TAB-SNDNAM = SY-UNAME.
    get the user info for the receiver of the document
      SELECT SINGLE * FROM SOUC WHERE SAPNAM = D_USERNAME.
      IF SY-SUBRC NE 0.
        WRITE : / TEXT-001, D_USERNAME.    "usnam.
        EXIT.
      ENDIF.
    the user number of the person who will receive the email ( USR )
      REC_TAB-RECNO = SOUC-USRNO.
    the user type of the person who will receive the email ( USR )
      REC_TAB-RECTP = SOUC-USRTP.
    the user year of the person who will receive the email ( USR )
      REC_TAB-RECYR = SOUC-USRYR.
    the priority of the email ( highest )
      REC_TAB-SNDPRI = '1'.
    check for delivery on the email
      REC_TAB-DELIVER = 'X'.
    send express so recipient knows there is a problem
      REC_TAB-SNDEX = 'X'.
    check for a return receipt
      REC_TAB-READ = 'X'.
    the sap username of the person receiving the email
      REC_TAB-ADR_NAME = D_USERNAME.       "usnam.
    add this receiver to the internal table
      APPEND REC_TAB.
      CLEAR REC_TAB.
    call the function to create the object in the outbox of the sender
      CALL FUNCTION 'SO_OBJECT_INSERT'
           EXPORTING
                FOLDER_ID                  = FOLDER_ID
                OBJECT_HD_CHANGE           = OBJECT_HD_CHANGE
                OBJECT_TYPE                = OBJECT_TYPE
                OWNER                      = SY-UNAME
           IMPORTING
                OBJECT_ID                  = NEW_OBJECT_ID
           TABLES
                OBJCONT                    = OBJCONT
                OBJHEAD                    = OBJHEAD
                OBJPARA                    = OBJPARA
                OBJPARB                    = OBJPARB
           EXCEPTIONS
                ACTIVE_USER_NOT_EXIST      = 1
                COMMUNICATION_FAILURE      = 2
                COMPONENT_NOT_AVAILABLE    = 3
                DL_NAME_EXIST              = 4
                FOLDER_NOT_EXIST           = 5
                FOLDER_NO_AUTHORIZATION    = 6
                OBJECT_TYPE_NOT_EXIST      = 7
                OPERATION_NO_AUTHORIZATION = 8
                OWNER_NOT_EXIST            = 9
                PARAMETER_ERROR            = 10
                SUBSTITUTE_NOT_ACTIVE      = 11
                SUBSTITUTE_NOT_DEFINED     = 12
                SYSTEM_FAILURE             = 13
                X_ERROR                    = 14
                OTHERS                     = 15.
      IF SY-SUBRC NE 0.
        MESSAGE A063(ZR53) WITH SY-SUBRC.
        EXIT.
      ENDIF.
    call the function to send the already created email to the receivers
      CALL FUNCTION 'SO_OBJECT_SEND'
           EXPORTING
                FOLDER_ID                  = FOLDER_ID
                OBJECT_ID                  = NEW_OBJECT_ID
                OUTBOX_FLAG                = 'X'
                OWNER                      = SY-UNAME
           TABLES
                RECEIVERS                  = REC_TAB
           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.
      IF SY-SUBRC EQ 0.
        MESSAGE I035(ZR53) WITH NEW_OBJECT_ID D_USERNAME. "usnam.
      ELSE.
        MESSAGE I036(ZR53) WITH D_USERNAME."      sy-subrc.
      ENDIF.
    ENDFORM.                               " CREATE_AND_SEND_MAIL_OBJECT
    thanks
    mrutyun

  • How to send external mails to the user

    Dears,
    How to send external mails to the user who creates the sales document (Quotation)
    Can you please suggest what modification required in the FM
    Thanks,
    pinky

    You can have a partner function like 'Created by' and use an exit to populate the User ID to this partner function(dont have the system right now but i think this can be done with standard partner detr. procedure also)
    Then, create an Output type for that Partner function with transmission medium as 'External Send'. You can use the standard SAP program to trigger the email. To send the actual email after the output is trigerred, the link connection has to be set up be BASIS but if you want to check, then goto SOST and see if the email got trigerred or not.

  • Rwclient, how to put E-mail body

    Dear Gurus,
    On Oracle AS, by using below comand I am able to generate reports and able to send them by Email but I would like to put Mail Body so could you please help me on this.
    How to put E-mail body on this comand.
    rwclient server=servicename report=reportname.rdf userid=dbusername/password@dbaliasname desformat=pdf destype=mail DESNAME=mailDESNAME=[email protected]@amazegifts.com SUBJECT="Amaze Gifts Mail"
    Regards,
    Satish Kumar Sadhu.

    Since email messages are text-based, only some email programs allow them to be viewed with html code to add color, style changes, etc. What you need to do is read some tutorials on basic html coding. i.e. <b>BOLD</b> would show BOLD with bold lettering.
    Allen
    Sun Developer Support

  • I need to know how to put a photo in a box with text under photo, so they all will move in page

    I need to know how to put a photo in a box with text under it, so they move together in a page of text.

    The Acrobat SDK might be a starting point.
    From there, perhaps a plug-in (built with C+).
    Perhaps with a licensed release of a PDF Library (this could be $$).
    The viable and cost effective alternative is use the tried and true.
    Authoring in an appropriate authoring application with appropriate tag management.
    Example:  Adobe InDesign; Adobe FrameMaker or MS Word with PDFMaker (comes with install of Acrobat).
    This way you place "Alternative Text" when mastering content in the authoring file.
    Going the route and with some look-see (research) you may find programmatic approaches to placing the alt txt in the authoring file.
    Note: as discussed in the Matterhorn Protocols there is no programmatic method that provides a fully accessible PDF (specifically, that is an ISO 14289-1, PDF/UA-1 compliant PDF).
    Regardless, here you have a sub-forum for discussions on Acrobat usage.
    Consequently discussions on/of 3rd party software is rather out of scope eh.
    Be well...

  • Can anyone let me know how can i get the ouput from BW in .txt format.

    Can anyone let me know how can i get the ouput from BW in .txt format. See we can get output as Excel(i.e BEX) and manually convert it into txt format. I need a direct or automated way to do the same.no human intervention.
    mail me at [email protected] or post answer in sdn.

    Please do not multiple post across forums..
    how can i save the data in BEX reports in .txt format automatically
    This helps in keeping track of answers and avoids the issue of repeated answers across forums...
    Please close one of the threads as answered and provide the link that you want to follow
    Arun

  • How to access unread mails of all users in Exchange server without having Passwords and without giving mailbox access to other user.

    Hi all,
       I am using Exchange server 2013, my task is to create
    Service , that
    need's to  monitor continuously for new mails of all Mailboxes in
    my server. if any user got new mail i need to get that Mail Subject, Mail Body, Sender Email Address [From emailId] .  
    Limitation
    : I don't have Passwords of mailboxes , so i gave all mailbox access permission  to one user , then i completed this   service using below code.
     But now, Client
    not willing to give Mailbox Permissions to one user because of security problems.
    How can i do this without passwords and without giving permissions to other user ?
    i don't want all mailbox access , i just need only
    access Mail Subject , Body and Sender mail address .
    How can i achieve
    this ?
    Process i follow
    => I created new user in server , and then i gave full permissions of all Mailboxes to newly created user[ex: james] in database level.
         i use below command for giving permissions in database level.
    Get-MailboxDatabase -Identity <Database Name> | Add-ADPermission -User <User> -AccessRights GenericAll
     => using below code i am searching unread mails of all user Mailboxes and then getting Subject, body and Sender Email            address . here i am have list of users,
    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
    service.Credentials = new WebCredentials("[email protected]", "password");
    service.AutodiscoverUrl("[email protected]");  foreach (Object obj in usersList) // here i have Mailbox users list in usersList
                 { var userMailbox = new Mailbox(obj.user);
    var folderId = new FolderId(WellKnownFolderName.Inbox, userMailbox);
    SearchFilter.IsEqualTo filter1 = new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false);
    var itemView = new ItemView(50);
    var userItems = service.FindItems(folderId, filter1, itemView);
    foreach (var item in userItems)
    item.Load();
    var senderEmail = ((EmailMessage)item).From;
    var subject = item.Subject;
    var body = item.Body;

    You would need to check that possibilities via WebServices but suggest you to post this in Development forum to get help from programmers....
    http://social.technet.microsoft.com/Forums/office/en-US/home?forum=exchangesvrdevelopment
    Blog |
    Get Your Exchange Powershell Tip of the Day from here

  • How to send a mail to the user when a job gets canceled?

    Hi experts,
                      I need to send a mail when a job gets canceled to the user.I know the FM for sending mail and i can find if a job is canceled from tbtco,but i want to know how to send the mail from the same program ,once it got canceled ?
    thanks in advance,
    helpful answers will be awarded with points
    regards,
    ashwin

    Hi Ashwin
    Use the below peace of code:
    REPORT ZBCJOBMONITOR .
    TABLES: SOMLREC90,
            TBTCO.
    DATA: MAILDATA   LIKE SODOCCHGI1.
    DATA: MAILTXT    LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: MAILREC    LIKE SOMLREC90 OCCURS 0  WITH HEADER LINE.
    DATA: I_TBTCO    LIKE TBTCO OCCURS 0 WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001 .
    SELECT-OPTIONS: S_JOB FOR TBTCO-JOBNAME.
    SELECT-OPTIONS: S_JOBC FOR TBTCO-JOBClass.
    SELECT-OPTIONS: S_REC FOR SOMLREC90-RECEIVER.
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
      CLEAR:    MAILDATA, MAILTXT, MAILREC, I_TBTCO.
      REFRESH:  MAILTXT, MAILREC, I_TBTCO.
      PERFORM GET_ABENDED_JOBS.
      PERFORM BUILD_RECEIVERS.
      LOOP AT I_TBTCO.
        PERFORM BUILD_TEXT_MESSAGE.
        PERFORM SEND_MAIL_NODIALOG..
      ENDLOOP.
         Form  BUILD_TEXT_MESSAGE
    FORM GET_ABENDED_JOBS.
      SELECT * FROM TBTCO
              INTO CORRESPONDING FIELDS OF TABLE I_TBTCO
                         WHERE JOBNAME IN S_JOB
                           AND STATUS = 'A'
                           AND JOBCLASS IN S_JOBC
                           AND SDLSTRTDT = SY-DATUM.
    ENDFORM.
         Form  BUILD_TEXT_MESSAGE
    FORM BUILD_TEXT_MESSAGE.
      DATA: DATE(10) TYPE C.
      DATA: TIME(10) TYPE C.
      MAILDATA-OBJ_NAME = 'MONITOR'.
      MAILDATA-OBJ_DESCR = 'Batch Job Monitor'.
      MAILDATA-OBJ_LANGU = SY-LANGU.
      CONCATENATE 'Job Name:' I_TBTCO-JOBNAME
                  INTO MAILTXT-LINE SEPARATED BY SPACE.
      APPEND MAILTXT.
      PERFORM FORMAT_DATE USING I_TBTCO-SDLSTRTDT
                                DATE.
      CONCATENATE I_TBTCO-SDLSTRTTM+0(2) ':'
                  I_TBTCO-SDLSTRTTM+2(2) ':'
                  I_TBTCO-SDLSTRTTM+4(2)
                     INTO TIME.
      CONCATENATE 'Start Date/Time:' DATE TIME
                INTO MAILTXT-LINE SEPARATED BY SPACE.
      APPEND MAILTXT.
      CONCATENATE 'Job Class:' I_TBTCO-JOBCLASS
                INTO MAILTXT-LINE SEPARATED BY SPACE.
      APPEND MAILTXT.
      MAILTXT-LINE = 'Job has terminated abnormally'.
      APPEND MAILTXT.
    ENDFORM.
         Form  BUILD_RECEIVERS
    FORM BUILD_RECEIVERS.
      LOOP AT S_REC.
        CLEAR MAILREC.
        MAILREC-RECEIVER = S_REC-LOW.
        MAILREC-REC_TYPE  = 'U'.
        APPEND MAILREC.
      ENDLOOP.
    ENDFORM.
         Form  SEND_MAIL_NODIALOG
    FORM SEND_MAIL_NODIALOG.
      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.
    ENDFORM.
         Form FORMAT_DATE
    FORM FORMAT_DATE USING IN
                           OUT.
      CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
           EXPORTING
                DATE_INTERNAL            = IN
           IMPORTING
                DATE_EXTERNAL            = OUT
           EXCEPTIONS
                DATE_INTERNAL_IS_INVALID = 1
                OTHERS                   = 2.
    ENDFORM.
    Regards,
    Sree

  • How to share icalendars, and contacts across users with iphones

    We recently purchased two iphone 5cs for my husband and I to use. We want to share the contacts and ical on our Macbook Air. Currently the Macbook Air is set up as my computer with my id. How do I share the ical and contacts with my husbands phone?

    kimberleyallen wrote:
    Is there any way to share a group of contacts with another user in the same way as you can share calendars?
    With iCal you can choose to share certain calendars so that any changes are updated on everyone's devices that the calendar has been shared with.  I want to replicate that system with a group of contacts.  I know this could be achieved by having contacts assigned to one iCloud account, that account being the one that is used on everyone's devices but that means that all the contacts would be shared.  I have groups of contacts, personal, business etc.   The business group of contacts contains all the relevant contact information for the client but also I use the notes section to record details of conversations etc.  I would like to be able to share that group of contacts with a work colleague so that they could access up to date information on that client and also if either of us added new contacts the group would be updated on all our devices.  However I don't want to share personal contacts which is what would happen if we shared the same iCloud account.
    Any ideas anyone?
    My suggestion would be to open that "second" icloud account. Use it for you and your colleague(s). Then transfer every contact that you want to share onto that account.
    Going to Settings---> Mail, Contacts, Calendars---> Add Account to add the new account, and set the Contacts to ON.
    When you want to add/edit/delete a contact from that account. Just open Contacts---> Select Groups and select that account from the list. You can then add/edit/delete the contacts.
    Going this route will keep your personal contact list separate from the professional list.
    You can use iCloud, google, Yahoo, Outlook.com and others. Personally I'll stick with an IMAP service. As you can also use the Notes in the Notes app. *Separate from the Contacts Note section you mentioned.
    KOT

  • How can i use Mail on 2 macs with the same mail address?

    Hi,
    I have two Macs, connected through WLAN. From each Mac I can use Mail (sending and receiving) with the same mail address. This worked well; on each Mac I have separate files storing the mails (input, sent, trash, …).
    Some days ago I had to change the provider. (Perhaps this may be the reason for my problem?) Now both mail systems are connected - in the way that if I put on Mac *1 a mail into the trash it is automatically thrown into the trash on Mac *2.
    What is to be done to separate the two systems (i. e. make them independent of each other)?
    Hans

    It looks like you are using a IMAP mail account, a protocol used by most email providers nowadays. Read -> http://en.wikipedia.org/wiki/Internet_Message_Access_Protocol
    The main feature of IMAP is the sync of all the changes you do on your mail account. If you want to keep your mails on one Mac, have a look at this site -> http://kb.mit.edu/confluence/pages/viewpage.action?pageId=3908294

  • How to put many documents in one file with words count

    HHow to put many documents in one file with words count

    Pdfs have no concept of words. Combining pdfs cannot be done with Reader. You need either Acrobat on a Mac or PC or perhaps with the PDF Pack service.

  • How do I send mail link this page with iCloud

    I'm having problems sending mail link from safari with iCloud please.
    Please help

    There is an option to "Send Link..." in the File menu. Firefox does not have a built-in send page by email option.

  • Putting old mail in new user account.

    Hello,
    Sorry this may be a really simple question,
    I've had mail running on the administrators account for a couple of years, I'm just creating user accounts for all the different people who use it. I want them all to be able to access the old sent messages and the entire archive of their mailbox.
    How can I put this information into the new user accounts?
    Is it just a case of dragging the relevant files from the Adminstrators library>mail account?
    Thank you so much for any help you can give me
    cheers
    Fred

    I worked with MobileMe support and found that I had to add main account to user account temporarily while I moved files, then deleted account

  • How to put sent mails in different folders

    Hi, I just started experiencing this issue with Mail.app since I subscribed to MobileMe.
    I added more than one email addresses in the mobileme account, made the folders and rules to move the received mails to their proper folders. Receiving is now well managed.
    How can I do the same with the sent mails? The rules don't do exactly what I want.
    When I send a mail with for example [email protected] I would like to go the sent mail in "sent test" under the [email protected] folder, is it possible?
    thanks in advance

    Mulder is right - you can't do this with Mail.
    However, there is no such thing as a unique idea... and there are a few people who can turn them into reality. Try Mail Scripts by Andreas Amann. (http://www.versiontracker.com/dyn/moreinfo/macosx/16217).
    That will let you process rules against sent items.
    Cheers,
    Rodney
    Note: Usual disclaimer when trying a new app: back things up first!

  • How to send e-mail to many user one time

    I would like to send e-mail BCC to hundred people using one e-mail only
    How to I set the code to BCC? I don't want to make a for loop to send the e-mail hundred times.
    I know the following code can set the mail BCC to ohter person
    msg.setRecipient(Message.RecipientType.BCC,email);
    but if I want to BCC to hundred people, how should I revise the code ?

    javax.mail
    Class Message
    public void addRecipient(Message.RecipientType type, Address address)
         throws MessagingException

Maybe you are looking for

  • I'm trying to sync my Ipod on my PC and there are no devices listed in the Itunes sidebar

    I'm trying to sync my IPod 160g classic to my PC and nothing happens. I just updated to the newest version of ITunes so I could follow some help from the internet but I'm not seeing any devices listed in the ITunes sidebar. I admit I'm not that famil

  • ORA-06502: PL/SQL: numeric or value error: NULL index table key value Repor

    W've been experiencing the Oracle Error: ORA-06502: PL/SQL: numeric or value error: NULL index table key value Report' [we are currently on apex v3.0.1]. From the forum there was a reference to a bug fix: apex bug (6416829) fixed in 3.1. When we view

  • Video Files in Forms

    hai all , i am developing a user form to allow users to add pictures . i would like to know if its possible to add video by the end user . if so how

  • Help me post / fireworks Slice tool

    Hi All, I am trialing fireworks as a mac user and I'm having a few issues with the PDF export. After creating multiple pages I wanted to use the slice tool to link them together, This was simple but when I exported the PDF file the main navigation li

  • Unable to install system/header

    Hello, on a NG-zone I try to install package system/header: # pkg install system/header Creating Plan (Running solver): - Traceback (most recent call last): File "/usr/bin/pkg", line 6498, in handle_errors __ret = func(*args, **kwargs) File "/usr/bin