cancel
Showing results for 
Search instead for 
Did you mean: 

How should I expose BAPI_ALM_NOTIF_CREATE using oData and the gateway service builder?

derek_morin
Participant
0 Kudos

How should I expose BAPI_ALM_NOTIF_CREATE using oData and the gateway service builder?

If I import the RFC ( using RFC or BOR ) it creates a bunch of entities but then it expects keys for all of them.

Am I on the right track, do I just need to define key properties for these structures?

Is there an easy way to map the values passed in to make the call to the RFC?

Alternatively I could create my own RFC that calls BAPI_ALM_NOTIF_CREATE and just expose the parameters that I want to pass over, but that might be more work.

Accepted Solutions (0)

Answers (2)

Answers (2)

kammaje_cis
Active Contributor

Just a suggestion before you go the RFC way. Please go through the comments of the below blog.

https://blogs.sap.com/2014/06/04/how-to-design-rfcs-for-odata-service-generation/

Also this discussion.

https://archive.sap.com/discussions/thread/3432368

SimoneMilesi
Active Contributor

I suggest to stick with OData instead of going back to RFC (despite you need to work between 2 SAP Systems, but in this case you can avoid the wrapper Z) .

Am I on the right track, do I just need to define key properties for these structures?

Definitively yes, you are on the right track.

For my own choice i prefer to build my custom entity and mask the use of the BAPIs behind each single method, so i can choose better which field to expose/manage.

This because exposing entities with tons of fields could be a problem for the developers on the other side who needs to invoke the service.

derek_morin
Participant
0 Kudos

So I would just pick the properties I want to set, and then would I call the bapi from inside the gateway code ( e.g. in a redefined "update" method )? We typically have been creating Z_ function modules and then exposing those through the gateway.

SimoneMilesi
Active Contributor
0 Kudos

Yes, exactly.

To explain my point, i'll show you the service i just implemented in order to create/update/ delete a BOM.

i created 2 entity: BOMHeader and BOMItem, the properties you see duplicated are the "keys" to link them (BOM items got also Item as key property)

The operation availables are defined to with their own methods

Which i redefined

The "Create" methods are not redefined because via the Navigation Property i create both BOMHeader and BOMitem as deep entity (you can find tons of examples here on scn if you need them!).

In this way, i expose just the minimal information the service-consumer needs to pass me instead of having a bunch of fields meaningless.