Debugging a RFC call using JCo API


Most of the JCO classes like JCO.Function, JCO.Table, JCO.ParameterList, JCO.Record and JCO.Structure supports writeHTML(String) and writeXML(String) method.
writeHTML(String filename) -> method takes the file name as an input parameter and writes the dump of the corresponding object into a file in the form of HTML document.
writeXML(String filename) -> method takes the file name as an input parameter and writes the dump of the corresponding object into a file in the form of XML document.
This can serve as a very easy tracing mechanism while making a RFC call using JCo API to verify whether everything went as expected or not.
Java Code Snippet:
The following were the dump files created as a result of the code.
HTML Dump:
XML Dump:
Similar dump files can also be created for other JCO Objects like Table, ParameterList, Structure etc by calling their corresponding writeHTML(String) or writeXML(String) function.
Thanks for the information. This I have covered in my next weblog Debugging a RFC call using JCo API, Part-2.
Regards,
Tarun
Nice to see the blog.
I have one question here. I would appreciate if you answer my query. (since your area of intrest include opens source and ur blog is abt RFC Connection)
I would like to know, Is there a way by which i can connect to SAP r/3 (to bapi's rfc etc etc) by any open source standard means(not through any SAP propriety means bcos i dont want to spenf on anything more other than r/3 installation..) and get the data and show it to a user? Is there some way by the bapi's or rfc's can we made as web services etc?
Hope you understand my question?
Regards
Gaurav
starting with SAP Basis aka SAP Web AS 6.20 you can call all BAPI's and RFC Enabled Function Modules as a Web Service. So if you have SAP R/3 4.70 and higher just go on.
Regards
Gregor
Can you provide me with some more details as to how to achieve this?
How can i expose the rfc's as web services and then i hope it will be possible for me to access that web service through Java and show the data.
Regards
Gaurav Gandhi
To expose RFCs as web services, please check out http://help.sap.com/saphelp_nw04/helpdata/en/e5/a68d10f4eb894087fc9c1c3f9ae433/content.htm.
Regards
Shehryar
Thanx for the link.
Gaurav
Regards