Populate Yesterday’s Date in BEx Broadcaster – Mail body or Subject
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.
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
- There is the standard table where our body and subject are stored
Table name: RSRD_SETT_NODE_T
Provide technical name of setting to this table
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 sy–datum,
zdate type char10.
data: wa_RSRD_SETT_NODE_T type RSRD_SETT_NODE_T.
zdate_temp = sy–datum – 1.
write zdate_temp to zdate DD/MM/YYYY .
wa_RSRD_SETT_NODE_T–SETTING_ID = ‘ZDAILY_SALES’.
wa_RSRD_SETT_NODE_T–Id =‘DI_BODY’.
wa_RSRD_SETT_NODE_T–Id =‘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_T–VALUE SEPARATED BY space.
update RSRD_SETT_NODE_T set VALUE = wa_RSRD_SETT_NODE_T–VALUE
where SETTING_ID = ‘ZDAILY_SALES’
and Id = ‘DI_BODY’.
Concatenate ‘Daily sales Report As on’
Zdate into wa_RSRD_SETT_NODE_T–VALUE SEPARATED BY space.
update RSRD_SETT_NODE_T set VALUE = wa_RSRD_SETT_NODE_T–VALUE
where SETTING_ID = ‘ZDAILY_SALES’
and Id = ‘DI_SUBJECT’.
Then you can schedule this program and your broadcast setting with
following two methods.
- Schedule this program before your broadcast setting and then your broad cast setting
- 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.
After this when you are broadcast setting will executed you will receive mail like following screen.
In this way you can achieve yesterday’s date or similar kind of requirement.
Hopes it will help.
Good presentation and useful blog Ganesh. Thanks for sharing.
Thanks for your feedback 🙂 .
At last got it back right ?
Really very useful blog and good one too.
Thanks for sharing.
Regards,
Krishna Chaitanya.
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.
Hi Ganesh,
very good presentation and useful information...
Regards,
J.Sakthikumar
Thanks sakthi 🙂 .
It will help many , Good one.... 🙂
Regards
Shabnam
Thanks shabnam 🙂
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...
Thanks Vekat...try this if any queries please let me know 🙂 .
Regards,
Ganesh Bothe
Good.
Thanks Giri 🙂 .
Good and useful doc. 🙂
Thanks 🙂 .
Nice Document 🙂
Thanks Reddy 🙂 .
Good informative document.
Regards,
Utpal
Thanks for your nice comment 🙂 .
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
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
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
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
Super document, thanks a ton for sharing this wonderful stuff 🙂
Hi Das,
Thanks for your wonderful comments 🙂 .
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
Hi Anshu,
Your comments will really boost for me...thanks a lot for feedback 🙂 .
Regards,
Ganesh Bothe
Good work 🙂
Regards,
Ganesh
Thanks ganesh can you please rate this?
Regards,
Ganesh Bothe
My pleasure.
Hi Ganesh,
Thanks for wonderful rating 🙂 ..I am happy,you liked this blog 🙂 🙂 .
Useful Information Ganesh, Keep up.
Hi Suresh,
Thanks for your feedback 🙂 .
its very good doc Ganesh,,keept it up.. 🙂 🙂
Regards
Wasem
Hi Waseem,
Thanks for your feedback 🙂 .
Regards,
Ganesh Bothe
Gr8 Document with useful information ... Thanks for your effort ...
Bookmarked n rated ...
KP
Hi KP,
Thanks for rating and nice feedback 🙂 .
Nice one Ganesh, your efforts are appreciated !
Thanks for sharing !
Hi Limbadri,
Thanks for your appreciation 🙂 .
Nice document Ganesh.
Thanks,
Phani.
Thanks pani for your feedback 🙂 .
Good blog Ganesh.Thanks for sharing.
Thanks sakthi 🙂 .
Hi Ganesh,
Nice doc thanks for sharing it to enhance our knowledge. 🙂
Regards,
Lalit
Thanks lalit for your feedback 🙂 .
Hi Ganesh,
Nice doc thanks for sharing. 🙂
Regards,
Adhik
Thanks a lot for your feedback
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
Hi Nitesh,
Thanks for your wonderful rating and feedback 🙂 .
Regards,
Ganesh Bothe
Hi Ganesh,
Very useful blog, was searching for table with broadcast email subject and finally found it in your blog.
Thanks,
Rk
Thanks ramakrishana..I am happy that it helps you!!!!
Exceptional ganesh... 🙂
Regards,
Harish
Thanks for your wonderful comment!!!
Wonderful document Ganesh..Keep it up 🙂 .
Thanks!
Very good document. Please keep posting such minute things when you come across. Helpful !!!
Thanks for your feedback...it will boost for me 🙂 .
Very useful document. Keep it up...
Thanks Ashish for feedback..if possible rate this doc 🙂 .
Great!, very good effort Ganesh. Thanks for share.
Thanks for wonderful comment 🙂 .
Useful Info Ganesh..
Thanks Jitendra 🙂 .
Useful Information, thank you vermuch.
Regards
Martin