Skip to main content

Facilitating interaction with the SAP GUI system

Project description

SAP GUI SCRIPTING

This project offers an abstraction over the SAP GUI Scripting API, facilitating interaction with the SAP GUI system. It allows navigation among different SAP transactions and downloading and transforming information exported from these transactions.

Key Features:

  • Automated Logging: Performs records in SAP quickly and easily, minimizing the risk of manual errors.
  • Simplified Navigation: Enables agile movement between different SAP transactions, optimizing workflow.
  • Data Download and Transformation: Exports information from SAP and transforms it for use in other applications or analysis, facilitating data-driven decision-making.

Tabla de Contenidos

  1. Installation
  2. Basic Usage
  3. Recomendations
  4. Contribution
  5. License
  6. Contact

Installation

Remember create your 'venv'

python -m venv venv

venv/Scripts/Activate

pip list

python.exe -m pip install --upgrade pip

pip install sap-gui-library

The second step is to use the following command if you see the library all is ok

pip list

>> ...
>> sap-gui-library   version
>> ...

You are ready to use sap library, in your proyects

Use

The following example demonstrates the most basic and simple usage of this project. For more detailed documentation, please visit sap_gui_library documentation.

from sap_gui_library import SapGui,Transaction,DataProcess
  • How open sap?

    sap_instance=SapGui(
        conection="our conection",
        user="user",
        password="password"
    )
    session=sap_instance.get_session()
    
  • Basic proccess in transaccion

    COOISPI=Transaction(
        session=session, # or sap_instance.get_session()
        code="COOISPI")
    COOISPI.start_transaction()
    COOISPI.select_variant(
        variant_author="USER",
        variant_name="VARIANT"
    )
    ...
    #COOISPI.session.FindById("id").text=""# example
    #COOISPI.session.FindById("id").press()# example2
    COOISPI.run_transaction()
    COLUMNS_NAMES=COOISPI.get_column_names()
    COOISPI.export_in_shell_or_grid()
    COOISPI.select_export_and_download(
        address=address,
        name="name_file"
    )
    
  • Data transformation

    DATA=DataProcess(
        address_file=os.path.join(address,"name_file.csv")
        ...
    )
    DATA.edit_file(
        generic_name_columns=COLUMNS_NAMES,
        ...
    )
    df=DATA.get_df()
    

Recomendations

The following recommendations are for interacting with SAP in Python development:

  • SAPGUI version

    A version of SAPGUI 770 or higher is required.

  • Scripting Tracker

    This tool helps identify all the elements (objects) we can interact with in each SAP session. You can download it from the official page using this link: Scripting Tracker. If you want more information about the tool, you can find it on the official SAP forum.

  • SAPGUI Accessibility - Scripting

    To interact with SAP in a more fluid and simple way, there are several settings that should be adjusted beforehand:

    • In the options tab:

      • option 1
      Source: SAP Help Portal, SAP Business One documentation
        <img alt="Source: SAP Help Portal, SAP Business One documentation" title="Accessing options" src=" https://help.sap.com/doc/63bd20104af84112973ad59590645513/800.08/en-US/loio3f85028df9544adab53ceda6c5e457dd_LowRes.png" >
      
      • option 2
      Source: SAP Help Portal, SAP Business One documentation
    • Under Accessibility and Scripting --> Scripting --> enable the "Enable scripting" option and disable the other three options so that you don't get notified every time a script runs.

      Source: SAP Help Portal, SAP Business One documentation
    • Before going to the Accessibility tab and enabling the "Use accessibility mode" option, we need to change the SAP theme or visual style to "SAP Signature Theme." Once this is done, you can go back to Accessibility and Scripting --> Accessibility --> and enable the "Use accessibility mode" option.

      Source: SAP Help Portal, SAP Business One documentation
  • SAPGUI Web API

    If you want to dive deeper into the attributes and methods available for each object in SAPGUI, you can check the documentation, which comes from the official SAP site.

Contribution

Thank you for your interest in contributing to this project! Here's how you can do it:

  • 1. Fork the Repository

    First, fork the repository by clicking the "Fork" button at the top of the repository page.

  • 2. Create a Branch

    Clone your fork to your local machine and then create a new branch for your work. Name your branch according to the feature or bug you're working on:

    git checkout -b your-branch-name
    
  • 3. Make Your Changes

    Make the changes you believe are necessary.

  • 4. Commit Your Changes

    Once you've made your changes, commit them with a clear description of what you've done:

     git add .
     git commit -m "Clear description of the changes"
    
  • 5. Push Your Branch

    Push your changes to the remote repository:

    git push origin your-branch-name
    
  • 6. Create a Pull Request

    Go to the original repository on GitHub and click the "New Pull Request" button. Clearly explain the changes you've made and why they should be merged.

License

  • MIT License

Contact

If you have any questions, suggestions, or feedback, feel free to contact us:

  • LinkedIn: Felipe Lopez
  • GitHub Issues: Please report issues or feature requests here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sap-gui-library-0.1.3.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sap_gui_library-0.1.3-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file sap-gui-library-0.1.3.tar.gz.

File metadata

  • Download URL: sap-gui-library-0.1.3.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for sap-gui-library-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9ae989aa8b6fad38a318e59ca9eac341487821e5a72cc06270a8f5a45e7bea1f
MD5 8bd7eab71a2feacc0ceb733edf5862c2
BLAKE2b-256 27df6e9e9f8c4e0c778bb25c48ce6af592c5d4b40040bd7c4bc88668dac951e2

See more details on using hashes here.

File details

Details for the file sap_gui_library-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for sap_gui_library-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d749832ade495d1bc20eef9dc62f9bc85c7aa256e3d5b39f207ca79fbba57809
MD5 25123051cea6b547ef0c64faf7e00c3c
BLAKE2b-256 f9ffce7941992c742124dac6bcff3250c4df4ec1e151e99ddc88f38188c1bd7b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page