How to send spool to Distribution List using JOB_CLOSE

Please help on sending Distribution list when job defined using JOB_OPEN, JOB_Submit and JOB_CLOSE
Thanks.

Hi, this is code:
DATA  WA_RECIPIENT LIKE swotobjid.
CONSTANTS:  gc_objname  TYPE oj_name    VALUE 'RECIPIENT'.
PERFORM get_distribucion_list USING    'NAME_LIST'   " name of List of distribution
                              CHANGING WA_RECIPIENT.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
      jobcount                          = l_jobcount
      jobname                           = l_jobname
      strtimmed                         = 'X'
    recipient_obj                     = wa_recipient
IMPORTING
   job_was_released                  = l_libero
EXCEPTIONS
   cant_start_immediate              = 1
   invalid_startdate                 = 2
   jobname_missing                   = 3
   job_close_failed                  = 4
   job_nosteps                       = 5
   job_notex                         = 6
   lock_failed                       = 7
   OTHERS                            = 8.
FORM get_distribucion_list USING    p_objnam       TYPE so_obj_nam
                           CHANGING p_wa_recipient LIKE swotobjid.
  DATA: it_tab LIKE STANDARD TABLE OF soxdl
               INITIAL SIZE 0 WITH HEADER LINE.
  CHECK NOT p_objnam IS INITIAL.
  CALL FUNCTION 'SO_DLI_LIST_READ_XDL'
    EXPORTING
      dli_generic_name            = p_objnam
      public                      = 'X'
      subscript                   = 'X'
    TABLES
      dli_display_tab             = it_tab
    EXCEPTIONS
      communication_failure       = 1
      dl_list_no_entries          = 2
      owner_not_exist             = 3
      system_failure              = 4
      x_error                     = 5
      parameter_error             = 6
      OTHERS                      = 7
  IF sy-subrc = 0.
    READ TABLE it_tab INDEX 1.
    IF sy-subrc = 0.
      CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
        IMPORTING
          own_logical_system             = p_wa_recipient-logsys
        EXCEPTIONS
          own_logical_system_not_defined = 1
          OTHERS                         = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      MOVE gc_objname TO p_wa_recipient-objtype.
      CONCATENATE it_tab-dlitp it_tab-dliyr it_tab-dlino
                  INTO p_wa_recipient-objkey.
    ENDIF.
  ELSE.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
ENDFORM.

