Skip to content

simple modules to use sap gui scripting api and sap analysis for office in a easy way

License

Notifications You must be signed in to change notification settings

campiohe/sap-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SAP Automation Modules

SAP Automation Modules is a collection of simple modules designed to make it easy to interact with SAP GUI Scripting API and SAP Analysis for Office. These modules provide a straightforward and user-friendly way to automate various tasks in SAP, improving efficiency and reducing manual efforts.

Table of Contents

Introduction

SAP GUI Scripting API and SAP Analysis for Office are powerful tools for automating SAP processes and performing data analysis. However, interacting with these APIs can be complex and time-consuming, especially for users without extensive programming experience. This repo aims to bridge this gap by providing easy-to-use modules that abstract away the complexities of the underlying APIs, making automation tasks more accessible to everyone.

Documentation

Features

  • User-friendly Interface: The modules offer a simplified and intuitive interface for interacting with SAP GUI and SAP Analysis for Office, reducing the learning curve.
  • Easy Installation: Installation is straightforward and can be done with just a few simple steps.
  • Customization: The modules can be easily customized to fit specific business requirements and workflows.

Requirements

  • SAP GUI Scripting API enabled on your SAP system.
  • SAP Analysis for Office installed and configured.

Installation

To install SAP Automation Modules, follow these steps:

  1. Clone this repository to your local machine or download the latest release.
  2. Ensure you have the required dependencies installed (SAP GUI Scripting API and SAP Analysis for Office).
  3. Copy the module files into your project directory or include them in your automation workflow.

Usage

To use SAP Automation Modules in your project, follow the documentation and examples provided. Each module has its own set of functions and methods to interact with SAP GUI and SAP Analysis for Office.

SAP GUI Scripting

For example, to automate a SAP transaction using the py module:

import sap

sap_connection_data = sap.attach("system name")

if sap_connection_data:

    application, connection, session = sap_connection_data

    # script here
    session.StartTransaction("tcode")
 
    sap.close(sap_connection_data)

And using the vba class module:

Dim sap As New SapGuiScripting
If sap.Attach("system name") Then

    ' script here
    session.StartTransaction "tcode"
 
End If

SAP Analysis for Office

To automate a refresh of SAP Analysis report using the py module:

from ao import SapAnalysisOffice

with SapAnalysisOffice('Ao_Workbook_File_Path') as ao:

   if not 'DS_NAME' in ao.datasources:
       print(f'Data Source "DS_NAME" does not exist in Workbook "{ao.wb.Name}"')

   if not ao.is_connected(data_src):
       ao.refresh(data_src)

Using vba class module:

Dim prompts As New Dictionary
With prompts
    .Add "<variable technical name 0>", "<variable value 0>"
    .Add "<variable technical name 1>", "<variable value 1>"
    .Add "<variable technical name 2>", "<variable value 2>"
End With

Dim ao As New SapAnalysisOffice
If Not ao.Refresh("DS_1", prompts) Then
    Debug.Print "Refresh AO fail!"
End If

Examples

Check out the Examples directory for more detailed use cases and practical examples of how to leverage SAP Automation Modules for various automation tasks.

About

simple modules to use sap gui scripting api and sap analysis for office in a easy way

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published