cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Build Apps navigation with date as key

rcaziraghi
Participant
0 Kudos
347

Hello all!

I'm developing a Build Apps application with an ABAP environment backend. The ABAP environment is on SAP BTP, and serves an endpoint with the "equipment" API implementation. I've imported this API via destinations and created an "Data Integration":
Data Integration.png

This specific API has a date "ValidityEndDate" key property. In the app I'm developing there's a list of equipments and, if you select one, you should navigate to an object page. 

list page.png


object page.png

The issue I'm having is that the request has the date malformed, causing an URI invalid error. I've tried to change the internal structures to different text, date or date/time formats, with no avail. 
invalid URI ed.pngcorrect URI ed.png

Do anyone have an idea on what I could do different here? Is there any transformation I could do to this element?

Thank you very much for your reply!

BS,
Rafael

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
ARe you saying you need convert from 10003677 to date or vice versa, or some other conversion?
rcaziraghi
Participant
0 Kudos

Hello @Dan_Wroblewski !

I would actually like to not change anything (keep the Data Integration as is) and navigate. I've tried to change the type of the properties, but then I have incompatibility issues (I have to convert and then back).

Is there a way to do that?

Thank you!

Best regards,
Rafael

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
Sorry, I just don;t understand which request is not working or which URI needs to change. You are navigating to an SAP Build Apps page and all is fine. Then you showed what appears to be an OData URL in the browser but not clear what one has to do with the other or what is not working. Sorry I'm not getting it 😕
rcaziraghi
Participant
0 Kudos

Hello,

Sorry, I didn't explain myself well. I have this app, with a list page and a object page. The list page is listing equipments, that have a "equipment" and "ValidityEndDate" key properties. In order to navigate to the object, I have to pass these two keys to the backend service. No issues with "equipment", but I for "ValidityEndDate" I can't just map the property on the selected node of the list page to the object page.

rcaziraghi_1-1722867708959.png

If I do so, I get the following error in the network tab (nothing on screen):

\"message\":{\"lang\":\"en\",\"value\":\"Invalid URI segment\"}

The payload to that request is the second to last image I've posted above. However, if I change the value to hard code like this:

rcaziraghi_0-1722867601411.png

It works (the payload is the one from last image in the original post).

Please let me know if you need any additional information.

Thank you.

Rafael

View Entire Topic
Dan_Wroblewski
Developer Advocate
Developer Advocate

Seems you have to convert the date to the standard format, from the Unix (OData) date.

FORMAT_DATETIME_LOCAL(DATETIME(NUMBER(SUBSTRING(repeated.current.CreationDate, 6,19))), "DD.MM.YYYY")  
rcaziraghi
Participant
0 Kudos

Hello!

I had to adjust the formula a little bit, but that works!

SUBSTRING(DATETIME(NUMBER(SUBSTRING(repeated.current.validity_end_date, 6,19))), 0,19)

Thank you @Dan_Wroblewski !

BS,
Rafael