How to show First and Latest Record at BEx Level
Introduction:
Lately i came across so many threads where the requirement was to show the first or latest record at bex level.I tried to replicate the same scenario in my system.Here i will be showing the sales of a particular plant on first and last day of particular month.
Data Sheet:
Data Loaded in DSO:
Query Format :
Here we have Converted the Characteristic 0calday into Keyfigure (Date KF) with the help of formula variable with replacement path.
Make sure to choose Unit/Dimension as Number.I am not giving a walkthrough on the steps of the same as it has been discussed so many times.
Refer the below document for step by step navigation:
Convert a Characteristic into a Key Figure (BEx)
Approach to show the First Record:
Step 1–Hit the condition tab at BEx query designer–Right click on empty space–New condition–Edit
Step 2–Hit the New tab—Keyfigures–Date KF–Operator–Bottom N–Values = 1.Then Hit the Transfer tab.Refer the below screenshot.
Step 3–Hit the Characteristic Assignment Tab..Choose the options as per the screenshot below.
Step 4–Save the condition and Query.
Query Output: To show first Record
Approach to show the Latest Record:
All the steps to get the latest record will be same except with the slight change in conditions tab.
Instead of Operator Bottom N we will choose Top N.Refer the below screenshot.
Query Output:To show Latest Record
Conclusion:It’s apparent that after following the above approach we got the desired result as per our data stored in DSO.
Hope this helps.All suggestions and comments are welcome.
Nice efforts Anshu 🙂 . It seems you have observed yesterday's post. Appreciate your step by step approach..
Thanks Suman.I was planning to share this approach since few days and recently i saw so many posts on the same so it was high time to replicate the scenario and give a write up.
Regards,
AL
This can avoid exception aggregation, right?
Good content and neat explanation. Thanks for your ideas and efforts.
Thanks raman for your valuable feedback..Much appreciated.
Regards,
AL
USeful INFO
Thanks Giri..for your feedback.
I guess your reply got posted multiple times.Yes Exception aggregation is not required and in case where you need the output like this then Exception aggregation is not going to help.
It may show the last and first record in result but if you drill down on calday as i have kept then it will show all the records.
Regards,
AL
You can post this to Nidhi's question.
Nice work around anshu.. keep it up..kepp exploring bex and share us..
Thanks again for your comments..Yes sure will keep sharing.. 🙂
Regards,
AL
Nice Idea indeed. 😉
Regards,
AL
Hello Anhu
Thanks for blog. It is knowledgeable for those who haven't work yet BEX and ofcourse for the new SCN users. keep it up a.d thanks or sharing!
Arshiyan
Thanks Arshiyan..really appreciate your feedback.
Regards,
AL
Thanks for sharing anshu.......NIce blog and very helpful...... 🙂
Regards,
SM
Thanks Satendra for your feedback.Really appreciate.
Regards,
AL
Nice documentation Anshu; It will be helpful to fufill business requirements.
If possible, you just include a link you have for 'Converted the Characteristic 0calday into Keyfigure', So that your blog itself entire solution for this type of requirement.
Your knowledge share is the solution for many SAP people. Continue the spirit 🙂 .
Thanks Sunny for your valuable feedback..Glad to receive such great response from you guys.. 🙂
As you requested to add the link so will do that shortly.
Regards,
AL
Sunny..Link has been updated..
wow...Thanks. When one person asked about some sample code, you are checking in your system regarding its working nature and providing it. That much responsibility will give response right. Its your content share response 😎 .
Yes Sunny,if time permits then i try to test it on my system as it gives me the clarity of the scenario and i understand the person who posts ABAP queries is novice so its better if i post the complete code with proper explanation.
Regards,
AL
Nice Presentation Anshu..Keep Posting ..Good Work.
Thanks Naveen for your feedback..Yes will come up with more interesting scenarios soon
Regards,
AL
Really nice way of tackling this requirement.
Regards,
Ashutosh
Thanks Ashutosh for your valuable feedback..Much appreciated.
Regards,
AL
Thanks for sharing
Regards,
arvind
Thanks Arvind for your feedback..Much Appreciated.
Regards,
AL
Nice workaround Anshu. Great job keep it up and keep going. I think it will be helpful for yesterdays post.
Cheers 🙂 🙂 🙂 🙂 🙂
Krishna Chaitanya.
Thanks Krishna for your feedback and your smileys usually makes me more than happy. 🙂
Regards,
AL
NIce one Anshu! i am sure this info will come in handy someday.
It shows the level of effort you take to find the solution:)
Regards,
Benedict
Thanks Benedict..For your cheerful comments..I just try to share across my knowledge with you guys.
Regards,
AL
Nice effort n detailed explanation... Good job.
Bookmarked and rated the blog... Thanks for sharing..
Regards
KP
Thanks KP for your feedback..Nevertheless thanks for rating it as well. 🙂
Regards.
AL
Good One, Anshu...
BR
Prabhith
Thanks Prabhith for your valuable feedback.
Regards,
AL
Nice Document.
Regards,
Sushant
Thanks Sushant for your valuable feedback..Really appreciate your comments. 🙂
very helpful and valuable information, Anshu 🙂 thanks a lot
best regards,
Sherif
Thanks Sherif for your feedback..
Regards,
AL
One more nice document released from anshu's hand ! 🙂
Thanks for sharing Anshu.
Regards,
Venu
Thanks for your kind words and appreciation Venu.. 🙂
My pleasure.
Regards,
AL
Thanks for sharing this with us
regards
Sandeep
Thanks for the feedback sandeep.
Regards,
AL
Hi Anshu,
Your ways mostly give "Business Oriented solutions" instead a technical solution which a true consulting..instead of being just developer!!!
Cheers
Hi Kaur,
Really pleased with your feedback..I always try to replicate the scenario which people post in forums and if i get some concrete solution then give it a write up.It makes sense to me.
Regards,
AL
Nice creativity Anshu. 🙂
I'd like to discuss one senario related to this .
Support we have three prodcuts A,B,C.
Someone purchased A on 13th ,B on 14th ,C on 16th then A on 17th date.
So if we run the report the latest transaction should come as 17th date.
how we can implement this logic in reporting level?
Can we implement the same logic for this senario ? Need your suggestion.
Regards,
B Devi
Thanks Devi for your feedback..
Coming to your question yes it should work and show you the latest record only if you follow the document.
In case any particular issue then please raise the question in forum people might come up with their ideas.
Regards,
AL
Hi Anshu,
Nice document. Appreciate your effort.
Thanks
BR
Aakash G
Thanks Akash for your feeback.
Regards,
AL
Hi Anshu,
Good Information and nice presentation 🙂
Regards,
Ganesh Bothe
Thanks Ganesh for your feedback.
Regards,
AL
Thank you Anshu! Very good explanation and pretty clear.
Thanks Venkateswaralu for your feedback.
Regards,
AL
Hi Anshu,
Now, I have a same kind of user req but not exactly the same. I have to show 1st GRN date of an article/material. Here, we are getting the Goods receipt qty as key figure and movement type as character. Based on this KF & CHAR combination we are calculating GRN quantity. Could you please advise how to calculate 1st GRN date of an article/material at BEx level. Your assistance is highly appreciable and obviously, helpful a lot. Thank you in advance!.
Best Regards
Venkat...
I would appreciate if you can open this query as a new discussion so that others also can give some inputs on the same.
You have not mentioned anything about GRN date which should be the basis of your whole calculation.
Regards,
AL
Ok, thank you. I will open a new discussion on this.
Regards
Venkat...
Nice presentation, appreciate your efforst.. 🙂
Thanks for sharing.. 🙂 🙂
Thanks Prerna..Appreciate your feedback.
Regards,
AL
Good work...nice demo..:)
Thanks Naveen..
Regards,
AL
Hi Anshu,
Thank you for taking the time, for sharing your experience in BEx.
and Clarify:
Mentioned Kayfigure –Sales in Step 2, Keyfigure -Date KF in screenshot ?
Hi Sudarshan,
Thanks for the feedback.It is type error,this should be date not sales.I will amend the blog.
Great that you noticed that.
Regards,
AL
HI Anshu,
Good explanation ..Nice Workaround !!
rgds
SVU123
Thanks SUV123 appreciate your feedback.
Regards,
AL
Anshu is Rocking.... Well done sirji...
Thanks a lot Vijay for your rocking feedback..Much appreciated.
Regards,
AL
Again a valuable edition in Bex part. This will be a valuable addition to my knowledge in Bex. Thanks for sharing.
KR,
Manna Das
Thanks Manna for your feedback..I am glad that my blogs are source of knowledge to others.
Regards,
AL
Good point and clearly presented ! This is very helpful... thanks for sharing Anshu !
Regards,
Siva
Thanks Saravana Siva for your feedback.
Regards,
AL
Hi Anshu,
Nice documentation, It will be helpful to fufill business requirements.
Thanks,
Chandresh Patel
Good to know that..Thanks for your comments.
Regards,
AL
Very helpful.
I am glad that this blog is helpful for you. 🙂
Regards,
AL
Handy information.
Thanks for your feedback Giri.
Regards,
AL
Hello Anshu,
Good to know the trick you applied, on date to get latest and first.
Easy method to solve complex issue 😎
Thanks for sharing!
LS
Thanks Limbadri for spending time in reading my blog.Glad that you liked it as well.
Regards,
AL
Nice Document Anshu. Thanks for sharing.
Hoping more & more such scenario-oriented documents from you.
-- KRPK
Thanks Pawan.I am glad that you liked it.Yes will try to post some more useful document.
Regards,
AL
Like this trick .Happy to read 🙂 .
Good to know that..Thanks for the feedback.
Regards,
AL
Hi Anshul,
If in characteristic assignment i choose "All characteristics in the drilldown independently" then the condition will work for all the characteristics . Does that mean i have to convert all the characteristics into key figure?
Anshul,
Thanks for sharing this Document it is easy to recollect and Execute.
Regards
PB
Really great !!! Thanks for sharing Hidden tricks.
Hi Anshul,i very urgent requirement:
Data:
In Formula1 column was expecting Latest record, but followed everything in the document.
Please help to fetch correct information
looking for first and last records(based on 0calday) in two columns as Formulas or cfks
Nicely explained. Useful info.