1

I'm trying to create a c# that application does a simple insert into a newly created sap table.

After a little bit of research I found out that I have two options:

  • Using a CDS-View with @OData.publish: true and CRUD operations
  • or using a bapi with the SAP .NET Connector 3.0.

Personally I think that the CDS view is much cleaner but I'm not getting the "create" operation to work. I found out that the cud operations are disabled on ABAP 7.50.

What do you think?

Thanks, Thomas

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Tommehh
  • 872
  • 1
  • 17
  • 44
  • 1
    If CDS view CUD operations don't work for you, how about creating a small SAP Gateway OData Service for this purpose? So you can change to CDS view based CUD operations later without changing the client. – Manfred Scheiner Jun 14 '18 at 17:39
  • I see your point. But do I have to implement the $filter options and so on all by myself? It's included on CDS views. – Tommehh Jun 19 '18 at 12:19
  • 1
    You're right, that would need extra development. My idea was to use the CDS view based OData service for READ operations and the self developed OData service only for CUD operations. A little ugly but the fastest way in development, when the CUD operations don't work for the CDS view generated OData service. – Manfred Scheiner Jun 19 '18 at 14:00
  • Ok thank you. That's the way I did it. It's a pity that there is no way to automate read options in a self-developed gateway service. – Tommehh Jun 19 '18 at 14:44

1 Answers1

1

There are more options. Use transaction SICF to create a REST endpoint. POST it data in JSON format. Use the ID XML transformation to map the data to an internal table with the same format as the database table in question. Use MODIFY or INSERT followed by COMMIT WORK to save the data.

Florian
  • 4,821
  • 2
  • 19
  • 44