ABAP and SAS Programming Quiz
Test your knowledge of ABAP programming concepts including internal tables, data types, SQL operations, and SAS PROC SQL statements
Questions
select flightnumber, date, destination, boarded + transferred + nonrevenue as Total from marchflights where total < 100; What will happen when this query is submitted ?
- Error: as mathematical computation is not allowed while using proc sql.
- ERROR: The following columns were not found in the contributing tables: total.
- Warning : the type of the variable total is not declared(character or numeric).But due to automatic conversion, some unexpected value is being populated in variable total.
- Error: variable total nor recognized(because there are two spelling - Total and total)
Which Proc sql will be used to determine the total number of miles traveled by frequent-flyer program members in each of three membership classes (Gold, Silver, and Bronze). Frequent-flyer program information is stored in the table Frequentflyers. MemberType TotalMiles Bronze 908786767 Gold 57665868 Silver 34343656
- proc sql; select membertype sum(milestraveled) as TotalMiles from frequentflyers group by membertype;
- proc sql; select membertype sum(milestraveled) as TotalMiles from frequentflyers order by membertype;
- proc sql; select membertype milestraveled sum(milestraveled) as TotalMiles from sasuser.frequentflyers group by membertype;
- proc sql; select membertype sum(milestraveled) from frequentflyers group by membertype;
What is the purpose of the following statement ---- PROC SQL OUTOBS= 10;
- This restricts the number of rows (observations) in the output to 10.
- Tells the system to process first 10 observation from a SAS dataset
- Restricts the system to read 10 observations.
- None of the above.
Must Exits be predefined by SAP programmers?
- No
- Yes
- Customers can determine for themselves where they want to use exits
- None of the Above
What is a structured type in the ABAP dictionary that has no physical table defintion in the underlying database referred to as?
- table
- structured data type
- structure
- table type
Refer to the following Code. What is the value of sy-fdpos and sy-subrc after the search is executed? Data: mystring type c value 'ARAMCO'. Search mystring for 'X'
- sy-fdpos = 0 and sy-subrc = 0
- sy-fdpos = 0 and sy-subrc = 4
- sy-fdpos = 4 and sy-subrc = 0
- sy-fdpos = 4 and sy-subrc = 4
Mark the default size for a packed field
- 1
- 2
- 4
- 8
Which of the following is not a valid ABAP data statement?
- Data fielda(5) type c
- Data fielda(5) type n
- Data fielda(5) type t
- Data fielda(5) type x
How can you perform a direct database read from a buffered table?
- Do not have buffering in the technical attributes
- Add the BYPASSING BUFFER clause on the select statement
- Buffering can be turned off on the application server by the programmer using the ABAP Workbench
- None of the Above
What is the value of ZFIELDB after the last line of the following code is executed? Data: ZFIELDA(5) type c value 'ABCDE'. ZFIELDB(4) type c. ZFIELDA = ‘XX’. Clear ZFIELDA. ZFIELDB = ZFIELDA.
- ABCDE
- Spaces
- ABCD
- BCDE
How would you clear the body of an internal table (with a header line). a) Clear ITAB[] b) Refresh ITAB [] c) Clear ITAB d) Refresh ITAB
- c&d
- a&d
- a&b
- c&b
When catching errors using the CATCH…ENDCATCH statement, where does the runtime error return code get placed?
- sy-subrc
- sy-fdpos
- error class
- system-exceptions
When is it better to buffer the table?
- When a table is read infrequently
- When a table is read frequently and the data seldom changes
- When a table is read frequently and the data is always changing
- When a table is linked to check tables
Which is not a valid option of the Write Statement?
- NO-GAP
- Input
- Centered
- Under
- No-Zero
Which Report Statement option determines the width of a list?
- Line-Size
- Line-Count
- Line-Width
- Report Size
An internal table icode contains the following entries: Field1 Field2 -------------- John 12345 Alice 23478 Sam 54321 john 50000 DATA: BEGIN OF ICODE OCCURS 0, FIELD1(5), FIELD2(5), END OF ICODE. READ TABLE ICODE WITH KEY FIELD1 = 'John' BINARY SEARCH. Why does executing the above code return a sy-subrc of 4?
- Icode-field2 must be a numeric field.
- The internal table has an incorrect structure.
- Both internal table fields must be used in the search.
- The internal table must be sorted first.
- 'John' should not be capitalized.
What is the fastest way to move one internal table to another internal table (assuming two tables of similar structure)? a) append lines of table1 to table2. b) loop at table1. Move: table1-field1 to table2-field1, table1-field2 to table2-field2. Append table2. Endloop. c) table2[] = table1[]. d) loop at table1. Move-corresponding table1 to table2. Endloop.
- a
- b
- c
- d
data: begin of itab occurs 0, field1(10), field2(10), end of itab. Move: 'A' to itab-field1, 'B' to itab-field2. Append itab. Append itab. Move: 'B' to itab-field1. Append itab. Clear itab. Move: 'A' to itab-field2. Append itab. What are the contents of itab after executing the above code? a) A B A B B B A b) A B A B B A c) A B B A d) A B B A A e) A B B A B A B A
- a
- b
- c
- d
- e
To allow the user to enter a range of values on a selection screen, use the ABAP keyword:
- DATA
- RANGES
- PARAMETERS
- SELECT-OPTIONS
Which keyword adds rows to an internal table while accumulating numeric values?
- INSERT
- APPEND
- COLLECT
- GROUP