What are valid statements? Note: There are 2 correct answers to this question.

What are valid statements? Note: There are 2 correct answers to this question.
A . ##NEEDED is checked by the syntax checker.
B . The pragma is not checked by the syntax checker.
C . #EC_NEEDED is not checked by the syntax checker.
D . The pseudo-comment is checked by the syntax checker

Answer: AB

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.

Reference: 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

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments