0

programming languages Online Quiz - 131

Description: programming languages Online Quiz - 131
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

select flightnumber, date, destination, boarded + transferred + nonrevenue as Total from marchflights where total < 100; What will happen when this query is submitted ?

  1. Error: as mathematical computation is not allowed while using proc sql.

  2. ERROR: The following columns were not found in the contributing tables: total.

  3. 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.

  4. Error: variable total nor recognized(because there are two spelling - Total and total)


Correct Option: B

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

  1. proc sql; select membertype sum(milestraveled) as TotalMiles from frequentflyers group by membertype;

  2. proc sql; select membertype sum(milestraveled) as TotalMiles from frequentflyers order by membertype;

  3. proc sql; select membertype milestraveled sum(milestraveled) as TotalMiles from sasuser.frequentflyers group by membertype;

  4. proc sql; select membertype sum(milestraveled) from frequentflyers group by membertype;


Correct Option: A

What is the purpose of the following statement ---- PROC SQL OUTOBS= 10;

  1. This restricts the number of rows (observations) in the output to 10.

  2. Tells the system to process first 10 observation from a SAS dataset

  3. Restricts the system to read 10 observations.

  4. None of the above.


Correct Option: A

Must Exits be predefined by SAP programmers?

  1. No

  2. Yes

  3. Customers can determine for themselves where they want to use exits

  4. None of the Above


Correct Option: B

AI Explanation

To answer this question, you need to understand the concept of exits in SAP programming.

Exits in SAP programming are predefined points in the system where additional or custom logic can be added to enhance the standard functionality. These exits are typically provided by SAP programmers to allow customers to modify or extend the behavior of the system without changing the standard code.

Based on this understanding, the correct answer is:

B) Yes - Exits in SAP programming are indeed predefined by SAP programmers to provide customers with the ability to customize or enhance the system's functionality.

What is a structured type in the ABAP dictionary that has no physical table defintion in the underlying database referred to as?

  1. table

  2. structured data type

  3. structure

  4. table type


Correct Option: D

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'

  1. sy-fdpos = 0 and sy-subrc = 0

  2. sy-fdpos = 0 and sy-subrc = 4

  3. sy-fdpos = 4 and sy-subrc = 0

  4. sy-fdpos = 4 and sy-subrc = 4


Correct Option: B

AI Explanation

To answer this question, we need to understand the behavior of the SEARCH statement in ABAP.

The SEARCH statement is used to search for a specified substring within a given string. It returns the position of the substring within the string in the field sy-fdpos. If the substring is not found, it sets the field sy-subrc to 4.

In this case, the given string is 'ARAMCO' and we are searching for the substring 'X'.

Since the substring 'X' is not present in the string 'ARAMCO', the SEARCH statement will not find a match. Therefore, the value of sy-fdpos will be 0, indicating that the substring was not found.

Additionally, since the substring was not found, the sy-subrc field will be set to 4, indicating that the search was unsuccessful.

Based on this information, the correct answer is B) sy-fdpos = 0 and sy-subrc = 4.

Mark the default size for a packed field

  1. 1

  2. 2

  3. 4

  4. 8


Correct Option: D

Which of the following is not a valid ABAP data statement?

  1. Data fielda(5) type c

  2. Data fielda(5) type n

  3. Data fielda(5) type t

  4. Data fielda(5) type x


Correct Option: C

AI Explanation

To answer this question, we need to understand the different types of ABAP data statements and determine which one is not valid.

Option A) Data fielda(5) type c - This option is valid. It declares a character type data field named 'fielda' with a length of 5.

Option B) Data fielda(5) type n - This option is valid. It declares a numeric type data field named 'fielda' with a length of 5.

Option C) Data fielda(5) type t - This option is not valid. 't' is not a valid data type in ABAP.

Option D) Data fielda(5) type x - This option is valid. It declares a hexadecimal type data field named 'fielda' with a length of 5.

The correct answer is C. This option is not valid because 't' is not a valid data type in ABAP.

How can you perform a direct database read from a buffered table?

  1. Do not have buffering in the technical attributes

  2. Add the BYPASSING BUFFER clause on the select statement

  3. Buffering can be turned off on the application server by the programmer using the ABAP Workbench

  4. None of the Above


Correct Option: B

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.

  1. ABCDE

  2. Spaces

  3. ABCD

  4. BCDE


Correct Option: B
Explanation:

To solve this question, the user needs to understand the basics of SAP ABAP and how it handles character fields.

The given code initializes a character array ZFIELDA with the value 'ABCDE'. It also defines another character field ZFIELDB of length 4.

