Meine Notizen zu SAP ABAP

AAdvanced
BBusiness
AApplication
PProgramming

ABAP Concepts:

  • Transaction
  • Programm
    • Manage Business Process
  • Screen
  • Data Dictionary
    • Database
  • Subroutine
    • Divide long programs to a subroutine
  • GUI Status
    • Custom Menus

ABAP Objects

Naming Conventions

  • Customer objects prefixed with “Y” or “Z”
  • Object names denote functionality
  • Variable names denote usage
  • Never use literal values (SELECT * from VBAK WHERE AUART IN (‘ZSP0’, ‘ZSP2’).
  • Interfacenames start with IF_* / ZIF_*

A Framework Class

Global Class

Inheriting a global class

Remove final attribute from the class to inheriting

Change the visibility from the instance attribute to protected

To inheriting a class do:

CLASS <name> DEFINITION
  INHERITING FROM <class_to_inheriting_from>.

Abstract Class

Define a base class as abstract

Sonstiges

lv_text = TEXT-t01 && | | && lv_text.
Space character in a text&& | | &&
TEXT-<xxx>Textsymbol
*Comment out a line
CLASS <name> DEFINITION
ENDCLASS.
Interface
CLASS <name> IMPLEMENTATION
ENDCLASS.
Class object
CLASS IMPLEMENTATION
INHERITING FROM <class_name>.
ENDCLASS.
Inheriting
METHODES:
show_details REDEFINITION.
Overwriting an inheriting methode
super->show_details( ).Call the methode in the superclass
TRY.
lcl_start=>run ( ) .
CATCH cx_root INTO lcl_start=>mo_error.
ENDTRY.
Unhandled exceptions cause short dumps
1Paket
2Unterpaket
3Globale Klassen eines Unterpaketes
4Programme (Reports) eines Unterpaketes
5Program (Report) mit Klassen, Felder usw.

ABAP Unit / Test Classes

CLASS lcl_test DEFINITION
      FOR TESTING
      DURATION SHORT
      RISK LEVEL harmless.

      PRIVATE SECTION.
      DATA: lo_test TYPE REF TO zcl_main "class under test
      METHODES: setup, teardown          "Fixture methodes
      METHODES: test_method1 FOR TESTING "Test method

ENDCLASS.
FOR TESTINGmark as an unit test class
DURATIONSHORT
MEDIUM
LONG
RISK LEVELHARMLESS (no changes to data or settings)
DANGEROUS (date may changed)
CRITICAL (data or settings may be changed)
CL_ABAP_UNIT_ASSERTEvaluating test results

Nützliches

GitHub: SAP Styleguides

https://github.com/SAP/styleguides/blob/main/clean-abap/cheat-sheet/CleanABAPCheatSheetV1.4.1.pdf

Meine Notizen zu SAP Transaktionen

Transaktioncode => Shortcut to a program and a screen

Ausführen:

eingabe <Transaktioncode>

Ausführen in einem neuen Fenster:

/o<Transaktioncode>

TransaktionsBeschreibung
SE80Object Navigator (Entwicklungsumgebung)
Object Navigator
SM30Tabellenpflege (Pflegedialog)
Tabellenpflege
ST22ABAP-Dumpanalyse (Fehlersuche / Laufzeitfehler)
ABAP-Dumpanalyse
SE11Data Dictionary (Datenbank)
Data Dictionary
SE16NData Browser (Tabelleninhalt bearbeiten)
Data Browser
STMSSAP Transport Management System (Übersicht)
STMS
SE10Transportauftrag
Transportorganizer
SM50Workprozessübersicht
Workprozessübersicht SAP
SM51Liste der SAP-Systeme
Liste der SAP-Systeme
SE91Nachrichtenpflege
Nachrichtenpflege
SENUMNummernkreispflege
Nummernkreispflege
SE93Transaktionspflege
Transaktionspflege
ST05Performance-Trace
Performance-Trace

Shortcuts

F1SAP Hilfe
F3Zurück
Shift + F3Beenden
F8Ausführen
F12Abbrechen