Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

i want code for these programs

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 doesn’t specify a value for N, retrieve all the customers.

6) Write a program to display top three records from SFLIGHT which have the highest flight price for a given airline carrier. If the user doesn’t specify an airline carrier, display the information for all the airline carriers.

Display the following details in the list.

a) CARRID, CONNID, FLDATE, PRICE.

b) Print the summary information for each flight & for each airline.

7) Create an include program for all the data declarations needed, to display the following information from tables SBOOK and SCUSTOM.

CARRID CONNID FLDATE CUSTOMID NAME WUNIT

AI 0001 02/28/1996 00000012 RADETZKY KG

AI 0002 02/28/1997 00000020 BECKER KG

AI 0003 02/28/1998 00000035 BRUCHER KG

-- -


-


-


-


-


-- -


-


-


-


-


Write a program using the above include program, and display details for the user specified combination of airline carrier and connection, from the tables SBOOK and SCUSTOM in the format given above.

8) Write a program to perform the following:

a) Display the names and ages in years, of all the programmers.

b) Calculate and display the average selling cost for packages that have been developed in Pascal.

c) Display the names and dates of birth of all programmers born in January.

d) Determine as to which package sold the highest number of copies. Display the name and number of copies sold by that particular package.

e) Display the total number and names of programmers who have done the PGDCA course.

f) Display the details of packages whose sales (sales cost * number of copies sold) crossed the 7000 mark.

g) Display the revenue earned through the sales of packages developed in “C”. Revenue should be calculated as the difference between sales and the development cost.

h) Display the details of the packages for which development costs have been recovered, i.e. Sales for that package is greater than the cost for development of the package

i) Display the cost and the name of the costliest software package (with respect to dev cost) developed in each language.

j) Display the age of the oldest male programmer.

k) Display the experience (in years) of each programmer along with his or her name. (In both ascending & descending order of their experience).

l) Display the list of all the programmers who celebrate their birthday during the current month.

m) Display each language name, with average development cost, average selling cost and average price per copy of packages developed in that language.

n) Display all the programmers’ details along with the costliest and cheapest packages developed by them.

o) Display the programmer-wise details of each package, for which the Development cost has not yet been recovered i.e. the Sales revenue is less than the development cost. Display the following details in the list, Programmer name, package name, total development cost, sales revenue and the amount that is yet to be recovered for that package.

p) Display the details of the least & the most experienced programmers

q) Display the language, which is known by only one programmer.

r) Display the language that is used to develop the most number of packages.

s) Display the details of the programmers and the cheapest packages developed by them in each language.

t) Display the language used by each programmer to develop the highest and lowest selling cost packages.

u) Display the number and names of packages developed by the female programmers whose salary is more than the highest paid male programmer.

9) 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.

10) 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

-


-


-


-


Sales document 2

Sales document item 1 Material 1

Sales document item 2 Material 2

-


-


-


-


11) 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

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question