Professional Documents
Culture Documents
ABAP uses different types of Data Types for Objects, basically there are three types
of data types Elementary Data types, Complex Types, Reference Types.
In Elementary types there are again two types of data types (Categories) Fixed
Length and Variable Length.
Fixed Length:
C Text Field
N Numeric
D Date
T Time
H Hexadecimal
P Parked Number
I Integer
F Float
Variable Length:
STRING Character Sequence
XSTRING Byte Sequence
Complex Types includes Structure Types and Table Types.
Reference Types includes Data References and Object References
Function Modules
These are also sub-programs which contain set of reusable statements for better
readability and re-usability.
Function modules contains parameter interface that is importing and exporting
parameters.
These Function Modules can be executed independently.
Function modules contain exceptions to catch certain type of errors.
T-code for Function Module explorer is SE37.
Sub-routines
Sub-routines are also sub-programs in SAP ABAP which contains certain re-usable
statements.
Most of the times we use sub-routines for re-usability inside the program.
We may use sub-routines for external re-usability.
These sub-routines contain importing and exporting parameters.
CLASSES
Classes are Object Oriented implementations of SAP ABAP.
Classes are used for better re-usability.
perform india(Zinternalsubroutine).
perform usa(Zinternalsubroutine).
TABLES: ZVIVEK190.
SELECT-OPTIONS: ZID FOR ZVIVEK190-ZID.
DATA: BEGIN OF ITAB OCCURS 0,
ZID LIKE ZVIVEK190-ZID,
ZNAME1 LIKE ZVIVEK190-ZNAME1,
ZAGE LIKE ZVIVEK190-ZAGE,
END OF ITAB.
INITIALIZATION.
ZID-LOW = 0000001'.
ZID-HIGH = 0000788'.
APPEND ZID.
CLEAR ZID.
AT SELECTION-SCREEN.
SELECT SINGLE ZID FROM ZVIVEK190
INTO ZID-LOW
WHERE ZID EQ ZID-LOW.
IF SY-SUBRC NE 0.
START-OF-SELECTION.
SELECT ZID ZNAME1 ZAGE FROM ZVIVEK190 INTO TABLE ITAB WHER
E ZID IN ZID.
LOOP AT ITAB.
WRITE:/1 SY-VLINE, 2 ITAB-ZID,
14 SY-VLINE,15 ITAB-ZNAME1,
25 SY-VLINE,26 ITAB-ZAGE,
40 SY-VLINE.
ENDLOOP.
WRITE:/1(40) SY-ULINE.
TOP-OF-PAGE.
WRITE:/2 'CURRENT PROGRAM:',SY-REPID.
WRITE:/2 'DATE:',
SY-DATUM.
WRITE:/2 'TIME:',
SY-UZEIT.
WRITE:/1(40) SY-ULINE.
WRITE:/1 SY-VLINE,5 'ZID',
14 SY-VLINE,16 'ZNAME1',
25 SY-VLINE,30 'ZAGE',
40 SY-VLINE.
WRITE:/1(40) SY-ULINE.