360 likes | 622 Views
Introduction ABAP Programs. ABAP (History). Acronym: A llgemeiner B erichts A ufbereitungs P rozessor Generic report preparation rocessor A dvanced B usiness A pplication P rogramming Created back in the 1980s Looks very much like COBOL SAP itself, is written in ABAP.
E N D
ABAP (History) • Acronym: • AllgemeinerBerichtsAufbereitungsProzessor • Generic report preparation rocessor • AdvancedBusiness Application Programming • Created back in the 1980s • Looks very much like COBOL • SAP itself, is written in ABAP
ABAP Editor(Creating the Code) • My opinion – it’s a pretty good development environment • Supports intellisense, code highlighting, and a robust debugger • Most of you have never seen COBOL, but it looks like COBOL!
Introduction to the ABAP Editor • It’s a unified interface for creating, debugging, deploying, … ABAP programs • Use transaction code SE38
Activation • Note that you must activate ABAP with the keys I gave you before you use the software for the first time.
Review (A First ABAP Program -1) • Create a program
Review (A First ABAP Program -2) • Edit the program statements
Review (A First ABAP Program -3) • Activate the application (Program / Activate)
Review (A First ABAP Program -4) • Run it (F8) or (Program / Test / Direct Processing • A first report is displayed
APAP Program Attributes (Introduction) • Every program that you create has metadata
APAP Program Attributes (Program Type) • ABAP has it’s own program types • Executableprograms can be run independently of a transaction code • Remember program types from the last lecture • Our first program will be an executable program • ModulePools are made up of processing steps and are executed from a transaction code • And other types of programs
APAP Program Attributes (Program Status / Application) • Programstatus controls whether the program is a test (local)program deployed to production systems • Application controls where in the SAP hierarchy the program “lives”
ABAP Program Attributes(Package) • A program belongs to a package and has an owner • The package is defined when the program is saved for the first time • Use package $TMP for our “local” packages • SAP packages, in the simplest case, allow you group code (applications) together
ABAP Program Attributes (Package) • Use Local Page $TMP for our work
The ABAP Editor • It’s Visual Studio for SAP • A code editor • The clipboard works as we would expect • Works as you would expect • A list of icons appears on pages 77-79 • Only activated programs can be run
ABAP Program Names • SAP has naming conventions for programs • Local programs should ALWAYS begin with the letter Z (for customer)
ABAP Syntax (Introduction) • Like most programming language, we have statements as the atomic unit of work • ABAP statements always end with a period (thanks COBOL)
ABAP Syntax (Getting Help) • Highlight a keyword in the Code Editor and press F1 to get the keyword documentation
ABAP Keywords (REPORT) • REPORT rep. • It’s the first statement in an executable program • It can also be replaced with the keyword PROGRAM • Following the report keyword appears the report name • Example
ABAP Keywords (WRITE 1) • The statement writes the content to the output stream (current page of the current list)
ABAP Keywords (WRITE 2) • String literals appear in single quotes • Including a “/” triggers a new line • WRITE / writes a new line
ABAP Keywords (SKIP, ULINE) • SKIP write a blank line • ULINE draws a horizontal rule