Vous êtes sur la page 1sur 6

Internal Tables

- Page 0 of 5 -
Create the following programs using ABAP Workbench tool

Note: All the following objects to be created should follow a naming convention
YEMPID_##$$%%, where ##$$ indicates the exercise number and %% indicates the
question number in the exercise (0203 in this case) and EMPID indicates the employee
ID.
1.
a. Create a field string according to the following structure.
b. Create an internal table using the above field string and populate it with the
following data.

Customer Customer City


num name
ber
C001 JOHN NEW YORK
C002 MIKE LONDON
C003 ARNOLD MINNESOTA

c. Get the following output using the internal table.


C002 MIKE LONDON
C003 ARNOLD MINNESOTA
C001 JOHN NEW YORK
2.
a. Create an internal table to store the following data.

Customer Customer Amount


numb name
er
C001 JOHN 5000
C002 MIKE 2000
C003 ARNOLD 2000
C002 MIKE 2000
C001 JOHN 1000
C003 ARNOLD 3000

b. Get the following output.

C001 JOHN 6000


C002 MIKE 4000
C003 ARNOLD 5000

a. Create an internal table to contain the following purchase details and populate
the internal table.

Purchase Customer Quantity Customer


order num name
number ber
6001 C001 10
6002 C002 20

- Page 1 of 5 -
Purchase Customer Quantity Customer
order num name
number ber
6003 C003 15

b. Create an internal table to contain the following customer details and populate
the internal table.

Customer Customer City


Num nam
ber e
C001 JOHN NEW YORK
C002 MIKE LONDON
C003 ARNOLD FLORIDA

c. Process the internal tables and get the following output from Purchase details
table (only).

6001 C001 10 JOHN


6002 C002 20 MIKE
6003 C003 15 ARNOLD

3. Create an internal table to contain the following data and populate it:

Airline Flight Flight Date


Carrier id Connection id
AA 0017 12.12.1999
DL 1984 06.05.2000
AA 0026 04.08.1999
UA 0941 11.11.2000
LH 1699 01.02.2000
LH 0026 01.29.1977

a. Display the following details from internal table. (Don’t use WHERE clause)
AA 0026 04.08.1999
b. Display all the “Lufthansa” flights’ information.
c. Display all the flights’ information that are scheduled after 01.05.2000.

4.
a. Create an internal table to contain the following data and populate it.

Employee number Employee name Salary


E001 MADHAVI 5000
E002 SEEMA 2000
E003 GEETA 3000
E001 MADHAVI 2500
E002 PRANATHI 2000
E003 GEETA 6000

- Page 2 of 5 -
b. Display the contents of this internal table.
c. Modify the contents of the internal table such that it contains only one record
per employee number and display the contents of the internal table. (Numeric
values need not be summed up).

5.
a. Create an internal table to hold the following data.

Airline Flight Maximum Seats


Flight date Plane type
carrier ID connection ID capacity occupied
LH 400 02/28/1995 A319 350 100
LH 400 02/28/1996 A319 350 100
LH 400 02/28/2001 A319 350 100
LH 400 12/01/2001 A319 150 100

b. Display the contents of the internal table in the following tabular format.

6. Create an internal table to hold the following data. Ensure that there is no include
statement or occurs clause in the program. Display the contents of the internal
table.

Name of the Programmer Date of birth Proficiency


ALTAF 07/02/1961 CLIPPER
ANAND 04/12/1966 PASCAL
JULIANA 01/31/1968 COBOL
KAMALA 10/30/1968 C
MARY 06/24/1970 CPP
NELSON 09/11/1985 COBOL

- Page 3 of 5 -
7. With out using the COLLECT statement display the output specified in question
#2.

8. Create two internal tables with the same structure and populate them with the
following data.
Contents of the first internal table:

Airline Flight
carrier id con
nec
tion
id
AA 0017
AI 0021
DL 1984
UA 0941
LH 1699

Contents of the second internal table:

Airline Flight
carrier id con
nec
tion
id
AA 0017
DL 1984
LI 0263
LH 1699

Store all the records that are present in only one of the above internal tables, in
another internal table, as follows:

Airline Flight Table row


carrier id con
nec
tion
id
AI 0021 A2
UA 0941 A4
LI 0263 B3

For the “table row” column, using A for the first table and B for the second table,
concatenate it with the row number of the record in the corresponding internal table.

9. Create two internal tables with the following structures and populate them as
follows:
Cust Id Name Hno Street City State Pin
1001 Rajesh 12 Wellington Road Hyd AP 500033
1002 Dravid 103 Arlington Road AP 500026

- Page 4 of 5 -
1003 Sachin 99 Gandhi Marg Secd AP 500021

Cust Id Item
1001 P0001
1001 P0002
1001 P0003
1001 P0004
1001 P0005
1001 P0006
1001 P0007
1002 P0001
1002 P0002
1003 P0001
1003 P0002
1003 P0003
1003 P0004

Display the data in the following format:


Customer Address Items

1001 Rajesh P0001


12 Wellington Road P0002
Hyd P0003
A.P – 500033 P0004
P0005
P0006
P0007
1002 Dravid P0001
103 Arlington Road P0002
AP – 500026

1003 Sachin P0001


9 Gandhi Marg P0002
Secd P0003
AP - 500021 P0004

********************The End*********************

- Page 5 of 5 -