cancel
Showing results for 
Search instead for 
Did you mean: 

Ways to build BAPI/RFC data packet at runtime

Former Member
0 Kudos

Hello,

In a traditional .NET based SAP client application, one simply generates the proxy code for the BAPIs in question. This works well for most scenarios as the BAPIs/RFCs to be called are known up front. However, for the application that I am working on, we do not know the RFCs/BAPIs that a customer has. I am looking at ways to invoke any arbitrary RFC in a generic way. I would appreciate it if you can share your ideas with me.

From the SAP interface repository, each BAPI is accompanied by a XML schema and template. I am wondering if I can use this to my advantage. Given an XML schema for a BAPI, I can create the needed XML data on the fly. The question is, is there some other RFC I can use to pass the name of the BAPI along with the XML data?

Thank you in advance for sharing your thoughts with me.

Pradeep

Accepted Solutions (0)

Answers (1)

Answers (1)

reiner_hille-doering
Active Contributor
0 Kudos

Sure, if you only needs to support SAP NetWeaver (or 6.20 based) systems, you can use pure XML techniques to build dynamic invoke. E.g. you can use the following strategy:

- Get WSDL or XML schema from NetWeaver server, your NetWeaver XI Repository or the generic ifr.sap.com

- Use Microsoft's WSDL or XSD classes to create a CodeDom of the file.

- Use VB or C# CodeDom provider to create a Proxy class in a temporary assembly.

- Reflect over the the temporary assembly and call the needed proxies.

You have to decide if this is the best strategy for you or if you prefer to use other NetWeaver technologies.