The second line doesn't assign any value to ZFIELDB. So, it will be initialized to spaces.

The third line assigns the value 'XX' to ZFIELDA. So, the value of ZFIELDA will be 'XX'.

The fourth line clears the value of ZFIELDA. So, the value of ZFIELDA will be '' (empty string).

The fifth line assigns the value of ZFIELDA to ZFIELDB. Since ZFIELDB is of length 4, it can only hold 4 characters. The value of ZFIELDA is 'XX', which is of length 2. So, the value of ZFIELDB will be 'XX ' (two spaces at the end to fill up the remaining characters).

Therefore, the answer is:

The Answer is: B. Spaces

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

  1. c&d

  2. a&d

  3. a&b

  4. c&b


Correct Option: B

When catching errors using the CATCH…ENDCATCH statement, where does the runtime error return code get placed?

  1. sy-subrc

  2. sy-fdpos

  3. error class

  4. system-exceptions


Correct Option: D

When is it better to buffer the table?

  1. When a table is read infrequently

  2. When a table is read frequently and the data seldom changes

  3. When a table is read frequently and the data is always changing

  4. When a table is linked to check tables


Correct Option: B

Which is not a valid option of the Write Statement?

  1. NO-GAP

  2. Input

  3. Centered

  4. Under

  5. No-Zero


Correct Option: B

Which Report Statement option determines the width of a list?

  1. Line-Size

  2. Line-Count

  3. Line-Width

  4. Report Size


Correct Option: A

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?

  1. Icode-field2 must be a numeric field.

  2. The internal table has an incorrect structure.

  3. Both internal table fields must be used in the search.

  4. The internal table must be sorted first.

  5. 'John' should not be capitalized.


Correct Option: D

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.

  1. a

  2. b

  3. c

  4. d


Correct Option: C

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

  1. a

  2. b

  3. c

  4. d

  5. e


Correct Option: A

AI Explanation

To determine the contents of the itab internal table after executing the given code, let's go step by step:

  1. Move: 'A' to itab-field1, 'B' to itab-field2. - This moves the values 'A' and 'B' to itab-field1 and itab-field2 respectively. So, itab now contains one entry with field1 as 'A' and field2 as 'B'.

  2. Append itab. - This appends the current contents of itab to itab. So, itab now contains two entries with field1 as 'A' and field2 as 'B'.

  3. Append itab. - This appends the current contents of itab to itab again. So, itab now contains three entries with field1 as 'A' and field2 as 'B'.

  4. Move: 'B' to itab-field1. - This moves the value 'B' to itab-field1. So, the first entry in itab now has field1 as 'B' and field2 as 'B'.

  5. Append itab. - This appends the current contents of itab to itab. So, itab now contains four entries with field1 as 'B' and field2 as 'B'.

  6. Clear itab. - This clears the contents of itab.

  7. Move: 'A' to itab-field2. - This moves the value 'A' to itab-field2. So, the first entry in itab now has field1 as 'B' and field2 as 'A'.

  8. Append itab. - This appends the current contents of itab to itab. So, itab now contains one entry with field1 as 'B' and field2 as 'A'.

Therefore, the contents of itab after executing the code are:

A B B A

So, the correct answer is A.

To allow the user to enter a range of values on a selection screen, use the ABAP keyword:

  1. DATA

  2. RANGES

  3. PARAMETERS

  4. SELECT-OPTIONS


Correct Option: D

Which keyword adds rows to an internal table while accumulating numeric values?

  1. INSERT

  2. APPEND

  3. COLLECT

  4. GROUP


Correct Option: C

AI Explanation

To answer this question, you need to understand how internal tables work in programming languages like ABAP.

Option A) INSERT - This option is incorrect because the INSERT keyword is used to insert individual records into an internal table. It does not accumulate or add rows with numeric values.

Option B) APPEND - This option is incorrect because the APPEND keyword is used to add individual records to the end of an internal table. It does not accumulate or add rows with numeric values.

Option C) COLLECT - This option is correct because the COLLECT keyword is used to accumulate numeric values in an internal table. When used with a numeric field, it adds the values of the field in each row to a specified field in a target line of the internal table. This allows for the aggregation or accumulation of numeric values.

Option D) GROUP - This option is incorrect because the GROUP keyword is used to group and summarize data in an internal table based on specified key fields. It does not add rows with numeric values.

The correct answer is C) COLLECT. This option is correct because it is used to add rows to an internal table while accumulating numeric values.

- Hide questions