GithubHelp home page GithubHelp logo

jaykilleen / sap_niwaki Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 19 KB

SAP is a messy garden with layers of weeds. To prune it into a beautiful niwaki tree you're going to need a niwaki ladder.

License: MIT License

Ruby 98.15% Shell 1.85%

sap_niwaki's Introduction

SAP Niwaki

🌳

SAP Niwaki is a Domain Specific Language (DSL) for interacting with SAP GUI Scripting using the Ruby Programming Language.

Originally inspired by How to use SAP GUI Scripting inside Ruby Programming Language by Stefan Schnell I built my own Ruby program to automate the upload of master data for SAP S4/HANA. These scripts eventually continued to be used by the business for far longer than they should have.

This Ruby DSL for SAP GUI Scripting allows you to to write automation scripts that are very easy to read and write. SAP Niwaki removes a lot of the need for having to run recorders and inspectors to identify field names and buttons to click.

That is the dream at least :hurtrealbad:

if nav.is_on_the_wrong_tcode?
  nav.okgo 'VA01'
  nav.enter "order_type", 'OR'
  nav.press_btn 'Continue'
end
nav.insert "sales_order", "sold_to_party", "10000001"
nav.insert "sales_order", "ship_to_party", "10000001"
nav.insert "sales_order", "material_id",   "40000001"
nav.insert "sales_order", "quantity",       "1"
nav.insert "sales_order", "quantity_unit",  "PC"
nav.press_btn 'Save'

Installation

Add this line to your application's Gemfile:

gem 'sap_niwaki'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sap_niwaki

NOTE: sap_niwaki requires SAP Logon 750 / SAP Logon for Windows version 7500.2.9.1152 installed on the Windows machine that is running the sap_niwaki ruby scripts.

It is possible that this works on other versions but I am scracthing my own itch here and currently have only tested this with the version of SAP Logon for Windows that I have available on my machine. I have not tested this using Ruby running on the Windows Subsystem for Linux (WSL) or WSL2. I guess it would not work so I am sticking with a Ruby installation on windows to develop and run these scripts.

Usage

After including sap_niwaki in your example_file_name.rb file like:

require "sap_niwaki"

You can then initialize a session by connecting via the SAP Logon for Windows and start sending navigation commands.

require "sap_niwaki"

# Initialize an SAP GUI object that represents the SAP Logon for Windows program
gui = SapNiwaki::Gui.new

# Set a navigator for SAP GUI by passing the SAP Logon for Windows session to a 'nav' class
niwaki = SapNiwaki::Nav.new gui

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Read about SAP GUI Scripting API in their docs at C:\Program Files (x86)\SAP\FrontEnd\SAPgui\SAPguihelp.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/sap_niwaki. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the SapNiwaki project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

sap_niwaki's People

Contributors

jaykilleen avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.