Skip to content

Automates SAP Logon GUI tasks using Python + PyWinAuto — useful for repetitive workflows, report generation, and task scheduling.

License

Notifications You must be signed in to change notification settings

chiragx16/SAP-LOGON-GUI-Automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Python Platform SAP Notebook

Automation of Material Master Data Retrieval via SAP GUI (MM03 Transaction)

The goal of this project is to automate the process of retrieving material master data from SAP using the MM03 transaction. This is done through GUI scripting, driven by material data listed in an Excel file. The automation simulates user actions to extract views like Basic Data, Plant Data, and Sales Org Data, and logs results into an Excel workbook.

Tools & Technologies Used

  • win32com.client — to interact with SAP GUI via COM automation.
  • pandas — for reading material and plant data from Excel files.
  • openpyxl — for creating and styling Excel output reports.
  • os, time, traceback, logging — for utility operations, error tracking, and delay management.
  • SAP GUI — GUI client used to simulate user interactions.
  • Excel File — Input for Material Number and Plant, and output for storing results.

Process Flow

  1. SAP GUI Launch and Login A function start_sap() is used to programmatically start sapshcut.exe for launching the SAP GUI system with predefined credentials.

  2. SAP MM03 Navigation

  • After successful login, automate_sap_tcode() simulates the SAP GUI interactions:
  • Opens the MM03 transaction.
  • Enters material number and selects the desired views (like Basic Data 1, Plant Data/Storage 1, etc.)
  • Loops through each material and plant combination to extract data.
  1. Excel Integration
  • Input Excel is read using pandas.read_excel() to extract Material and Plant combinations.
  • Output Excel is generated using openpyxl, with formatting (merged cells, borders, fonts).
  • Result includes structured tables representing key SAP MM03 data per material.
  1. Logging
  • Logs for success/failure are captured in a log file logs.log to help trace failures or SAP GUI errors.

Prerequisites

Implementation

  1. Clone the repository
git clone https://github.com/chiragx16/SAP-LOGON-GUI-Automation.git
  1. Install Dependencies mentioned above pip install pywin32 pandas openpyxl notebook

  2. Open 'cmd' in the project directory and run this jupyter notebook

About

Automates SAP Logon GUI tasks using Python + PyWinAuto — useful for repetitive workflows, report generation, and task scheduling.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published