Skip to content

Repository files navigation

ABAP Training Program

Introduction to SAP and ABAP Basics

Training Schedule

Day 1

  • Overview of SAP
  • SAP GUI
  • ABAP Workbench Tools

Day 2

  • ABAP Dictionary

Day 3

  • Overview of ABAP Editor
  • Declaring Constants
  • Data Declarations
    • Variables
    • Internal Tables
    • Work Areas

Day 4

  • Field Symbols
  • SQL Statements

Day 5

  • SQL Statements (Advanced)

Day 6

  • Selection Screen
  • Selection Screen Events

Day 7

  • Control Structures
  • Internal Tables

Day 8

  • Operations on Internal Tables

Day 9

  • Debugging Concepts

Day 10

  • String Operations

Day 11

  • ALV (ABAP List Viewer)

Training Exercise 1 – Custom Table Creation

Task

Create a Custom Table with the following fields:

Table Fields

Field Name Description
MANDT Client
Customer Name Create a new Domain and Data Element (CHAR 30)
Material Use standard Data Element from MARA table
Paid_Status CHAR(1); create new Domain & Data Element; accepts only space or 'X'
Due_Date Use standard SAP Date data type (no custom Domain/Data Element)
Created By Automatically populated with User ID
Created On Date field

Additional Requirement

  • Create Table Maintenance Generator to maintain table data.

Training Exercise 2 – Selection Screen and ALV Report

Selection Screen Design

Block 1 – Radio Buttons

  • Customer Material
  • Material Plant
  • Name
  • Name and Material

Block 2 – Dynamic Input Fields

Customer Material

  • Input: Material

Material Plant

  • Mandatory Inputs:
    • Material (MARA-MATNR)
    • Plant (MARC-WERKS)

Name

  • Input: Customer Name

Name and Material

  • Mandatory Inputs:
    • Customer Name
    • Material

Business Logic

Customer Material

  • Take Material input
  • Pass value to Custom Table (Exercise 1)
  • Display results in ALV

Material Plant

  • Take Material and Plant inputs (Mandatory)
  • Fetch data from MARA and MARC
  • Display Material and Plant in ALV

Name

  • Take Customer Name input
  • Fetch data from Custom Table
  • Display results in ALV

Name and Material

  • Take Customer Name and Material inputs (Mandatory)
  • Fetch data from Custom Table
  • Display results in ALV

Training Exercise 3 – Customer Due Report (OOPS ALV)

Enhancements to Custom Table

  • Add a new field: Paid On Date

OOPS ALV Report Requirements

  1. Display Custom Table data using OOPS ALV
  2. Add EDIT button in ALV toolbar
    • Select Paid On Date
    • Click EDIT to make it editable
  3. Update Paid Status:
    • If Due Date <= Paid On Date → Paid Status = 'X'
    • Else → Blank
  4. Add Status Description field (ALV only, not DB level):
    • Paid
    • Unpaid
    • Over Due
    • Paid after Due
    • X days for Due
  5. Add SAVE button:
    • Save Paid On Date
    • Update Paid Status
    • Persist data into Custom Table

Initial Custom Table Data

Customer Name Material Paid Status Due Date Paid On
Person1 1 09/12/2024
Person1 2 09/12/2024
Person2 3 09/12/2024
Person4 4 09/12/2024

Note:
Initially, Paid Status and Paid On Date must be NULL at table level.


ALV Output Example

Customer Name Material Paid Status Due Date Paid On Date Status
Person1 1 X 09/12/2024 09/10/2024 Paid
Person1 2 09/10/2024 Over Due
Person2 3 X 09/12/2024 09/18/2024 Paid after Due
Person4 4 09/26/2024 10 days for Due

Paid Status Determination Logic (On SAVE)

  1. Paid On Date is INITIAL and
    • Due Date < System Date
      → Status = Difference between Due Date and System Date
  2. Paid On Date is INITIAL and
    • Due Date >= System Date
      → Status = Over Due
  3. Paid On Date is NOT INITIAL and
    • Due Date <= Paid On Date
      → Status = Paid
  4. Paid On Date is NOT INITIAL and
    • Due Date > Paid On Date
      → Status = Paid after Due

All changes must be saved back to the Custom Table.

Training Exercise 5-1 – Function Module & SALV Reports

Objectives

  • Create a Function Module with custom logic and call it from a report program.
  • Create SALV reports with filtering capabilities.

