Chapter 0: Getting Your Python Workbench Ready

Think Like Python: A Guide for ABAP Developers

Chapter Goal

Before We Write Code, Let’s Build the Workbench

If you are coming from ABAP, you are probably used to opening SAP GUI, going into SE38, SE80, ADT, or Eclipse, and working inside a controlled development environment. Python feels different at first because the workbench is something you assemble: Python itself, an IDE, a project folder, packages, and eventually Git.

This chapter walks through that setup slowly and practically. By the end, you should have a local Python project that can run a small script and install packages. That foundation will support the first project in the next chapter: an ALV-style table report rebuilt with Python and Bokeh.

1
Install Python
2
Pick an IDE
3
Create a Project
4
Use venv + pip
5
Add Git Basics

The ABAP-to-Python Setup Translation

A lot of Python setup confusion comes from vocabulary. Here is the quick translation table.

ABAP World

  • SAP GUI / ADT
  • Package
  • Transport request
  • Function module include dependencies
  • ALV output

Python World

  • PyCharm or VS Code
  • Project folder
  • Git repository / commit history
  • Installed packages in a virtual environment
  • Bokeh, Flask, Streamlit, or HTML output
ABAP Mindset: In SAP, the system provides most of the structure. In Python, you create the structure yourself. That sounds annoying at first, but it gives you a lot of freedom when building tools, dashboards, automation scripts, and cloud-ready apps.

Step 1: Install Python

Start by installing Python from the official Python website. On Windows, make sure to check the option that adds Python to your PATH during installation. If you miss that checkbox, the command line may not recognize Python.

Open Command Prompt or PowerShell and run:

python --version

On some Windows machines, this command may work instead:

py --version

If you see a Python version number, you are ready for the next step.

This usually means Python was not added to PATH. The beginner-friendly fix is to rerun the installer and choose the option to modify your install, then enable the PATH option.

Do not overthink versions yet. For this guide, use a current Python 3 version. The important part is getting a stable working environment before chasing advanced tooling.

Step 2: Choose an IDE

You can use either PyCharm or VS Code. Both are valid. The right choice depends on how much structure you want.

PyCharm

Good if you want a guided Python experience. It helps manage projects, interpreters, virtual environments, and packages through a more complete IDE interface.

VS Code

Good if you want a lightweight editor that can become powerful through extensions. You will need the Python extension and a little comfort with the terminal.

Recommendation: If you are brand new to Python, start with PyCharm Community Edition or VS Code with the Python extension. If you already use VS Code for other work, stay there.

Step 3: Create Your First Project Folder

Create a folder for the book projects. Keep it simple and avoid spaces in the folder name.

C:\dev\think-like-python

Inside that folder, create a file named:

hello_abap_developer.py

Add this small test script:

print("Hello ABAP developer. Python is ready.")

From the project folder, run:

python hello_abap_developer.py

Or, on Windows:

py hello_abap_developer.py
Python Translation: A Python file is like a small executable report. Later, we will split code into modules, functions, and reusable components, but for now one file is enough.

Step 4: Understand Virtual Environments

A virtual environment is a project-specific Python sandbox. Instead of installing every package globally on your machine, you install packages inside the project’s environment.

ABAP Comparison: Think of a virtual environment like isolating dependencies for one project instead of letting every project share the same global toolbox.

Create a virtual environment:

python -m venv .venv

Activate it on Windows PowerShell:

.venv\Scripts\Activate.ps1

Activate it on Windows Command Prompt:

.venv\Scripts\activate.bat

Activate it on macOS/Linux:

source .venv/bin/activate

Your terminal prompt usually changes and shows (.venv) at the beginning.

(.venv) C:\dev\think-like-python>

Step 5: Install Packages with pip

Python packages are reusable libraries. In ABAP terms, imagine being able to install useful external toolkits into a project. For our early projects, we will use packages like pandas and Bokeh.

With your virtual environment active, run:

python -m pip install pandas bokeh openpyxl

Then capture those dependencies into a requirements file:

python -m pip freeze > requirements.txt

Later, another developer can install the same dependencies with:

python -m pip install -r requirements.txt
Why this matters: The requirements file is one of the first habits that makes your Python work shareable. Without it, your script may work on your machine and fail everywhere else.

Step 6: Learn Just Enough Git

Git is version control. You do not need to become a Git expert on day one, but you should know enough to save your progress, recover from mistakes, and share examples.

git init git status git add . git commit -m "Initial project setup"

A Git commit is not exactly the same thing as an SAP transport, but the mental model is similar: you are collecting related changes and giving them a meaningful label.

Common mistake: Do not commit your .venv folder. In later chapters, we will add a .gitignore file so Git tracks your code but ignores generated environment files.

Chapter 0 Checkpoint

You are ready to continue if you can do the following:

Next: In Chapter 1, we start translating ABAP thinking into Python thinking. Shortly after that, we build the first useful project: an ALV-style table report using Python and Bokeh.

External References

These are official or widely trusted references. You do not need to read them fully now. Keep them nearby when you need deeper details.

End of Chapter 0