2010 May 01 5:03 PM
Hi All,
I have to send and receive data from SAP to non-sap system - a middleware running on Java and can accept XML formats.
My question is: In case of inbound, I need to create few BAPI's to post data into SAP, and few BAPIs to extract data from SAP. I am little confused on how to go about it? I mean, what to use - SAP Business Connector or SAP Jco? Which one is best for both inbound and outbound? Since I want to communicate with non-sap system, what type of configuration I need to do on this system.
Any input will be highly appreciated.
Regards
JB
Hi All,
I have to send and receive data from SAP to non-sap system - a middleware running on Java and can accept XML formats.
My question is: In case of inbound, I need to create few BAPI's to post data into SAP, and few BAPIs to extract data from SAP. I am little confused on how to go about it? I mean, what to use - SAP Business Connector or SAP Jco? Which one is best for both inbound and outbound? Since I want to communicate with non-sap system, what type of configuration I need to do on this system.
Any input will be highly appreciated.
Regards
JB
2010 May 02 11:35 PM
Hi James Bond,
SAP Business Connector is a tool that you probably shouldn't use. Though SAP is supporting it (I think until 2012), it's a third party software (<em>webmethods</em>, now <em>software AG</em>) and was basically utilized and licensed by SAP because they didn't have their own web application stack. Thus for new developments the SAP Business Connector is questionable (since SAP's application servers are now "web-enabled")...
In general you have lots of choices, i.e. SAP offers [web services|http://help.sap.com/saphelp_NW04/helpdata/en/9b/dad1ae3908ee44a5caf57e10918be9/frameset.htm], use of simple style http protocol (e.g. REST, see for example [DJ Adam's blog entry on REST|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/17375] [original link is broken] [original link is broken] [original link is broken]😉 or the classic [RFC|http://help.sap.com/saphelp_nw04/helpdata/EN/6f/1bd5b6a85b11d6b28500508b5d5211/frameset.htm] protocol (e.g. using JCo or C/C++ API), etc.
Note that if your company has also a SAP Java stack installed, you have the choice on the SAP backend which one you utilize. In general though I suspect that you'll be looking for the ABAP stack, since Java and ABAP use separate database schemas (and thus if you'd want to access data from the ABAP stack, you'd still have to utilize RFC's or similar methods from the SAP Java stack to get to the data from the ABAP stack).
I suspect that you probably won't need any [BAPI|http://help.sap.com/saphelp_nw04/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm]'s and [RFC|http://help.sap.com/saphelp_nw04/helpdata/EN/6f/1bd5b6a85b11d6b28500508b5d5211/frameset.htm] functions are sufficient (. I'm personally not a big friend of web services with http&SOAP, but lots of people love it, because there's lots of tools available for handling them and most developers know how to deal with it. Usage of JCo is straightforward, just make sure to use a 3.x version instead of 2.x (incompatible API's, but much cleaner now and performance improved).
As far as choice for inbound/outbound communication is concerned, you can utilize all of them, but I'd make sure to utilize the same for both ways. In the end there's no clear recommendation possible which communication technology to use, because in the end it depends a lot on the skill set of the involved developers responsible for implementation and support...
Cheers, harald
2010 May 03 7:46 AM
Hi Harald,
Thank you very very much for your quick reply.
I am planning to use BAPI's to communicate with an external Java(middleware) system which already has JCO installed. I think the external system will use JCO and call SAP via RFC, Is that right? But how will SAP call this external system via JCO? I am little confused here. Also, do I still need to install JCO on SAP system?
Any document in this regard will be helpful
Thanks,
JB.
2010 May 03 8:48 AM
I think the external system will use JCO and call SAP via RFC, Is that right?
That is a possible solution and I think it's a good one (not as heavy weight as the web service SOAP stuff)...
But how will SAP call this external system via JCO?
So you have two scenarios: When the external system is calling SAP RFC's it's acting as an RFC client and when SAP calls the external system, the external system acts as an RFC server. With JCo you can implement a JCo server, which is essentially an RFC server. RFC server programs can be started/invoked per request, but the more common approach for regular calls is to register in SAP (on the SAP gateway to be more precise).
When your external program registers at the SAP gateway with a specific program ID it basically listens from then on to any calls made from SAP to that program ID. On ABAP side you invoke the RFC's on your JCo server program by calling the function with a given RFC destination that points to your registered program.
Also, do I still need to install JCO on SAP system?
No, because from SAP you're using the RFC protocol, which is already implemented in the ABAP stack.
Any document in this regard will be helpful.
I'd download the [JCo from SAP|https://service.sap.com/connectors|You need access to the SAP service market place] and check out the examples that come with it. This will be enough to get you started with the coding on Java/JCo side with RFC clients and RFC servers. If you are not familiar with the RFC details on SAP side, either check out the documentation I had listed above or talk to an experienced ABAP developer in your company.
Cheers, harald
2010 May 03 8:12 PM
Thanks Boeing. Your answer was really very helpful.
Few more questions: Say, If I have a BAPI in SAP system called ZBAPI_SALES_DATA. If I run this, how will the JCO understand & receive the data from this BAPI? Do I need to write anything on JCO side?
Also, I JCO calls a BAPI, do we need to do anything special? How will the error handling take plac both on SAP as well as JCO side ?
Appreciate your time.
Regards
JB
2010 May 03 11:25 PM
Say, If I have a BAPI in SAP system called ZBAPI_SALES_DATA. If I run this, how will the JCO understand & receive the data from this BAPI?
The JCo will receive the data via the RFC protocol. Usually the information about the function and used structures, the so-called meta data, is automatically retrieved from SAP, whenever a function is invoked. Alternatively you could hard code the meta data so that no additional RFC calls for retrieving meta data are required, but I'd avoid that, since the meta data is buffered in the repository (so after first lookup of all the metadata for a given RFC function, there is no need to query SAP again for getting the meta data).
Do I need to write anything on JCO side?
Good one. Obviously there's no magic tool yet that makes things just work without any effort...
Thus you'll have to code your required RFC client and server programs that you require. As I pointed out in my posting before, just check out the examples that come with JCo - it's all pretty straightforward.
How will the error handling take plac both on SAP as well as JCO side ?
Error handling is usually done by the RFC client. However, if you have such questions it means that you either need to talk to somebody who has experience with RFC in your company or you need to do some documentation reading. Your design has to take into account the specific requirements for your interface. E.g. you need to check where it's best to handle errors. E.g. let's take your external system as an RFC client, with a failed BAPI call. If most of the errors are actually problems that need fixing on backend side (e.g. master data or other problems) it might be better to use an asynchronous IDoc interface, where errors are fixed and handled on the backend. Then there's questions like if usage of tRFC or qRFC might be beneficial. In the end this is application design, which you'll have to handle...
2010 May 04 5:09 AM
Hi Boeing,
Thanks a bunch for your time in replying to my question. I got most of the stuff you explained. I have one more question: I am planning to use Srfc to connect from SAP to Java, and viceversa. I went through the JCO documentation available with JCO connector, most of the things look fine from JCO side. But, I am really not clear from ABAP side. The document doesnt specify how to connect to JCO from ABAP? If I write the BAPI(RFM) with import/export parameters in ABAP. how do I then connect and send data to JCO? Can you please give me a sample ABAP code on how to call JCO with paramters.
Thank you very much!!
Regards
JB
2010 May 04 6:31 AM
Check out the online documentation that I had given in my initial response. There you'll also find the subtopic of [calling RFC functions via ABAP|http://help.sap.com/saphelp_nw04/helpdata/EN/22/042537488911d189490000e829fbbd/frameset.htm] or alternatively read through the online [ABAP language documentation on RFC|http://help.sap.com/abapdocu_70/en/ABENRFC.htm].
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |