Image: In the following ABAP SQL code, what are valid case distinctions? Note: There are 2 correct answers to this question.
Correct Answer: C,D
Question 32
Which of the following string functions are predicate functions? Note: There are 2 correct answers to this question.
Correct Answer: B,D
Explanation String functions are expressions that can be used to manipulate character-like data in ABAP. String functions can be either predicate functions or non-predicate functions. Predicate functions are string functions that return a truth value (true or false) for a condition of the argument text. Non-predicate functions are string functions that return a character-like result for an operation on the argument text1. 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' ). References: 1: String Functions - ABAP Keyword Documentation
Question 33
What are valid statements? Note: There are 2 correct answers to this question.
Correct Answer: A,B
Explanation Both statements are valid in ABAP, but they have different effects on the program. ##NEEDED is a pragma that can be used to hide warnings from the ABAP compiler syntax check. It tells the check tools that a variable or a parameter is needed for further processing, even if it is not used in the current statement. For example, if you declare a variable without assigning any value to it, you can use ##NEEDED to suppress the warning about unused variables12. The pragma is not checked by the syntax checker means that you can use any pragma to hide any warning from the ABAP compiler syntax check, regardless of its effect on the program logic or performance. For example, if you use ##SHADOW to hide a warning about an obscured function, you can also use it to hide a warning about an invalid character in a string12. You cannot do any of the following: #EC_NEEDED is not checked by the syntax checker: This is not a valid statement in ABAP. There is no pseudo-comment with #EC_NEEDED in ABAP3. The pseudo-comment is checked by the syntax checker: This is false. Pseudo-comments are obsolete and should no longer be used in ABAP. They were replaced by pragmas since SAP NW 7.0 EhP2 (Enhancement Package)4. References: 1: Pragmas - ABAP Keyword Documentation - SAP Online Help 2: [What are pragmas and pseudo comments in ABAP? | SAP Blogs - SAP Community] 3: ABAP Keyword Documentation - SAP Online Help 4: What are PRAGMAS and Pseudo comments in SAP ABAP
Question 34
Which type of legacy code does SAP recommend you eliminate when you review modifications as part of an SAP S/4HANA system conversion? Note: There are 2 correct answers to this question.
Correct Answer: B,D
SAP recommends that you eliminate the following types of legacy code when you review modifications as part of an SAP S/4HANA system conversion: Code that now is identical to a standard SAP object. This type of code is redundant and unnecessary, as it does not provide any additional functionality or customization. It can also cause conflicts or errors during the system conversion, as the standard SAP object may have changed or been replaced in SAP S/4HANA. Therefore, you should delete this type of code and use the standard SAP object instead. Code that can be redesigned as a key user extension. This type of code is usually related to UI or business logic adaptations that can be achieved using the in-app tools provided by SAP S/4HANA. By redesigning this type of code as a key user extension, you can simplify and standardize your code base, reduce maintenance efforts, and avoid compatibility issues during the system conversion. Therefore, you should migrate this type of code to the key user extensibility framework and delete the original code. The other types of legacy code are not recommended to be eliminated, as they may still be relevant or necessary for your business processes. However, you should still review and adjust them according to the SAP S/4HANA simplification items and best practices. These types of code are: Code that supports a critical business process. This type of code is essential for your business operations and cannot be easily replaced or removed. However, you should check if this type of code is compatible with SAP S/4HANA, and if not, you should adapt it accordingly. You should also consider if this type of code can be optimized or enhanced using the new features and capabilities of SAP S/4HANA. Code that has less than 10% usage according to usage statistics. This type of code is rarely used and may not be worth maintaining or converting. However, you should not delete this type of code without verifying its relevance and impact on your business processes. You should also consider if this type of code can be replaced or consolidated with other code that has higher usage or better performance.
Question 35
What is the purpose of a foreign key relationship between two tables in the ABAP Dictionary?
Correct Answer: B
The purpose of a foreign key relationship between two tables in the ABAP Dictionary is to ensure the integrity of data in the corresponding database tables. A foreign key relationship defines a logical link between a foreign key table and a check table, where the foreign key fields of the former are assigned to the primary key fields of the latter. This means that the values entered in the foreign key fields must exist in the check table, otherwise the system will reject the entry. This way, the foreign key relationship prevents the insertion of invalid or inconsistent data in the database tables. A foreign key relationship also serves to document the relationship between the two tables in the ABAP Dictionary, but this is not its primary purpose. A foreign key relationship does not necessarily create a corresponding foreign key relationship in the database, as this depends on the database system and the settings of the ABAP Dictionary. Some database systems do not support foreign keys at all, while others require additional steps to activate them. Therefore, the foreign key relationship in the ABAP Dictionary is mainly a logical concept that is enforced by the ABAP runtime environment. References: Foreign Keys (SAP Library - ABAP Dictionary), Foreign Keys (SAP Library - BC - ABAP Dictionary) https://help.sap.com/doc/saphelp_snc70/7.0/en-US/cf/21ea77446011d189700000e8322d00/content.htm