a month ago - last edited yesterday
The challenge is now over. See our wrap-up blog.
Always good to brush up on your OData access … I mean, we’re at SAP.
We started the challenge earlier this week with a preliminary task so you can have your SAP Build Apps set up. Now we'll start one challenge a week, on Wednesdays – today's about working with S/4HANA Cloud OData services.
The challenges so far:
Getting data from SAP backends is one of the key capabilities of SAP Build Apps, and one of the things you’ll want to make sure is second nature for you. To get SAP backend data into your app, you’ll need to know a few things.
Within the data variable there is a way to filter, sort, and paginate the data that you retrieve from the backend. For more on these tasks, you can see this blog.
In this challenge, you will get demo sales order data, filter/sort/paginate the data, and display the data in your app.
To do this task, you'll need an SAP Build Apps system and to import our skeleton app. To do all this, make sure you've done Task 0.
IMPORTANT: When you create your destination, the URL should be:
https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_SALES_ORDER_SRV
YOU'LL LIKE THIS: We have given you a file you can import to create the destination in a few seconds. You just have to add your API key.
IMPORTANT: In the data variable, you MUST implement sorting/filtering/paging as follows:
To make it look nice, I changed the width and height for the list item component, using the Custom setting and setting the width to 90%. I also changed the shape. You can adjust the UI as you like.
Take a screenshot, something like this (your values will differ and MUST reflect the filtering above).
Take note of the amount for the 10th entry – this is the value you must hash (remember, your values will be different than the one's above). The value should be with 2 decimal places, no commas and no currency sign, something like this: 123.99.
Your entry should look like this:
Open your app in the mobile preview and tap somewhere on the S/4HANA Sales Order page reveal a 30-second video about an event the SAP Developer Advocates put on around the world (a second tap will hide the video). Type the name of the event in your reply.
4 weeks ago
4 weeks ago - last edited 4 weeks ago
Thanks @Dan_Wroblewski on your response it helped in correcting binding data variable to UI properties data Item repeated I changed the formula to current. Fieldname from my entity.
I was getting error for video play " React Native WebView does not support this platform" but based on web view control and source . Video is about "SAP Build Code JAM"
2e152c6bc055dd88f5aa00d13850066fc0e0f5941be0bd5ae2b7335f4b93953a
3 weeks ago
Yes, I used a control for the video that only works on web. You can use the open URL flow function but that opens in a separate window, which I didn't want.
The hash is still not right and I can see that did not use your community ID, the one at the top left of your reply.
3 weeks ago
3 weeks ago
3 weeks ago
4 weeks ago
f42f7bf0da1b8075f12d33080066f949c3905d8e8b6dcbdedd18a922111d9888
4 weeks ago - last edited 4 weeks ago
4 weeks ago
2b7797c4dd515ee1b0b60d9bd16dd2ad95d79e5b994edc7227820ad9a88d4f5c
Event name - SAP BUILD code jam
4 weeks ago - last edited 4 weeks ago
My Hash: d0406d732ebbae415f65f81ff54ec2919120c421964b418752a935efb17f62e8
The Event: SAP Build CodeJam -> Thanks again for the one in Herne 👍
4 weeks ago
4 weeks ago
9775ef5f8c6b48a965d94da51f5ab951516bae81618441c88aca2cc05260bc44
SAP Build Codejam
3 weeks ago
Event Name - SAP BUILD Code Jam
Hash - 27f27ba7d5350591829a27c6840ad1c0d29267bfa885f28c19991445c94e81a9
3 weeks ago
3 weeks ago - last edited 3 weeks ago
3 weeks ago
Hello,
22e5c05ac3d808c72c7d7bfee03c82dc46abc025538e36f14af0ccaaa2b7ecb4
Event name - SAP Build CodeJam
3 weeks ago
bac98d16d7369a144418557af373fc9292312145cb509cae4272a6e1a3ce24b9
3 weeks ago
3 weeks ago
Thank you very much for your reply. As I am a very beginner with SAP Build Apps, I am having trouble getting the numbers displayed correctly. How do I make it so that the values are displayed with 2 numbers after the decimal point? Could you direct where I could find the answer? Thank you in advance!
3 weeks ago
Well, if you wanted to format a number, you would use the FORMAT_LOCALIZED_DECIMAL function: https://help.sap.com/docs/build-apps/references/format-localized-decimal?locale=en-US&q=reference
But ...
The data from the service should come back already formatted, for example, here is part of the JSON you get back when you make the API call:
"NetAmount":"1924500.00"
I'm not sure why you and some others show the values without decimals, since as you can see above the value is returned from the service as a string.
2 weeks ago
Hello @Dan_Wroblewski , I think that correct hash will be
6714aba6c73023dbb0729d971d806b487d2c81e87a7f0dd793239a8c4b4a8ca0
I have no idea why a number without two zeros after the decimal point is displayed, as I am not editing the data I received from the API in any way.
3 weeks ago
Hi Daniel
A couple of questions if I may.
Is there an easy way to go back to the main app page when you have navigated to another page in the SAP Build Apps viewer app?
Also, is it possible to set US10 as the default logon tenant, instead of remembering to set this each time?
Thanks
3 weeks ago
1. For navigating back probably we can just add a button to the current page and add previous page in the logic flow.
2. I don't think its possible to set US10 as default logon as of now but let's wait for Daniel.
3 weeks ago
Thanks, Rahul.
I found that the Navigation setting in the builder allowed me to enable a navigation menu, so I could add an option for the Home page.
3 weeks ago
@RAHUL1221 is correct. It would be nice to be able to store a setting for your landscape, but alas, not. I'm not part of development but I can provide them with your feedback.
3 weeks ago
f431594f24d736826fe3386477effe2ba33695fba50ca5ca234be02e4659d1ec
3 weeks ago
_________________________________________________________________________________
Part 1.
983737004fd5b2fdb263f68c3870f3e37c828f9c569ed3155b7e0a65c128225f
____________________________________________________________________________________
PART 2 - Event name - SAP BUILD CODE JAM
____________________________________________________________________________________
3 weeks ago
Unfortunately, the hash is not correct. I can see that the list does not contain the proper list ... you can see on other submissions the correct list. Double check that you are filtering and sorting properly. Let me know if you need any help.
2 weeks ago - last edited 2 weeks ago
Hey Dan,
By mistake i went till page 10. Correcting the hash again.
Only thing i am not getting the decimal places still and its showing data without decimal places is there any additional formula to be used.
______________________________________________________________________
PART 1 -
314e7e41ac8d38d0029b22f0c21026acfc714741475478d3498f75fb8a148fe4
____________________________________________________________________________
PART 2 - EVENT NAME - SAP BUILD CODE JAM.
____________________________________________________________________________
2 weeks ago
a week ago
Hey Dan,
I already Attached the correct hash along with considering .00 . Since it wasn't directly showing. also noticed few people also having same issue.
Please do let me know if its correct.
Thanks,
RAHUL1221
a week ago
Monday
Hey Dan,
I am hashing 747252.00
And adding the hash after correcting again pls do let me know if its correct.
Hash - c14a5abca0dc5253c3a3d570e0fbe2a7f375fd7592d1d668b588b89edc8d6653
Monday
Tuesday
3 weeks ago
3ccbb4b6c2b4c0424cd9c7f3693d3b53b7f7ad43a25c934049d00f09cee52fbb
Video is from SAP Build CodeJam
3 weeks ago
Good screenshot.
Unfortunately, the hash is not correct. I can see that you did not enter you community ID to do the hash. Your community ID is what is shown at the top left of your post: Anumala
Also you will have to hash the amount using 2 decimal places.
3 weeks ago
1. hash: bbfffe06c588db7eade7ae1cc6330489ef2b930b92155b16d6457ee929caf5e1
2. The event in video is : SAP Build CodeJam
3 weeks ago
cd0eea4b87081f5e99511abe4e5957ea3da6d65eb189a10b4e5da8dccdc6c30e
Event is SAP Build CodeJam
3 weeks ago
d357086ec1af433204195280a416621606642dbee5c71520f463240079e22e9a