Standard service - a fixed amount of work that is performed at a fixed price.  Post Service

  

Sunday, 26 May 2019 06:05

Distribution List in SAP

Written by  https://sapyard.com/distribution-list-in-sap/
Rate this item
(0 votes)

Once again we are going back to basics. Today we would focus on the Distribution List in SAP. Just like we can create an e-mail list in Lotus

notes or Outlook, similarly we can create a list in SAP and send one e-mail to multiple recipients simultaneously. Distribution list is an age old tool in SAP, but many of our fresher might find this tutorial useful and interesting.

In other words, if there is a project requirement to notify a group of people about a particular process through e-mail then one can make use of Distribution List in SAP.

Distribution list are similar to SMTP and reduces programming effort to a great extent for notifying group of people.

Also Learn: How to consume HANA Models in SAP ABAP Programs?

Steps for creation of Distribution List (DL):

  • Tcode for Distribution list is SO23.
  • Click on create button and create your ownfolder in DL and specify the details as showed.
  • One can set below properties like retentionproperties etc.
  • Once the folder is created and respective properties are added as per above snapshot add the respective email id to whom mail should be sent and you are done creating DL.

Also Read: How I created my first program in S/4HANA

Different ways to use DL:

Few of the many ways in which the DistributionList can be used is mentioned below:

  1. One can go to SBWP tcode and select the folder which you have created as part of Distribution List and click on create new document.

Create your message as shown below and click on send.

Click on send and select the Distribution list created by you and clickon send , your mail is sent.

Also Read: My First SAP OData Service

2. Create a custom program which can be used to send email according to your Distribution List.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<code>*&amp;---------------------------------------------------------------------*
*&amp; Report ZYASH_DL
*&amp;---------------------------------------------------------------------*
*&amp; Demo program to send email to Distribution List
*&amp;---------------------------------------------------------------------*
REPORTzyash_dl.
"Create a ref of type CL_BCS
DATA:obj_mailTYPEREF TOcl_bcs,
obj_sendTYPEREF TOif_recipient_bcs,
l_outputTYPEboolean,
mail_bodyTYPEbcsy_text.
TRY.
obj_mail=cl_bcs=>create_persistent().
CATCHcx_send_req_bcs.
ENDTRY.
** ONE CAN TAKE THE DL AUTOMATICALLY BY PASSING IT THROUGH SELECTION SCREEN AS INPUT PARAMETER
TRY.
obj_send?=cl_distributionlist_bcs=>getu_persistent(i_dliname='ZYASH'
i_private=' ').
CATCHcx_address_bcs.
ENDTRY.
TRY.
obj_mail->add_recipient(i_recipient=obj_send).
CATCHcx_send_req_bcs.
ENDTRY.
"Lets create the message
APPEND'Hi , Please comment if you found this article useful'TOmail_body.
TRY.
DATA(l_doc)=cl_document_bcs=>create_document(i_type='RAW'
i_subject='Welcome Yash To DL'
i_sensitivity='P'
i_text=mail_body).
CATCHcx_document_bcs.
ENDTRY.
TRY.
obj_mail->set_document(i_document=l_doc).
CATCHcx_send_req_bcs.
ENDTRY.
TRY.
CALL METHODobj_mail->send
EXPORTING
i_with_error_screen=space
RECEIVING
result=l_output.
CATCHcx_send_req_bcs.
ENDTRY.</code>

You might have used the Distribution List in your projects but you might not have created one list yourself. In most projects, the Basis/Admin teams create this list for us. Check if you have access to create it in your landscape. If yes, this is a good opportunity to create your first Distribution List and practice.

In few articles we would keep posting more basic stuffs used in SAP. They might look simple, but they are very useful and young consultants need to know about it.

We have a very active Telegram (App) SAP Technical Group with more than 4930+ SAP Technical Practitioners from 6 Continents of the SAP World. Please join it using below link.
Telegram SAP Technical Discuss Group. You need to install the Telegram App first on your mobile device. Once you have it on your mobile, you can join the group and also access it from the Web on your computer and laptop.

Please SUBSCRIBE to SAPYard’s Youtube Channel for Free End to End SAP Video Course and Training.

Free SAP ABAP for HANA Training Tutorials Exercises.

Read 180 times

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.