- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Connecting SAP in Ruby on Rails
Try downloading nwrfcsdk library from sap and follow instructions mentioned in Readme to perform the installation. Use function Module like ENQUEUE_READ to perform remote call as below −
#!/usr/bin/env ruby require 'sapnwrfc' require 'rubygems' conn = SAPNW::Base.rfc_connect(:client => '800', :sysnr => '01', :lang => 'EN', :ashost => 'hostname', :passwd => 'pw', :trace => 0, :user => 'username') sm12 = Hash.new # lookup the dictionary definition of an Function Module fds = conn.discover("ENQUEUE_READ") # create an instance of a Function call func = fds.new_function_call func.GUNAME = "" func.invoke cnt = func.NUMBER if 1000 < cnt puts "more than 1000 entries" end conn.close
In case you are running JRuby, you can use SAP Java Connector to connect to RFC enabled BAPI’s and Function module. Note down following points about SAP Java Connector SAP JCo −
- SAP Java Connector is a middleware component that can be used for the development of SAP-compatible components and applications in Java. Using SAP JCo, you can set up bidirectional calls to SAP server.
- You can use SAP Java Connector to connect to desktop applications and with Web server applications.
- SAP JCo can be used with SAP Business Connector to communicate with external Java applications.
- You can also use SAP JCo to integrate Java EE server with the ABAP environment.
You can refer to below link regarding SAP JCo configuration −
Advertisements