1.flow of an ABAPProgram
SAP NetWeaverApplication Sever( basis for the scalability)
architecture: database level,application sever level(where ABAP run), presentation server level
2.introduction to the ABAP Workbench
theRepository : includes all system development objects - programs, functionmodules, definitions of database tables and so on.
Therepository information system is suitable for the random search for repositoryobjects.
Youuse the application hierarchy for the application-specific search for Repositoryobjects.
Syntax:
- ABAP programs are comprised of individual sentences (statements).
- The first word in a statement is called an ABAP keyword.
- Each statement ends with a period.
- Words must always be separated by at least one space.
- Statements can be indented as you wish.
- With keywords, additions and operands, the ABAP runtime system does not differentiate between upper and lowercase.
- Statements can extend beyond one line.
- You can have several statements in a single line (though this is not recommended).
- Lines that begin with asterisk * in the first column are recognized as comment lines by the ABAP runtime system and are ignored.
- Double quotations marks " indicate that the remainder of a line is a comment.
Standard Types:complete and incomplete types
D T I F STRINGXSTRING C N X P
Statement:
MOVE: transfer the contents of a dataobject to another data object
CLEAR: reset the contents of a dataobjects to the type-related initial value
MESSAGE: send dialog messages to theusers of your program
Calculations:+ - * /**(Exponentiation) DIV(Integral division without remainder) MOD
processing sequence: Expressions inparentheses come first, then functions, then powers, then multiplication/division, andfinally addition/subtraction.
Conditionalbranches: IF construct ; CASEconstruct ENDIF ENDCASE
Loops: four loopsconstructs
Unconditional loops: DO and ENDDO
Header-Controlled Loops: WHILE andENDWHILE
Read Loops: SELECT ; read function
System Fields:
Sy-subrc: indicate whether thestatement could be executed successfully. The value zero means that the statement was executedsuccessfully
Dialog messages:three digit message number and the messages class
supply placeholders with values byusing the WITH addition
4.modularization
There are twotechniques for local program modularization in the ABAP programming language:Subroutines, also known as form routines; Methods in local classes
There are also twotechniques for global modularization in the ABAP programming language: Functionmodules that are organized in function groups; Methods in global classes
Data encapsulation:Data in the modularization units should not be changed directly by the callingprogram.
Parameter Definitionfor Subroutines: defined within the main program, Defining an Interface
The way these mainprogram variables are passed to the formal parameters of the subroutine iscalled the pass type and is specified for each parameter in the interface ofthe subroutine.
There are three passtypes for subroutines: call by value, call by value and result, call byreference
Structure of asubroutine
- A subroutine is introduced with FORM.
- You specify the name and the interface of the subroutine after FORM.
- The statements of the subroutine then follow.
- The ENDFORM statement concludes the subroutine.
call by value: Youlist each of the formal parameters that is supposed to have the pass type"call by value" (here: f1) with the VALUE prefix under USING. (Referto the above graphic for the syntax.)
call by value andresult: You list each of the formal parameters that is supposed to have thepass type "call by value and result" (here: f1) with the VALUE prefixunder CHANGING. (Refer to the above graphic for the syntax.)
call by reference:You list each of the formal parameters that is supposed to have the pass type"call by reference" (here: f3) without the VALUE prefix underCHANGING.(Refer to the above graphic for the syntax.)
When the subroutineis called, the actual parameters to be transferred without the VALUE prefix arespecified under USING or CHANGING.