How to send a mail to the approver for leave approval(infotype 2001)

Hi
In my client place, The requirement is that
While an employee is trying to maintaining its Absence i.e 2001 infotype then an email by default has been sent to the concern person who is going to approve that leave. Can I configure the scenario with out ESS MSS. Please guide me.

Hello Santosh,
Easier than that is to use SAP Standard report to trigger those
emails.
The report is RPTARQEMAIL.
You can use the Approver field which will receive an e-mail when requests submitted by his or her employees have to be approved or (for types of leave not requiring approval) have been posted without approval.
Please check it's documentation.
The customizing of the mail format is made on SE61.
This should solve your requirement.
Cheers,
Bentow.

Similar Messages

  • 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.

  • How to Send a Mail From the Oracle Applications.

    Hi,
    I was assigned a task to send a mail from the front end i.e., from oracle applications.
    but i have no idea.
    i am working on oracle apps R12.1.1 and 10g reports.
    First i have to create an rdf file and that rdf file i want to send as an attachment through mail from the apps.
    Any Advice will be of great help and i will follow accordingly.
    Thanks in Advance,
    Regards,
    Bharathi.S

    Hi,
    I was assigned a task to send a mail from the front end i.e., from oracle applications.
    but i have no idea.
    i am working on oracle apps R12.1.1 and 10g reports.
    First i have to create an rdf file and that rdf file i want to send as an attachment through mail from the apps.
    Any Advice will be of great help and i will follow accordingly.
    Thanks in Advance,
    Regards,
    Bharathi.S

  • 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 send a mail about the test plan status

    Hi
    I have finished the development of ecatt automation test cases.
    And I have integrated the ecatt  automation test cases into the test plan of TWB.
    I have scheduled a job in background to run the test plan.
    After the job has finished, I need to send a email to related users to tell them the status of each test cases in the test plan.
    Is there any way to implement it?
    Thanks a lot in advance!

    Hello,
    You can send mail with the status of the test catalog-
    specify a mail system to which Test Workbench test objects send messages to the people responsible
    Please refer the below link for more information:
    http://help.sap.com/saphelp_smehp1/helpdata/en/6a/88370a002911d2bd02080009b4534c/frameset.htm
    Regards,

  • 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 Sap Mails

    How to send SAP Mails to the Customer or vendor when Sales Order or Purchase order rises and How to Use the T-code : NACE by uisng that transaction code how send mails

    Hi,
    Go through this
    In NACE t-code we have the application for each one. based on the application output type can be defined, based on output type script and print progrma can be defined.
    If suppose data can be read from EDI then we should go for condition records.
    So whenever we execute the script first composer checks the output type and then execute the program. in program whenever opn form FM will be populate then script will open first. After that again program till another FM will populate if it then script will populate........like it is cycle proces. Composer does all these things and at last it will submit that output to spool.
    Go to the Transaction NACE.
    choose the related sub module.. like billing or shipping
    doubel click on Output Types
    Choose the Output Type for which whcih you wanted your script to trigger
    Then select the Output Type and double click on Processing Routine
    Then go to create new entries--> Select the Medium (1- print output), then enter your Script and Print Program detls --> Save and come out
    Now go to the Transaction (for which you have created the output type)... Issue output--> Select the output type --> Print....
    You should know the Output type for each document;
    like
    for sales order it is BAoo for Purchase order it is NEU for delivery it is LD00
    for Invoice it is RD00.
    and the application for each document:
    for PO it is EF
    for Sales doc's it is V1
    delivery it is V2
    billing Doc's it is V3.
    Select the Application from NACE and click on output types.
    select the right output type and click on the processing routines on the left hand side.
    it displays the Medium(print,Fax,Mail, edi etc), Output type, Program and the Script form or Smart form.
    Regards
    Ravi

  • Send a mail to the vendor at the time of approval with the attachment of PO

    Hi all,
    I want to send a mail to the vendor at the time of approval by attaching the pdf of that particular PO.
    How can I achieve this?
    I know the User Exit where the code should be written.
    But I want the solution for attaching the PDF of PO at the time of approval.
    Please help me in this regard.
    Edited by: vinil kumar aturi on Mar 16, 2009 7:52 AM

    Hi,
    Try Following Code to Send mail as PDF Attachment
    In this
    Smart form Name : ZSMART_MM_003
    This will send mail to EMAIL ADDRESS SPECIFIED IN VENDOR MASTER FK03
    This code is written for ME23n so we used nast-objky(10) for purchase order no you may replace it with your purchase order no
    and smart form name with your smart form name
    *-- Send Mail---
    *-- Function Module Call to get Customer Address (Email)--
    DATA: VENDOR TYPE ELIFN,
          ADDRNO TYPE ADRNR.
    DATA: atab-mail TYPE STRING.
    SELECT SINGLE LIFNR FROM EKKO INTO VENDOR WHERE EBELN = nast-objky(10).
    SELECT SINGLE ADRNR FROM LFA1 INTO ADDRNO WHERE LIFNR = VENDOR.
    TYPE-POOLS: szadr.
    DATA adr_kompl TYPE szadr_addr1_complete.
    DATA adr1 TYPE szadr_addr1_line.
    DATA adtel TYPE szadr_adtel_line.
    DATA admail TYPE szadr_adsmtp_line.
    DATA adfax TYPE szadr_adfax_line.
    CALL FUNCTION 'ADDR_GET_COMPLETE'
           EXPORTING
                addrnumber              = ADDRNO
           IMPORTING
                addr1_complete          = adr_kompl
           EXCEPTIONS
                parameter_error         = 1
                address_not_exist       = 2
                internal_error          = 3
                wrong_access_to_archive = 4
                OTHERS                  = 5.
    Mail
      LOOP AT adr_kompl-adsmtp_tab INTO admail.
        MOVE admail-adsmtp-smtp_addr TO atab-mail.
      ENDLOOP.
    if sy-subrc = 0.
      DATA: FILENAME TYPE STRING.
      CONCATENATE 'PurchaseOrder' nast-objky INTO FILENAME SEPARATED BY '-'.
      DATA: MESSAGELINE1 TYPE STRING,
            MESSAGELINE2 TYPE STRING.
    CONCATENATE 'Do you want to send ' FILENAME ' through E-mail to' into MESSAGELINE1.
    CONCATENATE atab-mail '?' into MESSAGELINE2.
      data: answer    TYPE c.
      CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
           EXPORTING
                defaultoption = 'N'
                textline1     = MESSAGELINE1
                textline2     = MESSAGELINE2
                titel         = ' '
                start_column  = 35
                start_row     = 10
           IMPORTING
                answer        = answer.
      IF answer EQ 'J' OR answer EQ 'Y'.
    Code to find Contact person
        DATA: CONTACT TYPE EVERK.
        SELECT SINGLE VERKF FROM EKKO INTO CONTACT WHERE EBELN = nast-objky(10).
    Internal Table declarations
        DATA: I_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
              I_TLINE TYPE TABLE OF TLINE WITH HEADER LINE,
              I_RECEIVERS TYPE TABLE OF SOMLRECI1 WITH HEADER LINE,
              I_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    Objects to send mail.
              I_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
              I_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
              I_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
              I_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
    Work Area declarations
              WA_OBJHEAD TYPE SOLI_TAB,
              W_CTRLOP TYPE SSFCTRLOP,
              W_COMPOP TYPE SSFCOMPOP,
              W_RETURN TYPE SSFCRESCL,
              WA_DOC_CHNG TYPE SODOCCHGI1,
              W_DATA TYPE SODOCCHGI1,
              WA_BUFFER TYPE STRING, "To convert from 132 to 255
    Variables declarations
              V_FORM_NAME TYPE RS38L_FNAM,
              V_LEN_IN LIKE SOOD-OBJLEN,
              V_LEN_OUT LIKE SOOD-OBJLEN,
              V_LEN_OUTN TYPE I,
              V_LINES_TXT TYPE I,
              V_LINES_BIN TYPE I.
              DATA :  s_control_parameters TYPE ssfctrlop,
                      s_output_options     TYPE ssfcompop.
                      s_control_parameters-getotf = 'X'.
                      s_control_parameters-no_dialog = 'X'.
                      s_control_parameters-preview   = 'X'.
                      s_output_options-tdnoprint = 'X'.
                      s_output_options-tdimmed   = ''.
                      s_output_options-tddest = 'LP01'.        "Spool: Output device
                      s_output_options-tdreceiver = sy-uname.
                      s_output_options-tdcover = ''.
             CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
             EXPORTING
                FORMNAME = 'ZSMART_MM_003'
             IMPORTING
               FM_NAME = V_FORM_NAME
             EXCEPTIONS
               NO_FORM = 1
               NO_FUNCTION_MODULE = 2
               OTHERS = 3.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
             W_CTRLOP-GETOTF = 'X'.
             W_CTRLOP-NO_DIALOG = 'X'.
             W_COMPOP-TDNOPREV = 'X'.
             CALL FUNCTION V_FORM_NAME
             EXPORTING
                CONTROL_PARAMETERS = s_control_parameters
                OUTPUT_OPTIONS = s_output_options
                USER_SETTINGS = ''
                nast          = nast
                WA_ADDRESS    = WA_ADDRESS
             IMPORTING
                JOB_OUTPUT_INFO = W_RETURN
             TABLES
                addtel  = it_addtel
                addsmtp = it_addsmtp
             EXCEPTIONS
                FORMATTING_ERROR = 1
                INTERNAL_ERROR = 2
                SEND_ERROR = 3
                USER_CANCELED = 4
                OTHERS = 5.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Convert SMartform to pdf
          I_OTF[] = W_RETURN-OTFDATA[].
          CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            FORMAT = 'PDF'
            MAX_LINEWIDTH = 132
          IMPORTING
            BIN_FILESIZE = V_LEN_IN
          TABLES
            OTF = I_OTF
            LINES = I_TLINE
          EXCEPTIONS
           ERR_MAX_LINEWIDTH = 1
           ERR_FORMAT = 2
           ERR_CONV_NOT_POSSIBLE = 3
           OTHERS = 4.
    IF SY-SUBRC <> 0.
    ENDIF.
          LOOP AT I_TLINE.
            TRANSLATE I_TLINE USING '~'.
            CONCATENATE WA_BUFFER I_TLINE INTO WA_BUFFER.
            ENDLOOP.
            TRANSLATE WA_BUFFER USING '~'.
            DO.
              I_RECORD = WA_BUFFER.
              APPEND I_RECORD.
              SHIFT WA_BUFFER LEFT BY 255 PLACES.
              IF WA_BUFFER IS INITIAL.
                EXIT.
                ENDIF.
                ENDDO.
    Attachment
                REFRESH: I_RECLIST,
                I_OBJTXT,
                I_OBJBIN,
                I_OBJPACK.
                CLEAR WA_OBJHEAD.
                I_OBJBIN[] = I_RECORD[].
    Create Message Body Title and Description
                I_OBJTXT = 'Sir, '.
                APPEND I_OBJTXT.
                I_OBJTXT = ''.
                APPEND I_OBJTXT.
                I_OBJTXT = 'Please Find Attached '.
                APPEND I_OBJTXT.
                I_OBJTXT = FILENAME.
                APPEND I_OBJTXT.
                I_OBJTXT = 'For your reference'.
                APPEND I_OBJTXT.
                I_OBJTXT = ''.
                APPEND I_OBJTXT.
                I_OBJTXT = 'Regards'.
                APPEND I_OBJTXT.
                I_OBJTXT = CONTACT.
                APPEND I_OBJTXT.
    *Mail Subject
                DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
                READ TABLE I_OBJTXT INDEX V_LINES_TXT.
                WA_DOC_CHNG-OBJ_NAME = 'Purchase Order'.
                WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
                WA_DOC_CHNG-OBJ_DESCR = 'Purchase Order'.
                WA_DOC_CHNG-SENSITIVTY = 'F'.
                WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
    Main Text
                CLEAR I_OBJPACK-TRANSF_BIN.
                I_OBJPACK-HEAD_START = 1.
                I_OBJPACK-HEAD_NUM = 0.
                I_OBJPACK-BODY_START = 1.
                I_OBJPACK-BODY_NUM = V_LINES_TXT.
                I_OBJPACK-DOC_TYPE = 'RAW'.
                APPEND I_OBJPACK.
    Attachment (pdf-Attachment)
                I_OBJPACK-TRANSF_BIN = 'X'.
                I_OBJPACK-HEAD_START = 1.
                I_OBJPACK-HEAD_NUM = 0.
                I_OBJPACK-BODY_START = 1.
                DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.
                READ TABLE I_OBJBIN INDEX V_LINES_BIN.
                I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
                I_OBJPACK-BODY_NUM = V_LINES_BIN.
                I_OBJPACK-DOC_TYPE = 'PDF'.
                I_OBJPACK-OBJ_NAME = 'smart'.
                I_OBJPACK-OBJ_DESCR = FILENAME.
                APPEND I_OBJPACK.
                CLEAR I_RECLIST.
                I_RECLIST-RECEIVER = atab-mail.
                I_RECLIST-REC_TYPE = 'U'.
                APPEND I_RECLIST.
                CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
                EXPORTING
                  DOCUMENT_DATA = WA_DOC_CHNG
                  PUT_IN_OUTBOX = 'X'
                  COMMIT_WORK = 'X'
                TABLES
                    PACKING_LIST = I_OBJPACK
                    OBJECT_HEADER = WA_OBJHEAD
                    CONTENTS_BIN = I_OBJBIN
                    CONTENTS_TXT = I_OBJTXT
                    RECEIVERS = I_RECLIST
                EXCEPTIONS
                    TOO_MANY_RECEIVERS = 1
                    DOCUMENT_NOT_SENT = 2
                    DOCUMENT_TYPE_NOT_EXIST = 3
                    OPERATION_NO_AUTHORIZATION = 4
                    PARAMETER_ERROR = 5
                    X_ERROR = 6
                    ENQUEUE_ERROR = 7
                    OTHERS = 8.
    IF SY-SUBRC <> 0.
    WRITE:/ 'Error When Sending the File', SY-SUBRC.
    ELSE.
    WRITE:/ 'Mail sent'.
    ENDIF.
    Regards
    Nausal

  • How to send a mail in workflow keeping 1 receiver in CC and the other in TO

    Hi,
    Can anybody tell me how to send a mail in workflow keeping 1 receiver in CC and the other in TO.
    I need to send a mail to an employee keeping his/her manager in CC through workflow.
    Regards,
    Lavanya

    Hi Lavanya,
    I dont think its possible using Send mail step type.
    But it can be done by using the FM SO_NEW_DOCUMENT_SEND_API1. Just create a method and Call this FM accordingly.
    Thanks,
    Viji.

  • How to create  a procedure to send a mail if the Database is down?

    Hi,
    I have created the below procedure to send a mail if the count is less than 1300. It scheduled daily @ 15 30 hrs. Its fine.
    CREATE OR REPLACE procedure SCOTT.hrsmail
    is
    v_count number;
    begin
    Select count(*) into v_count from emp;
    if v_count < 1300
    then
    UTL_MAIL.send(sender => '[email protected]',
    recipients => '[email protected]',
    cc => '[email protected]',
    bcc => '[email protected]',
    subject => 'Testing the UTL_MAIL Package',
    message => 'If you get this, UTL_MAIL package
    else
    null; --what you want to do here
    end if ;
    end;
    Sometime the Database is down, so the job is not running.
    How to create a procedure to send a mail if the database is down?
    Pls help me. Its highly appreciated.
    Thanks
    Nihar

    nihar wrote:
    How to create a procedure to send a mail if the database is down?And what if the database is up, but the network down? Or the database up and mail server down? Or mail server undergoing maintenance?
    There are loads of "+What if's+" - and in that respect, playing "+What if database is down..+" in this case does not make any sense. You do not use the database to monitor its own up/down status. You do not rely just on SMTP as notification protocol that the database is down.
    The correct approach would be using something like SNMP as the monitoring protocol. A monitoring system that can process SNMP and perform some basic root cause analysis (e.g. network to the database server down, database server status unknown). And this system supporting notification methods like SMTP, SMS and so on.

  • How to send a mail by ckicking the button using java

    hi,
    how to send a mail by clicking the button (like payroll silp in that contain one button if we click that it autometically go through the mail as a attachment) pls frd to me my gmail is [email protected]

    Hi,
    It seems we are doing the homework for you; to make you start with something; look at the sample code below and try to understand it first then put the right values
    to send an email with an attachement.
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.util.Date;
    import java.util.Properties;
    import javax.activation.DataHandler;
    import javax.activation.FileDataSource;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Multipart;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    import javax.swing.AbstractAction;
    import javax.swing.Action;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JTextField;
    public class Main {
          * @param args
         public static void main(String[] args) {
              // Create the frame
              String title = "Frame Title";
              JFrame frame = new JFrame(title);
              // Create a component to add to the frame
              JComponent comp = new JTextField();
              Action action = new AbstractAction("Button Label") {
                   // This method is called when the button is pressed
                   public void actionPerformed(ActionEvent evt) {
                        System.out.println("sending email with attachment");
                        sendEmail();
              // Create the button
              JButton button = new JButton(action);
              // Add the component to the frame's content pane;
              // by default, the content pane has a border layout
              frame.getContentPane().add(comp, BorderLayout.SOUTH);
              frame.getContentPane().add(button, BorderLayout.NORTH);
              // Show the frame
              int width = 300;
              int height = 300;
              frame.setSize(width, height);
              frame.setVisible(true);
         protected static void sendEmail() {
              String from = "me@localhost";
              String to = "me@localhost";
              String subject = "Important Message";
              String bodyText = "This is a important message with attachment";
              String filename = "c:\\tmp\\message.pdf";
              Properties properties = new Properties();
              properties.put("mail.stmp.host", "localhost");
              properties.put("mail.smtp.port", "25");
              Session session = Session.getDefaultInstance(properties, null);
              try {
                   MimeMessage message = new MimeMessage(session);
                   message.setFrom(new InternetAddress(from));
                   message.setRecipient(Message.RecipientType.TO, new InternetAddress(
                             to));
                   message.setSubject(subject);
                   message.setSentDate(new Date());
                   // Set the email message text.
                   MimeBodyPart messagePart = new MimeBodyPart();
                   messagePart.setText(bodyText);
                   // Set the email attachment file
                   MimeBodyPart attachmentPart = new MimeBodyPart();
                   FileDataSource fileDataSource = new FileDataSource(filename) {
                        @Override
                        public String getContentType() {
                             return "application/octet-stream";
                   attachmentPart.setDataHandler(new DataHandler(fileDataSource));
                   attachmentPart.setFileName(filename);
                   Multipart multipart = new MimeMultipart();
                   multipart.addBodyPart(messagePart);
                   multipart.addBodyPart(attachmentPart);
                   message.setContent(multipart);
                   Transport.send(message);
              } catch (MessagingException e) {
                   e.printStackTrace();
    }The sample above is not ideal so you need to go through it and start to ask me some questions if you have
    Let me know if you miss something
    Regards,
    Alan Mehio
    London,UK

  • How i can send a mail to the user SAP Office mailbox through the spool.

    hi all,
    I have created an report and scheduled for background and it generated a spool now how i can send a mail to the user SAP Office mailbox through that spool.
                          please provide me the sample code if possible.
                   thanks.

    Read the spool number with this...
        SELECT RQIDENT
        INTO (T_TSP01-RQIDENT)
        FROM TSP01
        WHERE RQOWNER EQ SY-UNAME
          AND RQCLIENT EQ SY-MANDT.
        APPEND T_TSP01.
        ENDSELECT.
    Use this FM RSPO_IRETURN_RAW_DATA to read the content of the spool into an Internal Table...
    Finally use this FM SO_OBJECT_SEND to send the mail to an SAP Office user...
    Greetings,
    Blag.

  • How to sending simple text in the mail body

    Hi friends,
                 How to send simple text in the mail body through ABAP code
       plz send me the related code and setting for that mail.
      Thanks&Regards,
      Srinivas

    try this...
    FORM send_file_as_email_attachment .
      DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
      DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
      DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
      DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA : i_body TYPE soli_tab WITH HEADER LINE.
    DATA: it_attach LIKE it_display1 OCCURS 0 WITH HEADER LINE.
      DATA: doc_chng LIKE sodocchgi1.
      DATA: tab_lines LIKE sy-tabix.
      DATA: att_lines TYPE i.
    DATA: lv_lines TYPE i.
      DATA: file TYPE string.
      data: g_datum like sy-datum.
      data: g_datum1(10) type c.
      DATA: len TYPE n.
      LOOP AT it_email.
        CLEAR : objpack,
                objhead,
                objbin,
                objtxt,
                reclist.
        REFRESH: objpack,
                 objhead,
                 objbin,
                 objtxt,
                 reclist.
        g_datum =     sy-datum - 1.
        concatenate g_datum6(2) '.' g_datum4(2) '.' g_datum+0(4) into
        g_datum1.
    doc_chng-obj_descr = 'Aged Stock more than 45 Days'.
        CONCATENATE 'Aged Stock more than 45 Days' '-' it_email-vkbur INTO
        doc_chng-obj_descr.
        CONCATENATE 'Please find enclosed Aged Stock Details ( >45days ) report as on'
        g_datum1
        INTO objtxt-line SEPARATED BY space.
        APPEND objtxt.
        objtxt-line = ' '.
        APPEND objtxt.
        objtxt-line = 'Regards'.
        APPEND objtxt.
        objtxt-line = 'LIS SAP Projects'.
        APPEND objtxt.
        objtxt-line =
        'PS: Pls send feedback for futher improvements to SAP office.'.
        APPEND objtxt.
        DESCRIBE TABLE objtxt LINES tab_lines.
        READ TABLE objtxt INDEX tab_lines.
        doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
       CLEAR objpack-transf_bin.
        objpack-head_start = 1.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'TXT'.
       objpack-obj_name = 'Run_prog'.
       objpack-obj_descr = 'Agestock.txt'.
       lv_lines = tab_lines.
        APPEND objpack.
    *CONCATENATE 'Plant'   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           it_display SEPARATED BY space.
           append objbin.
           clear: objbin.
        CLEAR:it_display2.
        REFRESH it_display2.
        it_display2-werks = 'Plant|'.
        it_display2-matnr = 'Material Number'.
        it_display2-qty = '|Qty > 45 days'.
        it_display2-amount = '      |Amount'.
        APPEND it_display2.
        it_display2-werks = ''.
        it_display2-matnr = ''.
        it_display2-qty = ''.
        it_display2-amount = ''.
        APPEND it_display2.
        CLEAR : it_display2.
        sort it_display1 by amount descending.
        LOOP AT it_display1 WHERE werks = it_email-vkbur.
         AT FIRST.
    *CONCATENATE 'Plant    '   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           objbin-line SEPARATED BY space.
           append objbin.
           clear: objbin.
         ENDAT.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              input  = it_display1-matnr
            IMPORTING
              output = it_display1-matnr.
          it_display1-qty = TRUNC( it_display1-qty ).
          MOVE-CORRESPONDING it_display1 TO it_display2.
          APPEND it_display2.
          CLEAR:it_display1,it_display2,objbin.
          CLEAR:it_display1.
        ENDLOOP.
        objbin[] = it_display2[].
        DESCRIBE TABLE objbin LINES tab_lines.
        objhead = 'Suug'.
        APPEND objhead.
        objpack-transf_bin = 'X'.
        objpack-head_start = 3.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'RAW'.
        objpack-obj_name = 'Run_prog'.
        objpack-obj_descr = 'Agestock.txt'.
        APPEND objpack.
        reclist-receiver = '[email protected]'.
        reclist-rec_type = 'U'.
        APPEND reclist.
    =====================================================================
        CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
          EXPORTING
            document_data              = doc_chng
            commit_work                = 'X'
          TABLES
            packing_list               = objpack
            object_header              = objhead
            contents_bin               = objbin
            contents_txt               = objtxt
            receivers                  = reclist
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            operation_no_authorization = 4
            OTHERS                     = 99.
        CLEAR : it_email.
      ENDLOOP.
    ENDFORM.                    "send_mail
    Message was edited by:
            Sugumar Ganesan

  • Hi my name is Al-Ameen, Am from Nigeria,actually my brother from the united kingdom sent me an iphone5, So when i insert my Sim card i discovered the iPhone is locked. So the reason why am sending this mail is to ask for the procedure of how to unlock an

    Hi
    my name is Al-Ameen, Am from Nigeria,actually my brother from the united kingdom sent me an iphone5, So when i insert my Sim card i discovered the iPhone is locked.
    So the reason why am sending this mail is to ask for the procedure of how to unlock an iPhone from another country the amount paid and all the other information about unlocking an iPhone.
    Hope to hear back from you guys.
    Many Thanks
    Al-Ameen.

    You need to contact the carrier to see if they offer unlocking and if you qualify. You may need to talk to your brother about this.

  • How to send a mail in pdf format file in sbwp??

    how to send a mail in pdf format file in sbwp?? and how to read the content of the mail?

    Refer the following link for Sample Program:
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm

Maybe you are looking for

  • Problem with sqlquery

    hi, i have a requirement where i have to find a (status='C' >2) can anyone correct select CR.REPAIR_NUMBER,CR.INCIDENT_ID,CS.INCIDENT_ID,CS.INCIDENT_NUMBER,CR.STATUS FROM CSD_REPAIRS CR, CS_INCIDENTS_ALL_B CS WHERE CR.INCIDENT_ID = CS.INCIDENT_ID AND

  • Apple TV Color Messed Up

    The past few days, something really strange has been going on with the colors on our Apple TV.  I've tried updating the software, resetting it, unplugging cords etc. Photo attached. Any ideas?

  • Weird! I thought crimson.jar/jaxp.jar were included in rt.jar for jsk 1.4!!

    I am trying a Wrox Books Example (Chapter 2 in Professional Java XML), and if I do this:   java BookMain I get this error:   Exception in thread "main" java.lang.NullPointerException     at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java

  • Satellite M45 - Will not boot after restore to new HDD

    I installed a new PATA 250GB HDD into my pc. Configured BIOS to boot from CD/DVD. In started Toshiba recovery disk from cold boot, followed instruction to load a new system on the HDD. It performed a (quick) format on the HDD, spent 50 mins copying f

  • One not needs password to sync outlook

    I am getting sync issues with Onenote 2010 on PC, while syncing, it gives error message "OneNote needs a password to sync some of your notebooks. I am running windows 8. Can any one help me resolve this issue ?