Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
arun_purohit
Participant
0 Kudos

Requirement is to trigger emails to different users (emails) with different restrictions (Query Variants) for the same BEx query, but using only one Email setting in Information Broadcasting.

Reason: If we need to trigger emails to 50 users with different restrictions (variants), we will need to create 50 email settings. It become difficult to maintain (changing, scheduling or maintaining) 50 email settings on same query.

We can create a ABAP report as follows and which can be scheduled as job with variants (name of email setting).

******************************************


**Report  YEMAIL_ONE_EMAIL_SET


REPORT YEMAIL_ONE_EMAIL_SET.

TABLES RSRD_SETT_NODE_A.
DATA: g_setting_id TYPE rsrd_setting_id.
DATA wa_rsrd_sett_node_a TYPE rsrd_sett_node_a.
"g_setting_id OBLIGATORY."

***structure for extracting information about email id's and corresponding BEx query variants

TYPES: BEGIN OF t_ae,

      id LIKE /bic/mzae_ib-/bic/zae_ib,

      variant LIKE /bic/mzae_ib-/bic/zpr_varnt,

      email LIKE /bic/mzae_ib-/bic/zdi_email,

      END OF t_ae.

**internal table for extracting information about email id's and corresponding BEx query variants

DATA: lt_ae TYPE TABLE OF t_ae,

     wa_ae TYPE t_ae.

FIELD-SYMBOLS:

<fs_ae> TYPE t_ae.

ASSIGN wa_ae TO <fs_ae>.

SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME TITLE text-t00.

SELECT-OPTIONS : s_vari FOR g_setting_id OBLIGATORY."rsrd_sett_node_a-setting_id OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b0.

****/bic/zae_ib is a infoobject storing ID's, emails & corresponding BEx query variants (can be created in RSRT)

SELECT /bic/zae_ib

      /bic/zpr_varnt

      /bic/zdi_email

FROM /bic/mzae_ib

INTO TABLE lt_ae.

****This loop will trigger email to each user one by one.

SELECT

FROM rsrd_sett_node_a INTO wa_rsrd_sett_node_a

WHERE setting_id = s_vari-low

AND id = 'PR_VARIANT'.

wa_rsrd_sett_node_a-value = <fs_ae>-variant.

MODIFY rsrd_sett_node_a FROM wa_rsrd_sett_node_a.

ENDSELECT.

SUBMIT rsrd_broadcast_starter WITH p_settng EQ s_vari-low WITH p_online EQ '' AND RETURN.

ENDLOOP.

****************************************

*************NoteJob scheduled with this code will be Query specific. We will need to copy code (and make some changes) to replicate the setup done in here for other queries

*changes ---> need to create another infoobject for maintaining another set of users, emails & corresponding BEx query variants (these infoobjects will be query specific, as they will be containing query speific Variants). Esle we can keep on adding attributes to one infoobject only for varaints specific to different queries and by adding one addditional flag attribute we can control the users to whom emails need to be triggerred with respect to query.