cancel
Showing results for 
Search instead for 
Did you mean: 

RAP: Key As Segment capability support

geert-janklaps
Active Contributor

Hi,

When using CAP to create odata services, the odata capability KeyAsSegment is available to follow the openapi specification.

Is this functionality available when using RAP as a framework as well? How can this be activated?

Best regards,

Geert-Jan

Accepted Solutions (1)

Accepted Solutions (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert

It works in RAP out of the box if you use a V4 service binding. ( and any OData V4 service based on the SAP Gateway framework provided you use the latest SP level of SAP_GWFND )

You can try it out with the V4 travel sample service.

https://<yourserverver.com>/sap/opu/odata4/dmo/ui_travel_proc_m_o4/srvd/dmo/ui_travel_processor_m/00...;

gives the following response:

{@odata.context: "../$metadata#Booking/$entity"

@odata.metadataEtag: "W/"20220330114430""

@odata.etag: "W/"SADL-202111191948080000000C~20211119194808.0000000""

TravelID: "1"

BookingID: "2"

BookingDate: "2021-12-02"

CustomerID: "660"

CustomerName: "Sisko"

CarrierID: "UA"

CarrierName: "United Airlines, Inc."

ConnectionID: "1537"

FlightDate: "2021-12-04"

FlightPrice: 438

CurrencyCode: "USD"

BookingStatus: "N"

BookingStatusText: "New"

LastChangedAt: "2021-11-19T19:48:08Z"

- __CreateByAssociationControl: {

}

- __EntityControl: {

}

}

geert-janklaps
Active Contributor

Hi Andre,

Thanks for the feedback! Couldn't try it myself until now (didn't have access to the system for which I was doing the research).

The key-as-segment functionality does seem to work, but the capability is not present in entity container of the OData metadata.

Which means that external programs don't pick-up the capability. E.g. converting the OData metadata to to OpenAPI specifications without the capability present now doesn't pick up the ability to use the key-as-segment functionality.

When I manually add this capability like this:

The capability is picked up by the OASIS OData to OpenAPI specification converter.

Do you have the same missing capability in your metadata? If so, this seems like a bug to me. (I'm using a S/4HANA On-prem 2021 FPS 01)

Regards,

Geert-Jan

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Jan-Geert,

thank you for this detailed feedback. I will check with the product owner if something and if yes, when something can be done here.

Kind regards,

Andre

geert-janklaps
Active Contributor
0 Kudos

Hi Andre,

Thanks for addressing this with product owner! Hope this is something that can be solved.

Any chance you can address following metadata documentation issue with them as well? Seems to be an issue / missing functionality in OData V4 compared to OData V2 in all releases I've tested. (S/4HANA 2020 FPS00 & S/4HANA 2021 FPS01).

Best regards,

Geert-Jan

Answers (1)

Answers (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos