ABAP Exercises00
ABAP Exercises00
2. Create a Vendor database table with fields, Id, name, and address structure
created in Q1.
3. Create a maintenance screen for the above table and assign a transaction
code. Use the transaction code to maintain the table and create entries in it.
4. Create a database view V_DBMARA for MARA and try to maintain it creating
entries through the view and see if the table MARA gets updated.
5. Create a database view V_DBSO for EKKO and EKPO and try to maintain it
updating the records in it through the view and see if the tables EKKO and
EKPO gets updated.
6. Create a Projection view V_PJLFA1 for LFA1. What’s the difference do you
observe?
7. Create a maintenance view V_MTPO for EBELN and EBELP and try to
maintain its records through the view and see if the tables EBELN and
EBELP get updated.
9. List the differences between a Maintenance view, Database view and a Help
view
a. Vendors by company
b. Vendors by material
c. Vendors by country
11.Create a collective search help and include all the elementary search helps
created in Q10.
12.Create lock objects for the table created in Q1. Check the function modules
created.
13.Write a program to update the table you have created in Q1. Use the lock
objects created for the tale in Q12.
Internal Tables
1. Create an internal table taking all the fields from BKPF and display fields
company code, document number, document type and date of document.
(use ALV and use REUSE_FIELD_CATALOGUE_MERGE Function Module)
2. Create and internal table taking fields company code, document number,
account type and tax code from table BSEG and display the same with
column heading. (Classical report)
- Date, name of the user and sales document type from table VBAK and
price group and customer group from table VBKD
- Sort the table according to material number and display the contents
- Also create a field string F_BSIS. Populate the internal table with the
contents of BSIS. Sort the table according to company code and display
contents.
5. Determine for each material type (MTART) the 5 table entries with the
highest gross weight (as a ranked list).
- To do this read the table MARA and store the material type (MTART)
material number (MATNR), unit of measure (MEINS) and gross weight
(BRGEW) into an internal table.
6. Create a list of the maximum number of available seats for each CARRIER.
To do this read the table SFLIGHT and store the airline carried id (CARRID)
and the maximum number of seats (SEATSMAX) in an internal table.
Determine the total number of seats for each airline carrier when filling the
internal table.
7. Read the table SFLIGHT into an internal table and then output the internal
table with the fields CARRID, FLDATE and PRICE.
- Delete all the internal table entries where the airline carrier (CARRID) is
not equal to LH. Read the internal table with entry with the key CARRID
= LH and CONNID = 0400, multiply the price by 3 and write the modified
entry back to the internal table. Then output the internal table.
8. Read table TABNA into internal table and output the fields.
- Country, id, name1 and sales. sort the table with country
- Delete all internal table lines with sales lower that 50,000
- Read internal table with key ’GB’ and ‘00000003’ and multiply the sales
by 3 and change table entry
- Find out how many lines are there in the internal table
- Clear header for internal table each time your access a record.
10.Create a report which will give the existing stock for a material. The report
should have subtotal of the stock for each storage location and grand total
of the stock at the end of the plant.
- Material: select-options.
- Output as
- Output format
d. Read the internal tables for a specific record given in the second
input field ‘Search Item’ in the selection screen and print the time
taken for reading / searching the specified value through each
internal tables.
13.Pull the data from EKKO and EKPO into an internal table with a selection
criteria as sales document number as the range (select options) and display
the data in
a. Excel Sheet. The excel sheet should contain the Field Names in the
first column. Excel application should execute and should be
displayed to the user. (Use EXCEL_OLE_STANDARD_DAT)
b. Show into the HTML format and should be displayed in the browser.
Subroutines
1. Read the number between 0 and 100 and another digit between 0 and 9.
write a subroutine that will calculate the sum of all numbers (below the
limit) that end with the digit. The parameters to be passed are limit and
digit both by value and sum by reference.
- Ex if limit = 67 and digit = 4 then sum should be the sum of 4, 14, 24,
34, .........64
5. For each flight connection calculate the sales for all flights of an airline
carrier. Use internal table for calculating the sales. Use a subroutine for the
output by passing the internal table as the parameter.
1. Write a program to show the following using system variables (hint: use
include<symbol> and include <icon>
a. Symbols:
i. Telephone,
v. Caution.
b. Icons:
i. Checked,
ii. Okay
iii. Delete
iv. Print.
3. Use format intensified – format intensified off, format colour, format inverse.
Strings
E C
ECH
ECHO
ECH
EC
2. Create an output as shown below (input for the program say 5 thru selection
screen)
..
...
....
.....
6. Accept two stings and compare the two stings using ‘co’, ‘ca’, ‘cs’, ‘cp’.
(Output shall be ‘true’ or ‘false’ for each comparison.
Loops
1 1
2 4
3 9
2*1 = 2
2*2 = 4
2*10 = 20
3. Accept a number from user and find Factorial of the same. If the numbers is
negative then display some message.
5. Accept numbers and choice ‘EVEN’ or ‘ODD” from the user and display the
numbers in that range according to user’s choice.
9. Accept a number and print all the prime numbers starting from 1 till the
given number.
Date
1. Accept a date earlier to today’s date and fine the difference in number of
days.
2. Accept a date from user and display first day of the month and last day of
the previous month.
3. Accept a date form user and add six months to the date
4. Accept a date form user and convert month part to ‘Jan’, ‘Feb.’ etc. and
display this date
- Make use of
o Selection text.
6. Accept birth date form user and output age in years, months and days.
a. Parameter as checkboxes
iii. If checkbox 1 & 2 are clicked write c.b. 1 & c.b. 1 are clicked
iv. If checkbox 1 & 2 are not clicked write c.b. 1 & c.b. 2 are not
clicked.
- Give detailed coding as above, to show the radio buttons and groups
selected
- Parameter as checkbox
- If you click the checkbox the display first day of the next year
- If the checkbox is not clicked then display last day of the current year.
4. Write a program with
- If first radio button is clicked, display last day of the current month
Select statements
4. List all ERDAT’s for better readability create a column heading in the list
5. Display total amount for CARRID ‘LH’ (tables: SFLIGHT). Display the amount
also in words.
9. From the given FROM-CITY and TO-CITY , list all the available on this route,
- Tables SPFLI.
Open SQL
1. Accept document no. From user and display particulars of Sales Document.
(table VBAP)
2. Accept sales document no. From user and display corresponding material
no. Description of that material and item category (table VBAP)
3. Accept material no. & item category by default PP1000 and KMN
respectively display corresponding details of sales document (table VBAP)
6. Accept DOC.NO from user. Display doc. No. Doc status, date of doc. Doc
type
- Display document detail for the plant like DOC.NO... DOC.STATUS, DATE
OF DOCUMENT.
Module Pool
- Screen one:
- Screen two:
- Screen three:
- Screen one:
o Entry fields: MARD-MATNR, MARD-WERKS, MARD-LGORT
o Select the data from MARD into an internal table and whenever a
button is pressed display the corresponding record ( i.e. first,
next, previous, last using the internal table index)
- Place two pushbuttons ‘LIST’ and ‘ALV LIST’. When this button ‘LIST’ is
pressed display a list in classical reporting and ‘ALV LIST’ button is
pressed display an ALV list for the fields.
- Use LEAVE-TO-LIST-PROCESSING.
- Screen 3. Subscreen
- Screen 4. Subscreen
- When the display push button is clicked, display screen 2 with the proper
subscreen attached to it based on the selection of radio button. (i.e.,
screen3 if plant is selected and screen 4 if description is selected).
o Without using
4. Reuse_alv_events_get
5. Cover all the events... (Search and do it... don't leave anything)
11.How to add a custom (GUI element) button on the ALV application tool bar
and how to handle it.