Tasks

  1. Create a Function Module with some business logic.
  2. Create a SALV report displaying Employee Details.
    • Provide filter functionality by Department.
  3. Create a SALV report displaying Company Details.
    • Provide filter functionality by Industry.

Training Exercise 5-2 – Material Change Tracking & Order Usage

Objectives

Track user-modified materials and analyze their usage in Purchase Orders and Sales Orders.

Steps

  1. Select any 5 materials from MARA.
  2. Use MM02 to change the Material Description.
    • Append your name to the description to ensure uniqueness.
  3. Create a Function Module that fetches only those 5 materials changed by you.
    • Search criteria can include:
      • User name
      • Material number(s)
      • Date
  4. Check whether these materials are used in Purchase Orders:
    • Header Table: EKKO
    • Item Table: EKPO (material information available here)
  5. If used in a Purchase Order, collect:
    • Purchase Order Number
    • Item Number
    • Material Number
  6. Repeat Steps 4 and 5 for Sales Orders:
    • Header Table: VBAK
    • Item Table: VBAP
  7. Populate a final generic internal table capable of holding:
    • Purchase Order / Sales Order Number
    • Item Number
    • Material Number
  8. When the Function Module is executed:
    • All above logic should execute
    • Data should be displayed as output

Report Program Requirements

  • Create a report that calls the Function Module
  • Inputs must come from the Selection Screen:
    • Material(s)
    • User name
    • Date
  • Use:
    • Multiple selection-screen blocks
    • Various selection-screen elements
  • All input fields must:
    • Be optional
    • Have F4 Help

Output Options

  • Display data on screen OR
  • Download data to local folder (Presentation Server)

Validations

  • If a material entered is not changed by the user:
    • Do not display data
    • Show message: Material(s) are not changed by you
  • If 5 materials are entered and only 2 belong to the user:
    • Display data for the 2 materials
    • Show message: Other materials are not changed by you
  • Messages must:
    • Appear in the Status Bar
    • Remain on the same screen

Training Exercise 5-3 – Dynamic Table Data Fetch Report

Objectives

Create a report with fully dynamic SELECT logic.

Requirements

  1. Create a report with an input field for Table Name.
  2. Validations:
    • Field must not be blank
    • Accept only:
      • VBAP
      • EKPO
    • If any other value is entered:
      • Show message: Enter only VBAP or EKPO
    • If table does not exist in the system:
      • Show error: Invalid table name
  3. Fetch data dynamically:
    • Use only one SELECT statement
    • Table name must be dynamic
  4. Fetch only a few records.
  5. After fetching data:
    • Access a text field of the table
    • Replace its value with the table name entered
    • Use Field Symbols
  6. Display the data on screen.

Training Exercise 5-4 – Custom Table, Maintenance & Editable SALV

Objectives

Understand Table Buffering, Table Maintenance, and editable SALV.

Tasks

  1. Create a Custom Table:
    • Turn Buffering OFF
    • Understand:
      • What buffering is
      • Types of buffering in SAP
  2. Create a Table Maintenance Generator.
  3. Create a Transaction Code for table maintenance.
  4. Create a custom report to:
    • Insert
    • Update
    • Create records in the table
  5. Also create data using the Table Maintenance Transaction.
  6. Create another custom report to:
    • Fetch all records
    • Display them using SALV
  7. Make SALV editable:
    • Provide Edit button in Application Toolbar
  8. Enable record deletion:
    • Allow user to select records
    • Provide:
      • Delete button in Application Toolbar
      • (Optional) Delete option in Context Menu

Training Exercise 5-5 – BADI Implementation on SAP Login

Objectives

Implement a BADI triggered during SAP Login.

Tasks

  1. Find a BADI that is triggered when a user logs into SAP.
  2. Implement the BADI with:
    • A Popup Screen
    • Dropdown menu
    • GO button
  3. Dropdown menu requirements:
    • Multiple values (e.g., Project Names or Locations)
    • Allow single or multiple selection
  4. On clicking GO:
    • Update a Custom Table with:
      • User ID
      • Selected dropdown values
  5. Coding Guidelines:
    • Use New ABAP Syntax
    • Write less code
    • Prefer dynamic and modern ABAP techniques

About

SAP ABAP - List of ABAP Program that were created during internship at NextLabs (Non Crucial)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors