Trigger mail to dynamic Agents

Hi Experts,
My requirement is to trigger a email to user based on document type.
Lets say my doc. type is     DOC1 then Approver will be USER1
                                            DOC2 then  Approver will be USER2.
and mail should be triggered to this agents dynamically based on document type.
I have created one z table and maintained this entries.
created one Rule .
If I pass my document type to rule, it fetches USER correctly.
Now how to use this Rule in work flow to trigger mail to fetched User ??
Please give me a step by step guide to do it.

Hi Sunil,
Probably you need to go through some basic material related to Business object and workflow.
Go through the below link.
http://help.sap.com/erp2005_ehp_04/helpdata/EN/c5/e4ac12453d11d189430000e829fbbd/frameset.htm
http://wiki.sdn.sap.com/wiki/display/ABAP/SAPBusinessWorkflow
Regards
Kedar

Similar Messages

  • How to use RCIEV feature to trigger mail to a particular mail id in M0001

    Hi,
    I'm trying to trigger mail for any marital status change in personal data infotype for employee through dynamic action. Kindly help me in using RCIEV feature in M001 feature in detail for triggering mail to a manager other than administrator.
    Thanks,
    Kalai.

    Check this documentation.
    RCIEV  Defining a Distribution List or Mail Address
       you can define a feature that sets the parameters for a
        mail to be sent when changes are made to an infotype record. In the
        standard system, this involves feature M0001. You can also specify a
        feature within this feature to determine possible recipients of the mail
        according to the control values in the organizational assignment.
      Use
        Mail connection for master data infotype changes for employees and
        applicants.
      Procedure
        The return matrix of the feature has the following structure: X-VVVVVVVV
        with the following meanings:
        o   X - Indicator 'M' for mail or 'V' for distribution lists
        o   VVVVVVVV - Valid mailing name or distribution list, which is stored
                       in a shared folder in SAPoffice (transaction so04).
      See also
        Feature TEXT1

  • Send mail through dynamic action, but the subject line and content is blank

    Hi all,
    I'm facing one problem on sending mail throught dynamic action.
    Whenever a new employee is hired, the system will trigger a mail to the administrator.
    The mail can successfully reach the email address. But the title and the content of the mail are missing. I can receive an email with a PDF attchment. But when I open this PDF file, it's blank inside.
    In t-code "SO10", I created a new mail text with name of Z_MAIL, for my mail, insteading of using the SAP standard one.
    When I using the SAP standard mail text, it works and I can see the content. But even I copy and paste the exact the content of the standard one to my own new mail text, it will not work.
    And I have to use my own customized mail text. So, is there any one knows about this issue? Any more setting I should do? Or is there some tricks?

    Hi,
       I feel that something will be misiing in the coding.Even i faced the same problem earlier.for me it was text file as an attachment ,file was receiving but no data...the problem was i forget to add one option in objpack-head.
       R u using the FM - SO_NEW_DOCUMENT_ATT_SEND_API1??
    If so pls C the below codes for text file as an attachment.
    DATA: objpack LIKE sopcklsti1 OCCURS  2 WITH HEADER LINE.
      DATA: objhead LIKE solisti1   OCCURS  1 WITH HEADER LINE.
      DATA: objbin  LIKE solisti1   OCCURS 10 WITH HEADER LINE.
      DATA: objtxt  LIKE solisti1   OCCURS 10 WITH HEADER LINE.
      DATA: reclist LIKE somlreci1  OCCURS  5 WITH HEADER LINE.
      DATA: doc_chng LIKE sodocchgi1.
      DATA: tab_lines LIKE sy-tabix.
    Creating the document to be sent
      doc_chng-obj_name = 'MESSAGE'.
      doc_chng-obj_descr = 'ZHRI_GARN_EPC_COMM'.
      objtxt = 'Program ZHRI_GARN_EPC_COMM has been executed successfully'.
      APPEND objtxt.
      objtxt = 'Error records passed to BDC session XPHRGARN01'.
      APPEND objtxt.
      DESCRIBE TABLE objtxt LINES tab_lines.
      READ TABLE objtxt INDEX tab_lines.
      doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    Creating the entry for the compressed document
      CLEAR objpack-transf_bin.
      objpack-head_start = 1.
      objpack-head_num   = 0.
      objpack-body_start = 1.
      objpack-body_num   = tab_lines.
      objpack-doc_type   = 'RAW'.
      APPEND objpack.
    Entering names in the distribution list
      LOOP AT se_tech.
        reclist-receiver = se_tech-low.
        reclist-rec_type = 'U'.
        APPEND reclist.
      ENDLOOP.
    Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = doc_chng
          put_in_outbox              = 'X'
          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.
    Hope this will help u.
    Regards,
    Manoj.

  • How to send workitem to dynamic agents

    Hi all,
    This is my problem, I have to send workitem to dynamic agents (number of agents vary).
    I have the approver details in the workflow container, now i have to send the workitem to the apporvers, since the number of approver varies i am using while loop and i am doing container opreration for each loop. I have the apporvers details in a multiline container based upon this i have to send workitem to the first approver and after his decision i have send workitem to second approver and it goes on.
    Regards
    Balaji E.

    Hi all,
    After struggling for 2 day i found the solution for my problem.
    My Problem:
    I get the approver details from a function module and i call this function module in a method and through a task i pass the multiline container element (which is holding approvers details) to my workflow container. My problem is i dont know how to loop this multiline container element in my loop (while).
    Solution:
    There is a macro to copy one container element to another container element it may a multiline container too.
    SWC_COPY_ELEMENT <SourceContainer> <SourceElement> <TargetContainer> <TargetElement>.
    i used this macro while i run the method at first time and i copy this value to another container (multiline) element at this step itself.
    In my next step i pass only the loop number (i have a workflow container element. and i increment this container element for each loop) to the method and in that method i read the multiline container element based on this loop number and i pass the result value to task-->workflow.
    From here i proceed further.
    Thanks all of you.
    SDN Forum helped me a lot in this issue.
    Regards,
    Balaji E.

  • Send a mail to the agents

    hi
    my question is send the mail to the assigned agents after the task is go through a condition, and condition fails it also have send mail and true it has send mail to the agents. I have designed the workflow and all other parts are working fine when my condition reject, it never works

    Assigned agents of what step? There are no assigned agents in a condition step.

  • Java mail with Dynamic attachment?

    Hi :-)
    How to send the mails with dynamically created attachements..
    The attachments may be a Excel file created dynamically according to the user inputs on the webpage. Is there any way to send those attachments to the receipients with out storing those attachements anywhere(server)?
    Give me some tips to take my next step...
    Thanx in advance
    Krishnakumar S
    (+919847706611)

    You should take a look at Sun's JavaMail site. It has quite a bit of info on JavaMail, located here: http://java.sun.com/products/javamail/.
    See the FAQ here: http://java.sun.com/products/javamail/FAQ.html, it has questions dealing with attachments.
    There is a tutorial here that covers sending and receiving attachments: http://java.sun.com/developer/onlineTraining/JavaMail/index.html. Specific section on attachments is located here: http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#JavaMailAttachments

  • Dynamic agent rule during approval

    Hi gurus,
    my question is based on a customer requirement.
    they want a n-step approval with dynamic agent determination: fine.
    then they want to maintain the substitutes: fine as well.
    But what they want to do is to change the workflow path based on the substitute.
    I mean: if the first aprover has set a substitute the first task goes to the substitute, but the following tasks have to follow the substitute hierarchy and not the original workflow path.
    So we don't think the standard system way to use the substitute is not enough, but we need to determinate in the beginning if a substitute was set for some approvers.
    The thing is that the substitute record is dynamic and has a validity end, and could be set after the workflow is started.
    Is it possible at every step recalculate the workflow path and the next approvers (so to discover if a substitute rule has be changed or created or deleted)?
    PS: we are using SRM 7.0 and the process controlled workflow.
    Thank you very much in advance!
    Regards,
    Maria

    Hi,
    Yes. Agent is determined in each step right after previous step is completed in SRM70 Process-Controlled Workflow.
    Please check following workflow objects.
    WS40000016
    TS40007943
    Rule 40000138
    FM /SAPSRM/WF_CORE_RESP_RESOLVER
    Regards,
    Masa

  • Dynamic agent rule changement during approval steps

    Hi gurus,
    my question is based on a customer requirement.
    they want a n-step approval with dynamic agent determination: fine.
    then they want to maintain the substitutes: fine as well.
    But what they want to do is to change the workflow path based on the substitute.
    I mean: if the first aprover has set a substitute the first task goes to the substitute, but the following tasks have to follow the substitute hierarchy and not the original workflow path.
    So we don't think the standard system way to use the substitute is not enough, but we need to determinate in the beginning if a substitute was set for some approvers.
    The thing is that the substitute record is dynamic and has a validity end, and could be set after the workflow is started.
    Is it possible at every step recalculate the workflow path and the next approvers (so to discover if a substitute rule has be changed or created or deleted)?
    PS: we are using SRM 7.0 and the process controlled workflow.
    Thank you very much in advance!
    Regards,
    Maria

    Hi Maria
    I mean today the workflow starts and the system calculates the path based on the substitute rules active.
    OK with that.
    But what if the substitute rule change tomorrow?
        How you are saying the substitute rule change tomorrow?.  You should not assume it. You should confirm it.  You cannot implement a work flow for tomorrow's requirement. Always there will be a change even if you implement for tomorrows change. Never do that. Do only for today's requirement.  
    My question is if it's possible to every step of the work flow change the agents.
        I feel that this approach is wrong. simple view i will give u to thing. take only 2 steps
    loop.
    1) for determining the approver based on business logic in one method.
    2) use the expression in the user decision step and send the work item for approval
    endloop.
    This i have explained for simple logic, create you own logic and apply on loop and endloop. It will work.
    Regards
    vijay

  • Added custom date fields at contract;need to trigger mail using those dates

    Hi,
    II have added 14 custom fields in the service order quotation for handling waranty start date and end dates capturing for the maximum of 7 years contract.
    Then its usual yearly action of the waranty team to put the dates in those fields.
    The first set of 2 input fields will be filled at the quotation creation itself; rest the set of 12 fields will be updated in this 7 years time.
    My requirement is such that to the capture all the waranty end dates filled in the input fields and trigger a mail 30 days prior to that days.
    Example : I have contract from 01/08/2004 to 31/07/2010.
    Then my waranty startdate / end date can be filled by waranty team as 01/08/2004 to 31/07/2005 in the waranty first year.the i need to trigger a mail to waranty team on 01/07/2005.
    For the second year if we have dates filled as 01/08/2005 to 31/07/2006; then to trigger mail on 01/07/2006.
    I have tried using ACTIONS but couldn't get much help.
    As a work around thinking for a report to fetch the contract for that Trans.type and check the dates with the present date + 30 and collect those to perfrom the respective actions.This is workaround.
    Tried using the DATE TYPES creating 7 different DATE TYPES and assigning the ( end dates - 30 ) to that manually upon save.
    and using this DATE TYPE along with the action definition can we acheive ?  but it too will be work around.
    How to acheive this one. It became critical now in the project. 
    Thanks and Regards,
    Satish Akkina

    Hi,
    In your scenario, you don't need synchronous email facility.
    Probably you can create a z table and maintain all required dates in this table (before saving your transaction somewhere you would have to read your custom fields and save them in this table along with object ID/GUID). Then create a report that would read dates from z table and then send emails to your warranty team. Schedule this report in background with frequency of once day.
    Hope that helps.
    Regards,
    BJ

  • Trigger mail

    Hello experts,
    i want to trigger mail with the output of the report, means as the report gets executed i want to trigger mail with the displayed output....
    sample code highly appreciated...............

    Hello,
    Check this sample report.This report will be very useful for your requirement
    REPORT ZV_JOB_READ NO STANDARD PAGE HEADING LINE-SIZE 255..
    TABLES: TSP01.
    DATA: SV_ADR TYPE SOMLRECI1-RECEIVER.
    SELECT-OPTIONS : P_EMAIL1 FOR SV_ADR NO INTERVALS.
    *DEFAULT '[email protected]',
    PARAMETERS: P_SENDER LIKE SOMLRECI1-RECEIVER,
    *DEFAULT '[email protected]',
                P_REPID LIKE SY-REPID, " Report to execute
                P_LINSZ LIKE SY-LINSZ DEFAULT 132, " Line size
                P_PAART LIKE SY-PAART DEFAULT 'X_65_132', " Paper Format
                P_SLSET LIKE SY-SLSET, "Variant name
                P_ODESCR LIKE SODOCCHGI1-OBJ_DESCR,
                P_ADESCR TYPE SO_OBJ_NAM,
                P_DELSPL AS CHECKBOX.
    *DATA DECLARATION
    DATA: GD_RECSIZE TYPE I.
    * Spool IDs
    TYPES: BEGIN OF T_TBTCP.
            INCLUDE STRUCTURE TBTCP.
    TYPES: END OF T_TBTCP.
    DATA: IT_TBTCP TYPE STANDARD TABLE OF T_TBTCP INITIAL SIZE 0,
          WA_TBTCP TYPE T_TBTCP.
    * Job Runtime Parameters
    DATA: GD_EVENTID LIKE TBTCM-EVENTID,
          GD_EVENTPARM LIKE TBTCM-EVENTPARM,
          GD_EXTERNAL_PROGRAM_ACTIVE LIKE TBTCM-XPGACTIVE,
          GD_JOBCOUNT LIKE TBTCM-JOBCOUNT,
          GD_JOBNAME LIKE TBTCM-JOBNAME,
          GD_STEPCOUNT LIKE TBTCM-STEPCOUNT,
          GD_ERROR TYPE SY-SUBRC,
          GD_RECIEVER TYPE SY-SUBRC.
    DATA: W_RECSIZE TYPE I,
          MC_VALID(1) TYPE C.
    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,
          MI_RQIDENT LIKE TSP01-RQIDENT.
    * Spool to PDF conversions
    DATA: GD_SPOOL_NR LIKE TSP01-RQIDENT,
          W_SPOOL_NR LIKE TSP01-RQIDENT,
          GD_DESTINATION LIKE RLGRAP-FILENAME,
          GD_BYTECOUNT LIKE TST01-DSIZE,
          GD_BUFFER TYPE STRING.
    DATA: MSTR_PRINT_PARMS LIKE PRI_PARAMS.
    * Binary store for PDF
    DATA: BEGIN OF IT_PDF_OUTPUT OCCURS 0.
            INCLUDE STRUCTURE TLINE.
    DATA: END OF IT_PDF_OUTPUT.
    CONSTANTS: C_DEV LIKE SY-SYSID VALUE 'DEV',
               C_NO(1) TYPE C VALUE ' ',
               C_DEVICE(4) TYPE C VALUE 'LOCL'.
    START-OF-SELECTION.
    * Write statement to represent report output. Spool request is created
    * if write statement is executed in background. This could also be an
    * ALV grid which would be converted to PDF without any extra effort
    *** Alternative way could be to submit another program and store spool
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
            AUTHORITY = SPACE
            COPIES = '1'
            COVER_PAGE = SPACE
            DATA_SET = SPACE
            DEPARTMENT = SPACE
            DESTINATION = SPACE
            EXPIRATION = '1'
            IMMEDIATELY = SPACE
    *       in_archive_parameters = space
    *       in_parameters = space
            LAYOUT = SPACE
            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.
      IF MSTR_PRINT_PARMS-PDEST = SPACE.
        MSTR_PRINT_PARMS-PDEST = 'LOCL'.
      ENDIF.
      MSTR_PRINT_PARMS-LINSZ = P_LINSZ.
      MSTR_PRINT_PARMS-PAART = P_PAART.
      SUBMIT (P_REPID) TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                          SPOOL PARAMETERS MSTR_PRINT_PARMS
                          USING SELECTION-SET P_SLSET
                          AND RETURN.
    * Get spool id from program called above
      PERFORM GET_SPOOL_NUMBER USING SY-REPID SY-UNAME CHANGING MI_RQIDENT.
    * IMPORT w_spool_nr FROM MEMORY ID SY-REPID.
      PERFORM CONVERT_SPOOL_TO_PDF.
      PERFORM PROCESS_EMAIL.
      IF P_DELSPL EQ 'X'.
        PERFORM DELETE_SPOOL.
      ENDIF.
      IF SY-SYSID = C_DEV.
        WAIT UP TO 5 SECONDS.
        SUBMIT RSCONN01 WITH MODE = 'INT'
        WITH OUTPUT = 'X'
        AND RETURN.
      ENDIF.
    * FORM obtain_spool_id *
    FORM OBTAIN_SPOOL_ID.
      CHECK NOT ( GD_JOBNAME IS INITIAL ).
      CHECK NOT ( GD_JOBCOUNT IS INITIAL ).
      SELECT * FROM TBTCP INTO TABLE IT_TBTCP
                                  WHERE JOBNAME = GD_JOBNAME
                                  AND JOBCOUNT = GD_JOBCOUNT
                                  AND STEPCOUNT = GD_STEPCOUNT
                                  AND LISTIDENT <> '0000000000'
                                  ORDER BY JOBNAME
                                  JOBCOUNT
                                  STEPCOUNT.
      READ TABLE IT_TBTCP INTO WA_TBTCP INDEX 1.
      IF SY-SUBRC = 0.
        MESSAGE S004(ZDD) WITH GD_SPOOL_NR.
        GD_SPOOL_NR = WA_TBTCP-LISTIDENT.
        MESSAGE S004(ZDD) WITH GD_SPOOL_NR.
      ELSE.
        MESSAGE S005(ZDD).
      ENDIF.
    ENDFORM. "OBTAIN_SPOOL_ID
    * FORM get_job_details *
    FORM GET_JOB_DETAILS.
    * Get current job details
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
           IMPORTING
                EVENTID                 = GD_EVENTID
                EVENTPARM               = GD_EVENTPARM
                EXTERNAL_PROGRAM_ACTIVE = GD_EXTERNAL_PROGRAM_ACTIVE
                JOBCOUNT                = GD_JOBCOUNT
                JOBNAME                 = GD_JOBNAME
                STEPCOUNT               = GD_STEPCOUNT
           EXCEPTIONS
                NO_RUNTIME_INFO         = 1
                OTHERS                  = 2.
    ENDFORM. "GET_JOB_DETAILS
    * FORM convert_spool_to_pdf *
    FORM CONVERT_SPOOL_TO_PDF.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                SRC_SPOOLID              = MI_RQIDENT
                NO_DIALOG                = C_NO
                DST_DEVICE               = C_DEVICE
           IMPORTING
                PDF_BYTECOUNT            = GD_BYTECOUNT
           TABLES
                PDF                      = IT_PDF_OUTPUT
           EXCEPTIONS
                ERR_NO_ABAP_SPOOLJOB     = 1
                ERR_NO_SPOOLJOB          = 2
                ERR_NO_PERMISSION        = 3
                ERR_CONV_NOT_POSSIBLE    = 4
                ERR_BAD_DESTDEVICE       = 5
                USER_CANCELLED           = 6
                ERR_SPOOLERROR           = 7
                ERR_TEMSEERROR           = 8
                ERR_BTCJOB_OPEN_FAILED   = 9
                ERR_BTCJOB_SUBMIT_FAILED = 10
                ERR_BTCJOB_CLOSE_FAILED  = 11
                OTHERS                   = 12.
      CHECK SY-SUBRC = 0.
    * Transfer the 132-long strings to 255-long strings
      LOOP AT IT_PDF_OUTPUT.
        TRANSLATE IT_PDF_OUTPUT USING ' ~'.
        CONCATENATE GD_BUFFER IT_PDF_OUTPUT INTO GD_BUFFER.
      ENDLOOP.
      TRANSLATE GD_BUFFER USING '~ '.
      DO.
        IT_MESS_ATT = GD_BUFFER.
        APPEND IT_MESS_ATT.
        SHIFT GD_BUFFER LEFT BY 255 PLACES.
        IF GD_BUFFER IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM. "CONVERT_SPOOL_TO_PDF
    * FORM process_email *
    FORM PROCESS_EMAIL.
      DESCRIBE TABLE IT_MESS_ATT LINES GD_RECSIZE.
      CHECK GD_RECSIZE > 0.
      LOOP AT P_EMAIL1.
        PERFORM SEND_EMAIL USING P_EMAIL1-LOW.
      ENDLOOP.
    * perform send_email using p_email2.
    ENDFORM. "PROCESS_EMAIL
    * FORM send_email *
    * --> p_email *
    FORM SEND_EMAIL USING P_EMAIL.
      CHECK NOT ( P_EMAIL IS INITIAL ).
      REFRESH IT_MESS_BOD.
    * Default subject matter
      GD_SUBJECT = P_ODESCR.
      GD_ATTACHMENT_DESC = P_ADESCR.
    * CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
      IT_MESS_BOD = TEXT-001." 'This is an automated report from SAP.'.
      APPEND IT_MESS_BOD.
      IT_MESS_BOD = TEXT-002. " 'Please do not reply to this mail id.'.
      APPEND IT_MESS_BOD.
      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
                                    P_ODESCR
                                    'PDF'
                                    GD_ATTACHMENT_NAME
                                    GD_ATTACHMENT_DESC
                                    P_SENDER
                                    GD_SENDER_TYPE
                                    CHANGING GD_ERROR
                                    GD_RECIEVER.
    ENDFORM. "SEND_EMAIL
    * FORM delete_spool *
    FORM DELETE_SPOOL.
      DATA: LD_SPOOL_NR TYPE TSP01_SP0R-RQID_CHAR.
      LD_SPOOL_NR = 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
    * Send email
    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_ADDRESS.
      LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.
    * Fill the document data.
      W_DOC_DATA-DOC_SIZE = 1.
    * Populate the subject/generic message attributes
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE .
      W_DOC_DATA-SENSITIVTY = 'F'.
    * Fill the document data and get size of attachment
      CLEAR W_DOC_DATA.
      READ TABLE IT_ATTACH INDEX W_CNT.
      W_DOC_DATA-DOC_SIZE =
      ( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
      W_DOC_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 = LD_EMAIL.
      T_RECEIVERS-REC_TYPE = 'U'.
      T_RECEIVERS-COM_TYPE = 'INT'.
      T_RECEIVERS-NOTIF_DEL = 'X'.
      T_RECEIVERS-NOTIF_NDEL = 'X'.
      APPEND T_RECEIVERS.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                DOCUMENT_DATA              = W_DOC_DATA
                PUT_IN_OUTBOX              = 'X'
                SENDER_ADDRESS             = LD_SENDER_ADDRESS
                SENDER_ADDRESS_TYPE        = LD_SENDER_ADDRESS_TYPE
                COMMIT_WORK                = 'X'
           IMPORTING
                SENT_TO_ALL                = W_SENT_ALL
           TABLES
                PACKING_LIST               = T_PACKING_LIST
                CONTENTS_BIN               = T_ATTACHMENT
                CONTENTS_TXT               = IT_MESSAGE
                RECEIVERS                  = T_RECEIVERS
           EXCEPTIONS
                TOO_MANY_RECEIVERS         = 1
                DOCUMENT_NOT_SENT          = 2
                DOCUMENT_TYPE_NOT_EXIST    = 3
                OPERATION_NO_AUTHORIZATION = 4
                PARAMETER_ERROR            = 5
                X_ERROR                    = 6
                ENQUEUE_ERROR              = 7
                OTHERS                     = 8.
    * Populate zerror return code
      LD_ERROR = SY-SUBRC.
    * Populate zreceiver return code
      LOOP AT T_RECEIVERS.
        LD_RECEIVER = T_RECEIVERS-RETRN_CODE.
      ENDLOOP.
    ENDFORM. "SEND_FILE_AS_EMAIL_ATTACHMENT
    *& Form GET_SPOOL_NUMBER
    * text
    * -->P_SY_REPID text
    * -->P_SY_UNAME text
    * <--P_MI_RQIDENT text
    FORM GET_SPOOL_NUMBER USING F_REPID
                                F_UNAME
                                CHANGING F_RQIDENT.
      DATA:
      LC_RQ2NAME LIKE TSP01-RQ2NAME.
      CONCATENATE F_REPID+0(9)
      F_UNAME+0(3)
      INTO LC_RQ2NAME.
      SELECT * FROM TSP01 WHERE RQ2NAME = LC_RQ2NAME
                          ORDER BY RQCRETIME DESCENDING.
        F_RQIDENT = TSP01-RQIDENT.
        EXIT.
      ENDSELECT.
      IF SY-SUBRC NE 0.
        CLEAR F_RQIDENT.
      ENDIF.
    ENDFORM. " GET_SPOOL_NUMBER
    Regards,
    Vasanth

  • Trigger mail after UD

    Hi Experts,
    Can anyone please tell me how to configure for trigger mail in workplace once UD takes place.
    System should send mail once I save the UD & its should show pop up message of mail.
    Regards,

    There is concept of followup action in Usage decision code.Explre QS51 where against UD code there is followup action.
    Where you can get facility to trigger the mail.
    What you can do is ->In QCC3->Inspect lot completion>define followup action>here create a Z-function module & assign against the followup action......
    Take help of Abaper
    Also refer recent thread Follow-up Action at UD-QM

  • Trigger mail(sending mail to respective person)when budget is release in PS

    Dear Sir,
    I want to trigger mail ( sending mail to respective person ) when budget is release in PS.
    Please help for following :
    Option 1 : User exit
    Option 2: Workflow.
    Regards
    Vinu

    Hi Vinod,
    You can acheive this using a Workflow. What you need to do is set an user status as Rbud-release budget, and when ever you project is set to this status a workflow will trigger to the concerned aggest assigned to workflow task. Here you can provide a user decision as 1. Approve 2. Reject. When ever workflow triggers, approver can see in his inbox the project budget in Cj30 by clicking object link to cj30 and if he feels it is ok then he can click Approve button this will take him to CJ32 screen where he can release the budget. IF the user feels Budget need to be revised then he will click reject this will send an email to the person responsible to revise the budget and at the same time user status will be reset back to previous user status.
    The above  method we have adapted for one of our client. This is done by a workflow consultant.
    Thanks
    regards
    kishore

  • Sending mails using dynamic actions

    Hi
    How we can send mails using dynamic actions.
    Regards
    Santhosh

    Hi,
    Sending mails is possible by using the feature M0001. This is to be coded in the dynamic action depending on the requirement with function code "M".
    Hope this would help you to explore further. Incase of any specific query you can post back.
    Regards
    Tharak

  • Send mail using Dynamic actions

    Hello experts,
    How to send  a mail using Dynamic Actions??
    Requirement : Lets say one employee is hired on 26th Aug, so after 10 days he will be confirmed. so on 8th day need to send a mail to concerned person reminding the confirmation date.
    so how do i do that using dynamic actions??
    Thanks in advance.
    Saurabh

    Hi,
    In dynamic actions there is an option for calling sub-routine from any program or subroutine pool. So u can make subroutine for sending mail according to ur requirement. An call on th same from dynamic actions.
    if u want sample code for this, pls let me know.
    <removed_by_moderator>
    Regards,
    Ranjith
    Edited by: Julius Bussche on Aug 26, 2008 3:25 PM

  • Workflow doesnot automatically trigger mail ..

    Hi MDM Gurus,
    I am trying to design a simple workflow
    Start>Process>Approve-->Stop.
    This flow Or workflow works and does trigger a mail to approver and processer when i execute the workflow Manually .i.e In Datamgr i select the record... go to records in header --workflow and execute the corresponding workflow..evrything works fine..
    But when i put the XML file in ready folder(to automatically suck into datamanager with help of MDIS server) of respective repository..Workflow doesnot trigger a mail...What can be the reason ..I have checked the mds.ini file and it has server path in it.
    Please can anyone let me know what can be the problem...
    Regards,
    Vikrant...

    Hi Vikrant,
    I have worked on a similar scenario as yours,where my workflows steps were
    START->MATCH->APPROVE->STOP->
    I automated this workflow,whereby the import file was automatically pulled into MDM and workflow automatically launched  then the matching strategy automatically executed on them.
    For this I had to:
    - Create a workflow chk if all the stencil are properly connected and then SAVE the workflow.
    -Fill in the properties of all properly,by mentioning the strategy name in the match stencil.
    -Making the trigger action as Record Import
    -In Configuration options giving the name of the workflow
    -Setting up the ini file and giving the delay time.
    If all these steps are carried out properly your workflow should work automatically fine,it worked for me
    Check to see your import server is up and running fine in the services and that your workflow is saved properly.
    Below link might help you build your workflow correctly
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=workflow&cat=sdn_all
    (Dynamism in Static Master Data Management Area - The Workflow)
    Thanks & Regards
    Simona

Maybe you are looking for

  • Display resolution changed at reboot. cant go back.

    My monitor (samsung 932nw) works wonders on 1440 x 900 resolution. it has worked wonders with my mac mini for months but this morning when i started the machine the resolution had changed. when i went into the displays screen that resolution does not

  • Insert picture in message

    I've got an image of the screen in .pdf or .jpg form. How do I insert it in a message?  I see the "Insert Image" icon but that asks for a url. I don't understand that. What I'm really after is, what does the little symbol that looks like a dollar bil

  • Setup EarlyWatch Alert

    Dear all, now i am configuring Earlywatch alert , i have done below configuration . 1,System Landscape (SMSY) - Creating Systems . i was struck in the 2 step as System Landscape (SMSY) - Create Logical Components. i have done below steps : SMSY>syste

  • Will OraRRP Support Adobe Acrobat Reader X?

    After Adobe Acrobat Reader version 9 on a Windows PC was upgraded to version X (10), the Oracle Reports Remote Printing Utility (orarrp.exe v1.3.4) no longer worked. (OraRRP setup for Reports 10gR2 per MetaLink Note ID: 277431.1.) It worked fine befo

  • N80 Firmware Versions

    Hi, I have a 2 month old US N80ie with firmware V 4.0632.0.38 and when I check on the Nokia site for updates it tells me this is the latest, BUT I keep seeing V4.0707.0.7 in the posts...should i get this ? and if so, how?? ALSO, i keep getting out of