Create Bex Broadcast settings dynamically Via ABAP Program step by step document
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
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.
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.
Enter the email address , authorization user in recipients tab.
Choose the method of distribution of document.
Provide email address, subject and body of mail.
Schedule the broadcast as per required frequency.
In above window assign variable and Pre calculation server and execute.
On successful execution, above log is displayed and the workbook is broadcast to the recipient.
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
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. The setting id’s are created by concatenating username , current date and current time separated by underscore.
- 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. 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.
Figure 1.Program to create settings
Figure 2.Top include for settings program
Figure 3.Class used
Please include at least three references to SDN documents or web pages.