Similar Messages

  • How to send mail to distribution list ?

    Hi Everybody,
    Pls let me know how to send mail to distributed list???
    Thanks & Regards,
    raju<b></b>

    Hi ,
      Use Function Module 'SO_NEW_DOCUMENT_SEND_API1'.
      U need to pass Distribution list to Receiver and 'C' to receiver type refer the below code for clarification.
    Determine the Distribution List.
            gv_rec_list-receiver = gv_distribution.
            gv_rec_list-rec_type = 'C'.
            APPEND gv_rec_list.
    Check if Distribution List is deleted.
            SELECT SINGLE objnam
                     FROM soid
                     INTO lc_objnam
                     WHERE objnam = gv_rec_list AND
                           dlitp  = lc_dli.
            IF sy-subrc = 0.
              CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
                EXPORTING
                  document_data              = gv_doc_data
                  document_type              = 'RAW'
                  put_in_outbox              = 'X'
                TABLES
                  object_content             = gv_obj_cont
                  receivers                  = gv_rec_list
                EXCEPTIONS
                  too_many_receivers         = 1
                  document_not_sent          = 2
                  document_type_not_exist    = 3
                  operation_no_authorization = 4.
              CASE sy-subrc.
                WHEN '1'.
                 message i001(as) with 'TOO MANY RECEIVERS'.
                  EXIT.
                WHEN '2'.
                 message i001(as) with 'DOCUMENT NOT SENT'.
                  EXIT.
                WHEN '3'.
                 message i001(as) with 'DOCUMENT TYPE DOES NOT EXIST'.
                  EXIT.
                WHEN '4'.
                 message i001(as) with 'OPERATION NO AUTHORIZATION'.
                  EXIT.
              ENDCASE.
              Hope this might have helped you.
    Thanks,
    Prashanth

  • How to get administrations of distribution list using api?

    I want get all administrations of a distribution list using api, how to do that?
    anybody knows? Thank you very much!!

    there is a standard function in mdm wd component
    https://help.sap.com/saphelp_nwmdm71/helpdata/en/loio30bf76947bb64c48a2e835fda42c5183_30bf76947bb64c48a2e835fda42c5183/4…
    "Note The Compare to Original button on the Items Detail component opens a Compare component enabling a user to compare a checked out record with an original record (if the user has authorization for the checked out group).
    If the checked out record is a result of a merge action, then the Compare view displays all the original records prior to the merge. When a merge action is executed on a number of checked out records, the merged record is also checked out."

  • How to create Exchange dynamic distribution list using multivalue extension custom attribute

    I am trying to create a dynamic distribution list using an ExtensionCustomAttribute.  I am in hybrid mode with Exchange 2013.  The syntax I have is this: 
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {(ExtensionCustomAttribute2 -eq 'NH')} 
    This works correctly on-prem.  But hosted always results in an empty list.  I can see in dirsync the attribute is in the hosted environment, but for whatever reason, the distribution group gets created but always come up null.
    If I create a group looking at the single valued attributes, such as CustomAttribute6 -eq 'Y', it works correctly on-prem and hosted.  
    If anyone has any suggestions I would appreciate it.

    I don't think I provided enough information about the problem.  Let me add some and see if it makes sense.
    I have an Exchange 2013 on-premise configured in hybrid mode with Office365.  For testing purposes, I have 2 users, Joe and Steve, one with the mailbox on-prem, and the other with the mailbox in the cloud.  Each of them has CustomAttribute6 = 'Y'
    and ExtensionCustomAttribute2 = 'NH'. Dirsync shows these users and these attributes are synced between on-prem and cloud.
    Using on-prem Exchange powershell, I run the following command:
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (CustomAttribute6 -eq 'Y')} 
    This correctly finds the 2 users when I query for them as follows:
    $DDG = Get-DynamicDistributionGroup DG_NH
    Get-Recipient -RecipientPreviewFilter $DDG.RecipientFilter | FT alias
    So I then delete this DG, and recreate it this time looking at the multi-value attribute ExtensionCustomAttribute2, as follows:
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (ExtensionCustomAttribute2 -eq 'NH')} 
    Replaying the query above, I can see this also works fine and finds my two users.
    Next I open a new powershell and connect to Office 365 and repeat the process there.
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (CustomAttribute6 -eq 'Y')} 
    This correctly finds the 2 users when I query for them.
    And then delete the group and recreate it using the multi-value attribute:
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (ExtensionCustomAttribute2 -eq 'NH')} 
    When I run the query this time it produces no result.  Every test I try results in an empty group if I am using a multi-valued attribute in the search criteria in the cloud.  If I use single valued attribute, it works fine.
    I really need to be able to get multi-valued DDG's working in the cloud.  If anyone has done this and has any suggestions, I would appreciate seeing what you did.  And if this is the wrong forum to port this, if you can point me to a more suitable
    forum I will report there.
    Thanks,
    Richard

  • How to send mail to distribution list and another table list

    Hi
    I am facing a problem. I need to send mail to the user who is creating the SO/PO and a distribution list.
    Problem is only one thing can be used at the same time. ie either Distribution list or list from internal table.
    How can we use both in 1 function module. Like it should call the internal table and then the distribution list for sending the mail .
    Regards,
    Varun

    Hi,
    Refer to following link,
    http://www.sap-img.com/abap/make-e-mail-sender-of-po-the-po-creators-name.htm
    http://www.sap-img.com/fu016.htm
    Reward pts. if helpfull.
    Regards,
    Dhan

  • Send mail to distribution list using UTL_MAIL.SEND

    Oracle 10.2.0.4.0
    Does UTL_MAIL.SEND support sending mail to a distribution list?. The doc says, the recipient mail-id should be separated by a comma. The distribution list has mail-id separated by a comma. I executed a test case sending a mail to a distribution list, I did not receive any error or exception. I did not receive the test mail as well!!.
    Has anyone used the UTL_MAIL.SEND to send mails to a distribution list?.
    Thanks

    Has anyone used the UTL_MAIL.SEND to send mails to a distribution list?.Oracle RDBMS does not know or care is email address is single recipient or list.
    It sends message to name provided.
    It is up to MTA to deliver any message it gets.
    Are you 100% certain that message got to MTA & was successfully processed by it?

  • Send email to distribution list using OOP...

    Hello Experts,
    I currently have a requirement to send email(w/o attachment) to a distribution list or specific user. I have searched the forum and it doesnt suit my requirement as the examples gives only how to send email to specific user/s. Any inputs would be appreciated.
    Thank you guys and take care!

    Hi ,
    For sending mail with attachments in multiple sheets of an excel document please see the
    sample code below:
    REPORT  ZBC_ITAB_TO_EXCEL_NEW                   .
    CLASS: cl_abap_char_utilities DEFINITION LOAD.
    DATA: docdata LIKE sodocchgi1,
          objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
          objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
          objbin1 LIKE solisti1 OCCURS 10 WITH HEADER LINE,
          objbin2 LIKE solisti1 OCCURS 10 WITH HEADER LINE,
          objbin_final LIKE solisti1 OCCURS 10 WITH HEADER LINE,
          reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE,
          tab_lines TYPE sy-tabix.
    DATA: gd_sender_type LIKE soextreci1-adr_typ.
    DATA: c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
          c_ret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
    DATA: c_dev TYPE sy-sysid.
    DATA: BEGIN OF i_data OCCURS 0,
          a(20),
          b(20),
          END OF i_data.
    DATA: BEGIN OF st,
          f1(2) TYPE c,
          f2(2) TYPE n,
          END OF st.
    DATA: itab1 LIKE TABLE OF st WITH HEADER LINE,
          itab2 LIKE TABLE OF st WITH HEADER LINE.
    DATA: n TYPE i.
    PARAMETER: p_email1 LIKE somlreci1-receiver
               p_sender LIKE somlreci1-receiver.
    START-OF-SELECTION.
      itab1-f1 = 'AA'. itab1-f2 = '01'. APPEND itab1.
      itab1-f1 = 'BB'. itab1-f2 = '02'. APPEND itab1.
      itab1-f1 = 'CC'. itab1-f2 = '03'. APPEND itab1.
      itab2-f1 = 'ZZ'. itab2-f2 = '26'. APPEND itab2.
      itab2-f1 = 'YY'. itab2-f2 = '25'. APPEND itab2.
      LOOP AT itab1.
        CONCATENATE itab1-f1 itab1-f2 INTO objbin1 separated BY c_tab.
        CONCATENATE c_ret objbin1 INTO objbin1.
        APPEND objbin1.
      ENDLOOP.
      LOOP AT itab2.
        CONCATENATE itab2-f1 itab2-f2 INTO objbin2 separated BY c_tab.
        CONCATENATE c_ret objbin2 INTO objbin2.
        APPEND objbin2.
      ENDLOOP.
      LOOP AT objbin1.
        MOVE objbin1-line TO objbin_final-line.
        APPEND objbin_final.
      ENDLOOP.
      LOOP AT objbin2.
        MOVE objbin2-line TO objbin_final-line.
        APPEND objbin_final.
      ENDLOOP.
      PERFORM process_email.
      c_dev = sy-sysid.
      IF sy-sysid = c_dev.
        wait up to 5 seconds.
        SUBMIT rsconn01 WITH mode = 'INT'
        WITH output = 'X'
        AND RETURN.
      ENDIF.
      IF sy-subrc = 0.
        WRITE: / 'Email succesfilly delivered'.
      ELSE.
        WRITE: / 'failure'.
      ENDIF.
    *&      Form  process_email
    *       text
    FORM process_email.
      IF p_sender EQ space.
        gd_sender_type = space.
      ELSE.
        gd_sender_type = 'INT'.
      ENDIF.
    *Body
      docdata-obj_name = 'Mail_Excel_File'.
      docdata-obj_descr = 'Excel file attachment'.
      objtxt = 'Attached is the sample Excel file'.
      APPEND objtxt.
      DESCRIBE TABLE objtxt LINES tab_lines.
      READ TABLE objtxt INDEX tab_lines.
      docdata-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
      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.
    *Attachment
      n = 1.
      DESCRIBE TABLE objbin1 LINES tab_lines.
      objpack-doc_size = tab_lines * 255.
      objpack-transf_bin = 'X'.
      objpack-head_start = 1.
      objpack-head_num = 1.
      objpack-body_start = n.
      objpack-body_num = tab_lines.
      objpack-doc_type = 'XLS'.
      docdata-obj_name = 'Excel_File_Attachment1'.
      objpack-obj_descr = 'Excel File Attachment1'.
      APPEND objpack.
      n = n + tab_lines.
      DESCRIBE TABLE objbin2 LINES tab_lines.
      objpack-doc_size = tab_lines * 255.
      objpack-transf_bin = 'X'.
      objpack-head_start = 1.
      objpack-head_num = 1.
      objpack-body_start = n.
      objpack-body_num = tab_lines.
      objpack-doc_type = 'XLS'.
      docdata-obj_name = 'Excel_File_Attachment2'.
      objpack-obj_descr = 'Excel File Attachment2'.
      APPEND objpack.
    *Create the list of recipients
      reclist-receiver = p_email1.
      reclist-rec_type = 'U'.
      reclist-express = 'X'.
      APPEND reclist.                 "For sending mail to multiple ids append this internal table with your reqd ids
    *Send the e-mail
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = docdata
          put_in_outbox              = 'X'
          commit_work                = 'X'
        TABLES
          packing_list               = objpack
          contents_bin               = objbin_final
          contents_txt               = objtxt
          receivers                  = 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.
      COMMIT WORK.
    ENDFORM.                    "process_email
    Hope it helps,
    Regards
    Mansi
    Edited by: MANSI  ASNANI on Oct 13, 2009 7:56 AM

  • HT204150 Distribution list using Contacts

    How do I make a distribution list using Contacts?

    Click the the groups button in contacts
    Add and name a new group
    Drag contacts into the group
    Create an email and use the name of the group in the address field.

  • How do I send e-mail to a distribution list using LabWindows/CVI?

    I need to be able to send e-mail to a user-defined distribution list using LabWindows/CVI? Has anyone done this? Any ideas where I could look?

    I commented on something similar to this awhile back.  My issue was that I had the base version and didn't have the Internet classes.  So this external app worked like a charm
    It has a lot of command-line inputer options to use as well.
    http://forums.ni.com/t5/LabWindows-CVI/Need-Help-for-Sending-Email-with-LabWindows-8-5-or-9/m-p/1095...

  • How to Send an Email to Outlook using process type in RSPC?

    Hi,
    How to Send an Email to Outlook using process type in RSPC?
    We created lot of process variants, actually we want to send an mail to users if the DP Background job was succesfully finished.
    Actually i tried with create message its not happening...
    Plz let me know .. its urgent ...
    Regards,
    Satish

    Hello Satish,
    If you want to send a friendly message to your users, then you can do this by building an ABAP program that calls function module SO_NEW_DOCUMENT_SEND_API1 . You can then insert this ABAP program in your process chain (using the ABAP program process type) or as a second step in your background job. With this technique, you can send an email to SAP users, or to external users (e..g Outlook email addresses)
    Here's  a sample ABAP code:
      data: ls_docdata type SODOCCHGI1,
            lt_objcont type table of solisti1,
            lt_receivers type table of somlreci1,
            ls_objcont type solisti1,
            ls_receivers type somlreci1,
            ls_user type syuname.
    * Fill these variables with subject and msg lines that you need.
    data: MAIL_SUBJECT     TYPE STRING,
    MSG_LINE1     TYPE STRING,
    MSG_LINE2     TYPE STRING,
    MSG_LINE3     TYPE STRING,
    MSG_LINE4     TYPE STRING,
    MSG_LINE5     TYPE STRING.
      ls_docdata-obj_descr = mail_subject.
      ls_objcont-line = msg_line1.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line2.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line3.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line4.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line5.
      append ls_objcont to lt_objcont.
    * t_userlist contains the list of users to whom th email will be sent.
      loop at t_userlist into ls_user.
        ls_receivers-receiver = ls_user.
    "Change the type  here if email is for outlook users, See documentation
    " of function module in SE37
        ls_receivers-rec_type = 'B'.            
        ls_receivers-express = 'X'.
        append ls_receivers to lt_receivers.
      endloop.
      CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
        EXPORTING
          document_data                   = ls_docdata
        tables
         OBJECT_CONTENT                   = lt_objcont
         receivers                        = lt_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
    You can test out the function module first in SE37 (just put the name of the FM and click execute). Testing it in SE37 will help you get your parameters right.
    Hope this helps.

  • Is it posible send email to distribution list like group of mails

    Hi ,
    i need to know if its possible to send email to distribution list via SAP
    please let me know the process or program to do so or how to develop it? let me know if its possible by sap or not?
    regards
    ARORA

    Agree with Zarko. But when you add contact for that external user and allow only that sender, the DL will not receive emails from any other users (internal or external).
    If you added any entries under "Accept mesages only from Only sendes in below list" then only the entries added will be able to send mail to that DL whether the check box "Require that all senders are authenticated" is selected or not. You may check the
    below technet article for more details.
    http://technet.microsoft.com/en-us/library/bb124405(EXCHG.80).aspx

  • How can I create email distribution lists in my contacts on my macbook air?

    How can I create email distribution lists in my contacts on my macbook air? I could do this on a pc using outlook, but I don't see how to do it on my new mac.

    UPDATE, ok, I figured out how to make a list, but how can I remove specific contacts from the list? The "Remove from Group" is greyed out & not available.

  • How to Enable Ratings on SharePoint List using Client Object Model for Office 365 SharePoint Site.

    How to Enable Ratings on SharePoint List using Client Object Model code for Office 365 SharePoint Site.
    Thanks in Advance
    Rajendra K

    Hi Rajendra,
    here you are the code and the blog, let me know if this helps
    using (ClientContext ctx = new ClientContext(https://yourSiteUrl))
    Web w = ctx.Web;
    List l = w.Lists.GetByTitle("yourListName");
    ctx.Load(l, info => info.Id);
    ctx.ExecuteQuery();
    string ListID = l.Id.ToString();
    Microsoft.Office.Server.ReputationModel.Reputation.SetRating(ctx, ListID, 1, 5);
    ctx.ExecuteQuery();
    http://blogs.technet.com/b/speschka/archive/2013/07/08/how-to-use-csom-with-ratings-in-sharepoint-2013.aspx
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation

  • Monitoring of task - send mail to Distribution list

    Dear team,
    I have a dynamic action:
    01          06     100     P     **EXPIRY OF PROBATION**
    01          06     102     P     T001P-MOLGA='99'/X
    01          06     105     M     Z0001
    Pls check for me. So, do i fill the field name in field name columm?
    I created feature Z0001
    0001
    0002
    0006
    0019
    DISTR ZDL0001
    IDTXT  Z_Expiry_of_probation
    But it does not work. And futher, i don't know how is the result in Distribution list. Could you share me the screen shot?
    Thank you very much
    Quanglv

    Help me plssssssssssssssssss
    Edited by: Quang Le Vinh on Sep 21, 2009 10:35 AM

  • Could you some one help me how to send a message on twitter using Oracle SOA?

    Hi Team,
              I am trying to send a message from Oracle SOA to Twitter, But i am not able to do the scenario.Could you some one help me how to send a message on twitter using Oracle SOA?
    Regards,
    Kiran

    Very challenging and doubtful at the same time !
    I don't think, its going to be a straight-forward one... Read about OAuth twitter authentication, before you try to post tweets.

Maybe you are looking for

  • How can I test my thunderbolt port? It's not working after the update to 10.10.1

    I have been using my computer with the Thunderbolt Port for a while and after updating to 10.10.1 and after I while of using my computer I tried to use the thunderbolt port with my external monitor.. and it doesn't work at all.. video doesn't come ou

  • SET AUTOTRACE ON..problems

    Hi everyone! I tried to set autotrace on with the following command. I got some errors . SQL> SET AUTOTRACE ON EXPLAIN STATISTICS SP2-0613: Unable to verify PLAN_TABLE format or existence SP2-0611: Error enabling EXPLAIN report SP2-0618: Cannot find

  • Need to sort results in a report in descending order

    Hi, We have OIM 10g and we need to sort the report on date in descending order. I tried this code but still the column is not getting sorted. Evertime I generate the report, the results are sorted only in ascending order. Here the stored procedure co

  • Role of clients in CRM Multiple Backend Scenario

    Does the CRM Multiple Backend Scenario only apply to a single client pointed to multiple CRM or ERP systems. All the relevant tables are client dependent in CRM 2007 and the client independent ones use logical destinations which can easily be pointed

  • I do not have the Private Browsing toggle to turn off.

    Trying to use Yahoo Mail...I'm getting the message to "go to Setting >>Safari >>Private Browsing >>Turn it off.  When I look at this in my settings, I don't have the Private Browsing toggle.  I do not know what to do.