cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing data from the ODATA association using BTP destination integration

chandan3009
Explorer
0 Kudos

Hello all,

I am using SAP BTP destination services for setting up the ODATA integration with SAP C4C. While doing this, I do see an option to expand(include) the associations in the integration (as can be seen in below screenshot)

In above screenshot, we can see BTP destination integration do give option to enable the association for integration, however I cannot access these association while actual binding to the UI components as it was possible with the traditional AppGyver ODATA integration.

Can someone shed some light on how could I access the association data (like Activity Text or Activity Party from above example) through the Enabled ODATA collection (here ActivityCollection)?

BR, Chandan

View Entire Topic
Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

You can start with the Object with properties UI for the Record, like here in my example:

But then instead say you want a formula, like here:

It's the same thing except as a formula ... then you can add to it all the fields you want.

I will do an example with Business Partners and post it as soon as possible (unless Marc beats me to it 🙂

chandan3009
Explorer
0 Kudos

Hello Daniel/Marc,

It is really nice to see getting replies but I am not able to access the association data using formula. Following the suggestion from Marc, I am getting 'No Suggestion' error while adding the formula (ActivityText and ActivityParty are the associations to ActivityCollection in C4C ODATA)

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

1) Formulas will give errors because they are not aware of the field, but you can still save the formula. Though there is an underlying schema understood by SAP Build Apps, the value is just a JSON object and you can set it to anything (pretty much). If you never provide a field in the current list of objects called ActivityText, yes, it will fail, but the formula editor has no idea what will be and so gives an error.

2) See my blog post today – inspired by your questions 😺 It goes against S/4HANA but I assume its all OData services in the end. I hope you have a service called ActivityText from which we can get the schema -- you don;t need to call, just makes life easier to get the schema -- https://blogs.sap.com/2023/06/11/your-guide-to-calling-s-4hana-apis-from-sap-build-apps/

chandan3009
Explorer
0 Kudos

Hello Daniel,

Your new blog is very helpful, gave me some other direction to fetch the data.

I didn't stopped seeing the No suggestion formula error but also tried by applying these formulas, but couldn't fetch the required data.

One thing that is making things different for me as compared to your blog is that, in my case; I have multiple records in the association. I have ticket display page which would show the selected ticket details. I am unable to show the ticket's past conversations. Below screenshot shows the relationships between various ODATA services (in blue), I am using to display the data:

I wish to use the data from MemoActivityTextCollection and MemoActivityPartyCollection to show the past conversation maintained on ticket in C4C

MemoActivityBusinessTransactionDocumentReferenceCollection provides me 3 memo activities linked to sample ticket, for which I need to fetch corresponding 3 PartyName and 3 Texts from MemoActivityPartyCollection and MemoActivityTextCollection respectively.