2023 Apr 24 1:40 PM - edited 2024 Jan 08 2:09 PM
This post is part of the SAP Build Community Challenge (April 2023)
We're going back to SAP Build Apps for this week's challenge.
Probably the most important thing you will do with one of your SAP Build app is to access SAP data, like in S/4HANA or SuccessFactors backends. And you will generally do this using an OData service. So we want to challenge you to use some of the OData features in the tool – for paging, filtering and sorting the data from OData calls.
In the challenge, you will start with an app we will give you, which fetches data from Northwind, and you will have to use the OData settings to bring back a specific subset of the data.
As a bonus, you will also learn about SAP Build Apps eventing, since the project we give you has eventing for retrieving the data.
Since we wanted the fetching of data to occur for a variety of events, we created our own event called GetData on the page’s logic canvas, and tied the fetching to that event. Then, the event could be called from any other logic canvas.
To learn more, see:
Out of the box if you run the app it will look like this:
The Previous and Next buttons will not work. You will have to implement them.
We have already given you a page variable page (Number) to keep track of the current page, and a data variable Customer1 to hold the data fetched from Northwind.
Paging |
|
Filtering |
|
Sorting |
|
Header |
|
It should look something like this (with your name, of course), but the records will be different. To accomplish the challenge, the correct records must be shown.
Good luck!
And feel free to Kudo this post and all the challenges.
Add in your post the name of the animated movie in which the song "Escape" (often known as the Pina Colada song) is played, and describe in 1 sentence the scene in which it appears.
Add the movie and scene description to your entry, and then go enjoy a Pina Colada (or your favorite drink).
2023 Apr 24 4:39 PM - edited 2023 Apr 25 7:16 AM
Thanks for another interesting challenge. This is done including disabling of the buttons
3rd Page
The logic for disabling the buttons is dynamic, based on total count.
Regards
2023 Apr 24 4:54 PM
2023 Apr 24 7:59 PM
H Dan,
Another good learning !! I was waiting from yesterday night for the 4th challenge.
Below is my output:
Appreciate your efforts
Thanks and Regards,
Aruljothi Arumugam
2023 Apr 25 11:15 AM
2023 Apr 24 8:16 PM
Hello,
Here is my fourth contribution.
Thanks for this week's challenge!!
Movie : Wanted 🤠
2023 Apr 25 11:14 AM
2023 Apr 24 9:27 PM
Hi Dan,
Here is my submission for week 4 challenge.
I am able to disable the Previous button. But to disable the Next button, I need to find another way as 'Get record collection' is not returning the count of the records from the OData call.
The Pina Colada song is from Guardians of the Galaxy where Star-lord plays it from his cassette player multiple times as I remember.
Regards,
Anupam
2023 Apr 25 11:10 AM
2023 Apr 25 5:44 PM
I think the same song was played again when he had some fight with Gamora.
2023 Apr 24 9:42 PM
Hello,
Here is my attempt :
As for the movie, i believe it to be ''Shrek'', the song plays whenLord Farquaad picks Princess Fiona from the Magic Mirror's dating game as part of his plan to marry her and become king.
2023 Apr 25 11:08 AM
2023 Apr 24 11:02 PM
Hello Dan,
Please find the screenshot below.
I think the song is from the movie Shrek.
Regards,
Indu
2023 Apr 25 2:46 AM - edited 2023 Apr 25 2:47 AM
2023 Apr 25 11:03 AM
2023 Apr 25 10:44 AM
2023 Apr 25 1:29 PM
Hi Dan,
Here is my submission for Week 4
Regards,
Sai Nithesh Gajula
2023 Apr 25 2:02 PM
2023 Apr 25 1:47 PM
2023 Apr 25 7:04 PM
2023 Apr 27 8:44 AM
2023 Apr 25 9:37 PM
My submission for week 4. I enjoyed this challenge as always.
2023 Apr 26 1:17 PM - edited 2023 Apr 26 1:35 PM
Hi @Dan_Wroblewski ,
I've added some aditional features to this App and I've obtained a weird behaviour you can see in the last seconds of the video. It is related to display one record in another screen. The first attemp didn´t display any value but in the second attemp everything was ok. i got this system behaviour many times.
Could be related to be querying to the OData service frequently?
Is there any way to extrtact a data subset from the current registers which are being displaying (i.e. Country) and fill a Dropdown list with the aim to filter for the value I could select?
I will appreciate your comments.
PAGE 3
VIDEO URL: https://youtu.be/KYF9soIhV-g
Thanks!
2023 Apr 27 8:23 AM
I'd have to see the entire logic flow. I see that you briefly get the data and it then disappears ... there must be some setting of the page parameter and a another retrieval of data that resets the data variable. Anyway, if you want to share the project I could check.
Thanks for participating 😺
2023 Apr 29 5:47 PM - edited 2023 Apr 30 8:31 AM
Hi @Dan_Wroblewski,
I've done some changes and the display data is shown correctl.
I think the issue was because I had a same logic implemented twice. The first one is a logic within Data Variable I've created in the 2nd page. And last one, was a logic associted to the TAP Event (on each list row) in the first page. I've deleted the Tap Event logic within 1rst page.
FIRST PAGE:
SECOND PAGE:
The only reason why the system is displaying this message content is because of the Page mounted event is triggered first and after that is triggered the logic within Data variable you can see next
LOGIC WITHIN DATA VARIBLES (2nd page)
CURRENT ISSUE
On the 2nd page is shown the Country field. I've saved the flag countries are displayed on the first page when ContactTitle = 'Owner'in local storage.
The aim is to display the flag on the 2nd page when is tapped one register. For this, I've created a formula "ag-asset://" + data.CustomerDetail.Country + ".png" to take the Country name register in the field CustomerDetail.Country adding the .png extension but nothing is displayed.
i've done a test using only one country flag, Venezuela flag, and of course it works but I don't understand why the name of file Venezuela.png is changed to this value: ag-asset://1d49d5bc-3ddf-4858-8d87-386250f868cc
Maybe I have to use a conversion function to changethe name of the file Venezuela.png to the code ID ag-asset://1d49d5bc-3ddf-4858-8d87-386250f868cc ?
|
2023 Apr 30 9:45 AM
You could of course save the GUID for each country and get the correct GUID for the current country.
@merituulimelkko Can you explain what is going on and suggest the proper solution?
2023 May 03 10:35 AM
So first of all it's natural at page mounted for the data to be empty as the data variable is gotten only after page mount. So any logic run should only be after the data variable is checked, either via looping and checking if the data variable is not empty anymore, or on the data canvas.
As for the image display, the ag-asset:// type of url is only for images uploaded to Build Apps. Ideally you should have the url of the image displayed in the data itself instead of needing to generate it, and I don't know how you would be able to come up with the url on the fly if you don't have it saved.
2023 Apr 27 1:08 AM
Hello Dan,
Here's my fourth week challenge submission. It's great to learn from this challenge series. Thank you!
2023 Apr 27 10:20 AM
Hi dan, thank you for this interesting challenge.
Below my screenshot
Regards
Dav
2023 Apr 27 2:28 PM
Hello again Dan!
Easy challenge for me this time. Thank you.
Bonus:
Lord Farquad, you have chosen... Princess Fiona.
2023 Apr 27 2:36 PM
2023 Apr 28 5:19 AM
2023 Apr 28 11:40 AM
The movie is Shrek. The Lord Farquaad has chosen Princess Fiona to be his queen.
2023 Apr 30 9:56 AM
2023 Apr 28 11:09 PM
Hi Dan,
challenge keeps getting better:)
Cheers,
Emanuel
2023 Apr 30 9:49 AM
2023 Apr 29 1:45 PM
Hi Dan,
thanks for another great challenge.
Patrik M.
2023 Apr 30 9:49 AM
2023 Apr 30 10:04 AM
hi Dan,
The challenge was quite interesting.
i tried and implemented the visibility logic for the previous button when it is in page 1 i made it to visible false.
page 3 screenshot.
Thanks and Regards,
Ranjith kumar M
2023 Apr 30 10:09 AM