In a subclass subl you want to redefine a component of a superclass superl. How do you achieve this? Note: There are 2 correct answers to this question.
Correct : A, C
To redefine a component of a superclass in a subclass, you need to do the following12:
You add the clause REDEFINITION to the component declaration in the subclass. This indicates that the component is inherited from the superclass and needs to be reimplemented in the subclass. The redefinition must happen in the same visibility section as the component declaration in the superclass. For example, if the superclass has a public method m1, the subclass must also declare the redefined method m1 as public with the REDEFINITION clause.
You implement the redefined component in the subclass. This means that you provide the new logic or behavior for the component that is specific to the subclass. The redefined component in the subclass will override the original component in the superclass when the subclass object is used. For example, if the superclass has a method m1 that returns 'Hello', the subclass can redefine the method m1 to return 'Hi' instead.
You cannot do any of the following:
You implement the redefined component for a second time in the superclass. This is not possible, because the superclass already has an implementation for the component that is inherited by the subclass. The subclass is responsible for providing the new implementation for the redefined component, not the superclass.
You add the clause REDEFINITION to the component in the superclass. This is not necessary, because the superclass does not need to indicate that the component can be redefined by the subclass. The subclass is the one that needs to indicate that the component is redefined by adding the REDEFINITION clause to the component declaration in the subclass.
Start a Discussions
Exhibit:
With Icl_super being superclass for Icl_subl and Icl_sub2 and with methods subl_methl and sub2_methl being subclass-specific methods of Id_subl or Icl_sub2, respectivel. What will happen when executing these casts? Note:
There are 2 correct answers to this question
Correct : A, D
The following are the explanations for each statement:
Start a Discussions
Which of the following string functions are predicate functions? Note: There are 2 correct answers to this question.
Correct : B, D
The following string functions are predicate functions:
B . contains_any_of(): This function returns true if the argument text contains at least one of the characters specified in the character set. For example, the following expression returns true, because the text 'ABAP' contains at least one of the characters 'A', 'B', or 'C':
contains_any_of( val = 'ABAP' set = 'ABC' ).
D . matches(): This function returns true if the argument text matches the pattern specified in the regular expression. For example, the following expression returns true, because the text 'ABAP' matches the pattern that consists of four uppercase letters:
matches( val = 'ABAP' regex = '[A-Z]{4}' ).
The following string functions are not predicate functions, because they return a character-like result, not a truth value:
A . find_any_not_of(): This function returns the position of the first character in the argument text that is not contained in the character set. If no such character is found, the function returns 0. For example, the following expression returns 3, because the third character of the text 'ABAP' is not contained in the character set 'ABC':
find_any_not_of( val = 'ABAP' set = 'ABC' ).
C . count_any_of(): This function returns the number of characters in the argument text that are contained in the character set. For example, the following expression returns 2, because there are two characters in the text 'ABAP' that are contained in the character set 'ABC':
count_any_of( val = 'ABAP' set = 'ABC' ).
Start a Discussions
After you created a database table in the RESTful Application Programming model, what do you create next?
Correct : B
The following code snippet defines a projection view ZI_AGENCY on the database table /DMO/AGENCY:
define view ZI_AGENCY as select from /dmo/agency { key agency_id, agency_name, street, city, region, postal_code, country, phone_number, url }
The following code snippet defines a service definition ZI_AGENCY_SRV that exposes the projection view ZI_AGENCY as an OData service:
define service ZI_AGENCY_SRV { expose ZI_AGENCY as Agency; }
You cannot do any of the following:
Start a Discussions
You have two internal tables itab1 and itab2.What is true for using the expression itab1 = corresponding #( itab2 )? Note: There are 2 correct answers to this question.
Correct : B, C
The expression itab1 = corresponding #( itab2 ) is a constructor expression with the component operator CORRESPONDING that assigns the contents of the internal table itab2 to the internal table itab1. The following statements are true for using this expression:
The following statements are false for using this expression:
Start a Discussions