Skip to Content

Applies to:

SAP BW

Summary

To create BEx broadcast settings via ABAP program dynamically instead of via portal.

Author(s):    Khaja Kamaluddin, Divya John, Vinay Singh.

Company:    Larsen and Toubro InfoTech.

Created on:  07 April 2014

Author Bio

   Khaja Kamaluddin has 6.4 years of experience in SAP BW and ABAP, started his career as an ABAP programmer over a period shifted to SAP BW/ BI, he worked in support, implementation, upgrade and enhancement projects.

Vinay Singh has 3 Year of experience as a BI ABAP consultant.

Divya John has 3 years experience as an ABAP Programmer.

Need For Creating BEx Broadcast settings Dynamically

The Requirement is for pushing mails with BEx workbooks to subscribing users at a given frequency. For every user , in order to broadcast mail , settings need to be created manually in Portal . For a large number of users/subscribers it would be difficult to maintain settings manually. Hence the need for creating settings dynamically using ABAP Program.

Initially required Users and their relevant details like email id , workbook id , report name etc are maintained in Z-Table. Settings and mail body are then created for each User and these settings are broadcast using Pre-Calculation server. Also if any settings have not been broadcast, then these settings are reprocessed and pushed.

In this document creation of BEx Broadcast settings using ABAP program is explained.

Assumptions:

Users for whom BEx broadcast settings are to be created are maintained in a Ztable with details like their email id , workbook id , report name etc.

Creating broadcast settings for the Budget Owner numbers.

  • Now that data required for broadcasting to a budget owner is stored in ZCONTROL, create settings required for broadcasting using Pre-calculation server.
  • Manually the settings can be created via. Portal as shown below.

Capture1.PNG

Enter the email address , authorization user in recipients tab.

Capture.PNG

Choose the method of distribution of document.

Capture.PNG

Provide email address, subject and body of mail.

Capture.PNG

Capture.PNG

Schedule the broadcast as per required frequency.

Capture.PNG

Capture.PNG

In above window assign variable and Pre calculation server and execute.

Capture.PNG

On successful execution, above log is displayed and the workbook is broadcast to the recipient.

Capture.PNG

The new settings created in this process is outlined in red.

The entire process is being done now with the ABAP program given below .

Advantages with the ABAP program:-

  • Multiple Broadcast settings can be created in one time exactions , so Workbook broadcasting can be performed for the Multiple Workbook and multiple Users at one time execution of ABAP program that we will see in below Doc .
  • Attachment in the Broadcasted mail can be changed by using ABAP classes and Methods such as Name and the type of the attachment can be changed as per the requirement.
  • Reprocessing of the Failed Broadcast settings can be executed again , because most of times the cause of failure of Broadcast settings is the time out, reprocessing ABAP program will be added in next document .

  • Troubleshooting or the Debugging is easy with the ABAP program in the scenario of any error occurs while the execution of the Workbook broadcasting .

ABAP program flow is given below :-

  • Execute program ZBEX_BROAD .
  • This program creates settings and maintains them in standard tables

RSRD_SETTING    
RSRD_SETTINGT

RSRD_SETT_NODE

RSRD_SETT_NODE_A
RSRD_SETT_NODE_T

And also maintains all the created settings for budget owners in Z-Table ZBROADSET

Here we also compose email body to which workbook will be attached and sent

The working of the program is as follows:

  1. 1.  The setting id’s are created by concatenating username , current date and current time separated by underscore.
  2. 2.  Populate in RSRD_SETTING, RSRD_SETTINGT, RSRD_SETT_NODE, RSRD_SETT_NODE_A, RSRD_SETT_NODE_T table the setting id and all other required fields.
  3. 3.  For mail content in html a class ZCL_RSRD_DISTRIBUTOR_MAIL is created and passed to RSRD_SETT_NODE table. This class is a copy of CL_RSRD_DISTRIBUTOR_MAIL and the method SET_BODY is changed for our requirement.

Capture.PNG

Capture.PNG

Attachments:



Figure 1.Program to create settings



Figure 2.Top include for settings program



Figure 3.Class used






Related Content

Please include at least three references to SDN documents or web pages.

Reference 1

Reference 2

Reference 3

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Gilbert Seidel

    Hi Khaja,

    very nice idea! But in your code are some declerations used with Z-Objects. How they have to be defined? What is about Control – table? What are the data elements? 😕

    Thanks for sharing Information!

    Best

    Gilbert

    (0) 
  2. Daisy Jesse

    Hi Khaja,

    This is great! Thank you for sharing this information. I do have some questions regarding the Z tables, how are they defined and what fields are needed to create these Z tables. What is the purpose of the zregion field?

    Thanks!

    Best Regards,

    Daisy

    (0) 

Leave a Reply