Skip to Content

Requirement:Communicate to the user about Report is generated on 02.12.2013 i.e. yesterday

In Mail User want to send

Hi

Kindly find attached herewith Sales report as on 02.12.2013.

Regards,Ganesh Bothe

When you are creating broadcast setting you can find only following text variable.

/wp-content/uploads/2013/12/bd01_335440.jpg

Using above text variable it is not possible to calculate yesterday’s date and we do not want to send mail like

Hi,Kindly find attached herewith Sales report as on Yesterday.

Regards,Ganesh Bothe.

One thing that where this text variable are stored that also I think not possible to find out.

For same requirement I have published blog on 26.11.2013.In my broadcast setting I am sending report in MHTML format and it will come in Mail body as per requirement using customer exit variable πŸ™‚ .

One of SCN member followed using my blog but he is sending report title in subject line and he faced problem regarding dynamic date. After his comment on my blog I analyze the issue and then come to know For my case it is executing BI report means it will execute customer exit code also but in the case of SCn member it just showing name of report means ‘Daily Sales report &xyz&” πŸ™ That means not fulfill the requirement.

So yesterday I have deleted my blog and tried for correct workaround. I searched on Scn, so many people having the same requirement there is no proper solution present. I tried following things and it works hope it will help you who were having similar requirement.

Here are the Steps to achieve this

  1. There is the standard table where our body and subject are stored

/wp-content/uploads/2013/12/bd1_335498.jpg

Table name: RSRD_SETT_NODE_T

Provide technical name of setting to this table

/wp-content/uploads/2013/12/bd2_335499.jpg

2.In your BI system we need to create one ABAP program

Tcode SE38 create program ZBROADCAST_SETTING

Copy following code

REPORT ZBROADCAST_SETTING.
data : zdate_temp type sydatum,

       zdate type char10.
data: wa_RSRD_SETT_NODE_T type RSRD_SETT_NODE_T.

zdate_temp = sydatum 1.

write zdate_temp to zdate DD/MM/YYYY .

wa_RSRD_SETT_NODE_TSETTING_ID = ‘ZDAILY_SALES’.

wa_RSRD_SETT_NODE_TId =‘DI_BODY’.

wa_RSRD_SETT_NODE_TId =‘DI_SUBJECT’.
*wa_RSRD_SETT_NODE_T-OBJVERS = ‘A’.
*wa_RSRD_SETT_NODE_T-LANGU = ‘E’.

concatenate ‘Hi,Kindly find attached herewith Daily sales Report as on’

            zdate

            ‘Regards,Ganesh Bothe’ into wa_RSRD_SETT_NODE_TVALUE  SEPARATED BY space.
update RSRD_SETT_NODE_T set VALUE = wa_RSRD_SETT_NODE_TVALUE

                        where SETTING_ID = ‘ZDAILY_SALES’

                         and  Id = ‘DI_BODY’.
Concatenate ‘Daily sales Report As on’

             Zdate into wa_RSRD_SETT_NODE_TVALUE  SEPARATED BY space.

update RSRD_SETT_NODE_T set VALUE = wa_RSRD_SETT_NODE_TVALUE

                        where SETTING_ID = ‘ZDAILY_SALES’

   and  Id = ‘DI_SUBJECT’.

Then you can schedule this program and your broadcast setting with
following two methods.

  1. Schedule this program before your broadcast setting and then your broad cast setting
  2. Create process chain add two abap program steps one is for above program and second is for your
    broadcast setting(RSRD_BROADCAST_STARTER)create variant for this program with tech name of your broadcast setting.

Sometimes Second option will not work for some user means they will not got any mail after successful execution of process chain also. If that is the case please check SOST tcode.

Select your document and click on send request->start send process for selection. It will send the mail.

Newly created program will modify the body and subject for particular setting as per our requirement.

/wp-content/uploads/2013/12/bd3_335502.jpg

After this when you are broadcast setting will executed you will receive mail like following screen.

/wp-content/uploads/2013/12/bd4_335503.jpg

In this way you can achieve yesterday’s date or similar kind of requirement.

Hopes it will help.

To report this post you need to login first.

62 Comments

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

    1. Ganesh Bothe Post author

      Hi krishna,

      Really atlast….because I tried a lot to find out where this text variables are stored but anyway I find table where we can modify to achieve this specific requirement..most users want this type of dyanamic values..so this will help for such requirement.

      (0) 
  1. Venkateswarlu Ravula

    Thank you so much for drafted this blog again.

    I have faced this issue before for that date format. Now, will apply your logic and try to resolve this issue. Highly appreciated your efforts.

    Best Regards

    Venkat…

    (0) 
  2. sri m

    Hi Ganesh

    our users don’t want to receive broadcasting email when report out is empty. Ie when no applicable data for that user

    how to stop them in broadcasting batch rsrd-broadcast-batch program

    (0) 
    1. Ganesh Bothe Post author

      Hi Sri,,

      I think report should go with no applicable data then only user will understand for that day value is zero.

      Anyway If you want to achieve this …currently I am not having the solution but I would suggest you can do it some research..

      1)If you are using query in broadcast setting first need to find out FM which will give you query result.

      Check this FM RRW3_GET_QUERY_VIEW_DATA.using this you will check wheather your report is having data or not If yes then trigger broadcast setting else do not trigger.

      In this way you can achieve your requirement.

      Hope it will help you.

      Regards,

      Ganesh Bothe

      (0) 
      1. sri m

        Hi we have written program using Function Module  RS_VC_GET_QUERY_VIEW_DATA_FLAT to execute a query. And calling fm broacst starter but here we are not able to pass userid and user variant. Any help is appreciated

        (0) 
        1. Ganesh Bothe Post author

          Hi sri,

          Can you check on google there is one PDF present which will tell you how execute query using Fm search with “abap code – to fetch sap bi query data” Try this it will return query data if data not present then do not execute broadcast setting.Please check and let me know.

          Regards,

          Ganesh Bothe

          (0) 
  3. Anshu Lilhori

    I appreciate the research you did and came up with a 100% workable solution in this blog.

    This shows the dedication of yours towards the subject.

    Great job indeed.

    Regards,

    AL

    (0) 
  4. Nitesh Kumar

    Hi Ganesh,

    It’s so useful blog. I guess, many of us might be asked such requirement and it’s a complete solution.

    Great job. Keep it up πŸ™‚ .

    Regards,

    Nitesh

    (0) 

Leave a Reply