top of page
Search

Predictive Workload Forecasting: Smarter S/4HANA Migration Planning

ree

Why It Matters?

Migrating from ECC to S/4HANA is one of the biggest transitions SAP customers face. Beyond technical conversion, one of the hardest parts is getting system sizing right:

  • Size too small → performance bottlenecks, missed financial close, frustrated users.

  • Size too large → inflated HANA licenses and cloud bills.

Traditional approaches (SAP Quick Sizer, rough extrapolations) leave teams guessing. What if instead you could predict future workloads and size based on real usage trends?

That’s where Predictive Workload Forecasting comes in.


Where This Solution Runs

  • In ECC (today):

    • Extract workload statistics from SWNCAGGRFCSRVR (ST03N data).

    • Export FM usage (call counts, runtimes) to CSV.

    • Run Python forecasting (Prophet/ARIMA) outside SAP to project future volumes.

    • Convert forecasts into actionable sizing for CPU, memory, and storage.

  • In S/4HANA (today + future):

    • Same ABAP + Python solution works because ST03N + SWNC* tables still exist.

    • Plus: forecasts can be integrated into SAP Joule, the AI assistant in S/4HANA Cloud/PCE.

    • Joule can make predictions conversational: “Will BAPI_ACC_DOCUMENT_POST handle month-end next quarter?” → Joule answers with sizing advice.


    In Short:

  • ECC → ABAP + Python forecasting = implementable today.

  • S/4HANA → same solution works, and with Joule it becomes AI-driven.


How It Helps in S/4HANA Migration

Evidence-Based Sizing

  • Use FM forecasts to right-size HANA CPU, memory, and storage.

  • Eliminate guesswork from sizing exercises.

Spotting Bottlenecks Before Cutover

  • Identify FMs like BAPI_ACC_DOCUMENT_POST, BAPI_PO_CREATE1, or IDoc processing that peak at month-end.

  • Plan extra background WPs, job scheduling, or code optimization in advance.

Cloud Cost Optimization

  • Forecasts produce demand curves → right-size baseline capacity, scale elastically for peaks.

  • Prevents overspending in RISE, Azure, AWS, or GCP.

Business & Audit Confidence

  • Show predictive charts of expected runtimes post-migration.

  • Builds trust with CFOs, auditors, and steering committees.

Better Governance

  • Include predictive workload reports in migration project decks.

  • Justify sizing, licensing, and budget decisions with data.

In short: Predictive Workload Forecasting transforms migration from a best-guess exercise into a data-driven, risk-mitigated journey.


The Solution in Action

So, how do we actually do it? Let’s break it down into three layers: ABAP → Python → Joule.


Step 1: ABAP – Extract FM Usage Data

SAP stores workload statistics in SWNCAGGRFCSRVR. Here’s an example to extract daily FM usage:


REPORT z_fm_usage_export.


TYPES: BEGIN OF ty_fm_usage,

fm_name TYPE string,

calls TYPE i,

avg_time TYPE i,

total_time TYPE i,

period TYPE d,

END OF ty_fm_usage.


DATA: lt_usage TYPE TABLE OF ty_fm_usage,

ls_usage TYPE ty_fm_usage.


" Get daily aggregated FM stats from workload collector

SELECT funcname " Function Module

calls " Number of Calls

responsetime " Average Response Time (ms)

ttime " Total Time (ms)

periodstart " Start Date

FROM swncaggrfcsrvr

INTO (ls_usage-fm_name,

ls_usage-calls,

ls_usage-avg_time,

ls_usage-total_time,

ls_usage-period).


APPEND ls_usage TO lt_usage.

ENDSELECT.


" Save results to CSV

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = 'C:\temp\fm_usage.csv'

filetype = 'ASC'

TABLES

data_tab = lt_usage.


WRITE: / 'Export completed. File saved to C:\temp\fm_usage.csv'.

 Output: C:\temp\fm_usage.csv with columns: fm_name, calls, avg_time, total_time, period.


Step 2: Python – Forecast FM Calls with Prophet

This script reads the CSV, runs forecasting with Prophet, and shows a chart of predicted FM calls.

# fm_forecast.py
import pandas as pd
from prophet import Prophet
import matplotlib.pyplot as plt

# Load data exported from ABAP
df = pd.read_csv("fm_usage.csv")

# Convert date
df['period'] = pd.to_datetime(df['period'], errors='coerce')

# Filter for one critical FM
fm_name = "BAPI_ACC_DOCUMENT_POST"
fm_df = df[df['fm_name'] == fm_name]

# Prepare for Prophet
forecast_df = fm_df.rename(columns={'period': 'ds', 'calls': 'y'})[['ds', 'y']]

# Train model
model = Prophet()
model.fit(forecast_df)

# Forecast next 90 days
future = model.make_future_dataframe(periods=90)
forecast = model.predict(future)

# Plot forecast
fig = model.plot(forecast)
plt.title(f"Forecasted Calls: {fm_name}")
plt.xlabel("Date")
plt.ylabel("Calls per Day")
plt.show()

# Save forecast results
forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].to_csv("fm_forecast_output.csv", index=False)

print("Forecast complete. Results saved to fm_forecast_output.csv")

Output:

Interactive chart: historical vs predicted calls (with upper/lower confidence).

fm_forecast_output.csv: Predicted FM usage for next 90 days.

Step 3: Map Forecasts to Resource Sizing

Example conversion rules (to be calibrated with your system benchmarks):

Metric

Conversion Rule Example

Calls/sec per FM

1 CPU core ≈ 200 calls/sec

Memory per session

75 MB RAM per dialog process

Background jobs

1 batch WP ≈ 2 vCPUs

Storage

Payload size × calls × retention days

This translates predictions into CPU, memory, and storage requirements for S/4HANA or cloud.


Future Vision: SAP Joule AI

Today, you can run ABAP + Python to generate reports. Tomorrow, you can embed this into SAP Joule:

User asks Joule:

“Will BAPI_ACC_DOCUMENT_POST handle month-end next quarter?”


Joule answers:

“Forecast predicts 52,000 calls/day. Add background WPs and scale HANA Cloud vCPUs.”

Note: Joule integration is conceptual today — SAP hasn’t exposed a forecasting skill or SDK yet. But this is a realistic next step as SAP extends Joule.


The Flow

ECC or S/4HANA → [ABAP: Extract FM usage] → [Python: Forecast workloads]

→ [Sizing model: CPU/Memory/Storage] → [SAP Joule (Future): AI advice]


Final Takeaway

  • In ECC → You can already implement ABAP + Python forecasting today.

  • In S/4HANA → The same solution applies, with the future possibility of AI-driven insights via Joule.

  • For Migration → This gives you evidence-based sizing, proactive bottleneck management, cloud cost savings, and stronger governance.


In short: Predictive Workload Forecasting makes your S/4HANA migration smarter, leaner, and safer.




 
 
 

Comments


Featured Blog Post

bottom of page