Anda di halaman 1dari 6

ABAP Notes:

https://www.tutorialscampus.com/tutorials/sap-abap/sap-abap-reading-internal-tables.htm
1. Subroutines:
a. PERFORM “subroutine name”
i. FORM
ii. -------- subroutines-------
iii. ENDFORM

2. Macro:
a. DEFINE
b. -------Macro conditions-----
c. END-OF-DEFINITION

3. Selection screen:
a. BEGIN OFF
b. END OFF
c. PARAMETERS
i. Used for single selection button
d. SELECT OPTION
i. Used for multi selection

4. Declare variable:
a. DATA
i. DATA BEGIN OF abap
ii. END OF
b. TYPES
i. Used to declare variable
c. CONSTANTS
i. CONSTANTS a TYPE i DEFALUT 5
d. INCLUDE

5. Declare data type:


a. TYPE
i. DATA abap TYPE c
b. LENGTH
i. DATA abap TYPE c LENGTH 4
c. LIKE
i. DATA abap1 LIKE abap
d. DEFAULT
i. CONSTANTS a TYPE i DEFAULT 5
e. VALUE
i. DATA abap_a TYPE c VALUE ABAP
6. Function Module:
a. Used for globally
i. CALL FUNCTION ‘calling program’
1. FUNCTION
2. ----statement-----
3. ENDFUNCTION

7. Structure:
a. It’s data object that is made up of components of any data type stored one
after the other in the memory.
b. Can be any data type
c. Structure format values from different tables
d. Rather than declaring several fields, to define structure which has different
fields with different data type from different table.
e. Can define as a table also

8. Views:
a. A View acts like a database table only. But it will not occupy storage space.
b. A view acts similar to a virtual table - a table that does not have any physical
existence.
c. A view is created by combining the data of one or more tables containing
information about an application object.
d. Using views, you can represent a subset of the data contained in a table or you
can join multiple tables into a single virtual table.
9. Include:
a. Include programs are global repository objects used to modularize the source
code. They allow you to use the same source code in different programs.
Include programs also allow you to manage complex programs in an orderly
way. In order to use an include program in another program, we use the
following syntax −
b. INCLUDE <program_name>.

10. Difference between Include and Function module:


a. INCLUDE:
i. we can’t pass any value and can’t get any value
ii. Declare variable and all
iii. Call common program to use globally
iv. Can’t give any inputs

b. FUNCTION MODULE:
i. We can pass some value and it can process it and get some value
ii. Example:- Need to get report from a table
1. Give inputs like file name, path, object (selection keys)
2. It will get from standard table and put it in internal table and
make a report and downloaded in desktop

11. Transport the changes:


a. Only Executable program and Include program can send or transport to
further system
b. Function module, Subroutines and all cant transport

12. Hard code:


a. When writing program define the value at program itself
b. Example:-
i. CONSTANTS a_abap TYPE c DEFAULT ABAP
ii. DATA a_abap TYPE c LENGTH 4 VALUE ABAP

13. Open SQL Overview:


a. Open SQL indicates the subset of ABAP statements that enable direct access
to the data in the central database of the current AS ABAP.
b. Open SQL statements can be used to access database tables that are declared
in the ABAP Dictionary.
c. Data has been taken from central data based and transferred to database
system and executed
d. Whenever any of these statements are used in an ABAP program, it is
important to check whether the action executed has been successful.
e. Whenever tries to insert entries, We can use these field to check it
i. Field is SY-SUBRC
ii. When a statement is executed successfully, the SY-SUBRC field will
contain a value of 0

14. Insert statement:


a. Using INSERT command, can take values from some table and insert into
another table.
b. Insert new record into the table
i. Example:-
ii. INSERT ZCUSTOMERS1 FROM wa_customers1

15. Clear statement:


a. It allows a field or variable to be cleared out for the insertion of new data in its
place, allowing it to be reused.
b. If we want to insert a new record, CLEAR statement must be used so that it
can then be filled again with the new data.
16. Update statement:
a. If you want to update one or more existing records in a table at the same time
then use UPDATE statement
b. Update existing record’s field into the table
c. Example:-

d. UPDATE ZCUSTOMERS1 FROM wa_customers1.

17. Modify Statement:


a. MODIFY statement can be considered as a combination of the INSERT and
UPDATE statements.
b. It can be used to either insert a new record or modify an existing record
c. Example:-

d. MODIFY ZCUSTOMERS1 FROM wa_customers1.

18. Native SQL statement:

a. To use a Native SQL statement, you have to precede it with the EXEC SQL
statement and end with ENDEXEC statement.

b. Following is the syntax −

c. EXEC SQL PERFORMING <form>.


d. <Native SQL statement>
e. ENDEXEC.

19. Creating Internal Table:

a. DATA statement is used to declare an internal table.

b. The program must be told where the table begins and ends. So use the BEGIN
OF statement and then declare the table name.

c. After this, the OCCURS addition is used, followed by a number, here 0. OCCURS
tells SAP that an internal table is being created, and the 0 states that it will not
contain any records initially. It will then expand as it is filled with data.

d. Following is the syntax −

e. DATA: BEGIN OF <internal_tab> Occurs 0,


f. Create two fields, Name and DOB.
g. create ‘name’ which is declared as LIKE ZCUSTOMERS1-name. Create another
field called ‘dob’, LIKE ZCUSTOMERS1-dob.
h. If want to create internal table using DATA, BEGIN OF , OCCURS and END OF
clause statement is mandatory

i. If want to create internal table using TYPES, TYPE/LIKE clause statement is


mandatory,

20. Populating Internal table:


a. populating includes features such as selection, insertion and append.

21. Insert statement with INDEX:


a. Used to insert a single line or a group of lines into an internal table.

b. Following is the syntax to add a single line to an internal table −

c. INSERT <work_area_itab> INTO <internal_tab> INDEX <index_num>.


d. When a new line is inserted in an internal table by using the INDEX clause, the
index number of the lines after the inserted line is incremented by 1.
e. If an internal table contains <index_num> - 1 lines, the new line is added at
the end of the table.
f. When the SAP system successfully adds a line to an internal table, the SY-
SUBRC variable is set to 0.

22. Domains:-
a. The domain is used for the technical definition of a table field such as field
type and length, and the data element is used for the semantic definition
(short description).
b. A data element describes the meaning of a domain in a certain business
context. It contains primarily the field help and the field labels in the screen.
c. The domain is assigned to the data element, which in turn is assigned to the
table fields or structure fields.
23. Data element:-
a. Data elements describe the individual fields in the ABAP Data Dictionary.
b. They are the smallest indivisible units of the complex types, and they are used
to define the type of table field, structure component or row type of a table.
24. Types of table field

Anda mungkin juga menyukai