Chapter 2: Your First Real Project

Replacing an ABAP ALV report with Python + Bokeh

Project Goal

Build a simple report that displays material data:

This is the moment where things click. You're building something real.

ABAP Version

DATA: lt_materials TYPE TABLE OF mara. SELECT matnr, mtart, matkl FROM mara INTO TABLE lt_materials UP TO 100 ROWS. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' TABLES t_outtab = lt_materials.

Python Version (Step by Step)

Step 1: Install Dependencies

pip install pandas bokeh

Step 2: Sample Data (CSV)

matnr,mtart,matkl 1001,FERT,001 1002,HALB,002 1003,FERT,003

Step 3: Python Script

import pandas as pd from bokeh.models import ColumnDataSource, DataTable, TableColumn from bokeh.io import show # Load data df = pd.read_csv("materials.csv") # Convert to Bokeh source source = ColumnDataSource(df) # Define columns columns = [ TableColumn(field="matnr", title="Material"), TableColumn(field="mtart", title="Type"), TableColumn(field="matkl", title="Group") ] # Create table table = DataTable(source=source, columns=columns, width=800) # Show result show(table)

What Just Happened

Python didn't replace ABAP — it expanded what you can do outside SAP.

Try This

Next Step

In the next chapter, we enhance this:

End of Chapter 2