Skip to Content
0

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

Jan 12, 2017 at 12:07 PM

136

avatar image

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.

errors.png (8.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Simone Milesi Jan 12, 2017 at 12:31 PM
1

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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.

0

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.

1.png (10.1 kB)
2.png (19.6 kB)
3.png (6.5 kB)
0
Krishna Kishor Kammaje
Jan 17, 2017 at 05:42 AM
1

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

Share
10 |10000 characters needed characters left characters exceeded