You are on page 1of 5

Exercise 02.

06 - ABAP Basics

Open-SQL
1. All the following objects to be created should follow a naming convention YEMPID_##$$
%%. ##$$ indicates the exercise number where as %% indicates the question number
in the exercise
2. Provide Column headings in the list wherever necessary and Selection Texts for Select
Options / Parameters on the selection screen.
3. Perform the necessary validations wherever necessary

1) Create a program to display the following fields from the table MARA:
Material number
Material type
Industry sector
Material group

At the end of the list, print the date and time when the list was created and by whom the user-id
of the person who created the list.

2) Write a program to accept a sales document number and a sales document item number
from the user and retrieve the following details from the table VBAP.
Material number
Net value of the order item
Cumulative order quantity in sales units

3) Write a program to accept the names of three columns and retrieve the user specified
columns from the table SPFLI/MARA/VBAK/KNA1.

4) Create a program to perform the following:


Accept a Sales document type from the user
Retrieve the details of all the sales documents whose type is same as the user entered
type, from the table VBAK.
Retrieve all the item details for each of these sales documents, from the table VBAP.
Display the data in the following format:

Sales Doc1 Sales org Distribution channel Division


Sales doc item1 Material
Sales doc item2 Material
Sales doc item3 Material
---------------------- -----------
---------------------- -----------
Sales Doc2 Sales org Distribution channel Division
Sales doc item1 Material
Sales doc item2 Material
Sales doc item3 Material
---------------------- -----------
---------------------- -----------

- Page 1 of 3 -
- Page 2 of 3 -
5) Write a program to perform the following:
Accept a number N and a range of company codes from the user.
Retrieve the first N customers from the table KNA1.
For each customer, retrieve the company codes it has been maintained for, (If the
company code falls within the user specified range) from the table KNB1.
Display the data in the ascending order of company codes for each customer, in the
following format.

Customer 1
Company code1
Company code2
----------------------
----------------------
Customer 2
Company code 3
-----------------------
-----------------------

If the user doesnt specify a value for N, retrieve all the customers.

6) Write a program to perform the following:


Accept a material type (field MTART in table MARA) from the user.
Display all the materials of the user specified material type. Also display the plants that
they have been maintained for, if any, in the following format:

Material1
Plant1
Plant2
---------
Material2
Plant1
Plant2
---------

NOTE:
a) Plant specific data for a material is available in the table MARC
b) Write two programs (a) & (b) with one making use of JOINS and the other without JOINS
to get the required output.

7) Write a program to perform the following using JOINS:


Accept a sales document type from the user. (Use table VBAK)
Display all the sales documents (of the user specified type) and their corresponding item
details whose net value (field NETWR in table VBAP) is less than 1000, in the following
format: (Use table VBAP)

Sales document 1
Sales document item 1 Material 1
Sales document item 2 Material 2

- Page 3 of 3 -
------------------------------ --------------
------------------------------ --------------

Sales document 2
Sales document item 1 Material 1
Sales document item 2 Material 2
------------------------------ --------------
------------------------------ --------------

8) Write a program to perform the following using only one SQL statement:
Accept a range of carrier id and connection id from the user.
Display the following flight details in the following format:
(Use the tables SPFLI, SFLIGHT, SBOOK, SCUSTOM)
CARRID CONNID CITYFROM
FLDATE PRICE
BOOKID
CUSTOMER NAME
BOOKID
CUSTOMER NAME
BOOKID
CUSTOMER NAME
FLDATE PRICE
BOOKID
CUSTOMER NAME
BOOKID
CUSTOMER NAME
BOOKID
CUSTOMER NAME

- Page 4 of 3 -

You might also like