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.2.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: sap-gui-library-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 91a981ee225fdb1ae7af7acc0c20d768bfb558640780065754971878c84e446f
MD5 07236f4fbc7a9b86b2d17d6330c75436
BLAKE2b-256 b4a82010d00acf2f794d72872e2c21491e0501008da552ea15a7d6d05486608b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sap_gui_library-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6aab70e38a43d4af80a920386693149bc0422ddf04705e6de6eb19fc9be439de
MD5 84ee6a9176d512c6fb2b0f8279f43d4d
BLAKE2b-256 204b4f898a95bf636cd4ae8445dbf7988375b1a56e0763ebc031d03b2e03c604

See more details on using hashes here.

Supported by

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