‎2010 Mar 17 2:48 PM
Dear all,
maybe I was misled by the impression that the coding of an enhancement is merged as soon as a load is generated and that the syntax-check consider original code as well as active enhancement as a whole.
If this would be the case, following example should work but since the compiler states that no open if statement exists, I have some doubts if I did not miss something essential here. Could anybody help?
Here goes the coding.
REPORT /sew/cotest1 .
TYPE-POOLS: abap.
DATA g_test TYPE abap_bool.
IF g_test = abap_true.
WRITE: 'TEST'.
ENHANCEMENT-POINT /SEW/COTEST1 SPOTS /SEW/COTEST1.
*$*$-Start: /SEW/COTEST1-------------------------------------------------$*$*
ENHANCEMENT 1 /SEW/COTEST1. "active version
else.
write: 'test'.
ENDENHANCEMENT.
*$*$-End: /SEW/COTEST1-------------------------------------------------$*$*
ENDIF.
The idea is that the normal if block is "enhanced" with an else block. The write statements do not make sense but this is not the point here. As soon as I try to activate the implementation of the inhancement I get the error message:
No open "IF" statement
The enhancment is only active because I said "Activate anyway"
Any ideas?
Thank you in advance.
Christian
Edited by: Rob Burbank on Mar 17, 2010 11:28 AM
‎2010 Mar 17 3:00 PM
its because the 'IF' part is in your report and the 'else' part is in the enhancement.
‎2010 Mar 17 3:29 PM
From the help for ENHANCEMENT:
>The control structures and processing blocks contained in the implementation must be complete.
Rob
‎2010 Mar 17 4:40 PM
Obviously this is the reason why.
Thank you for pointing that out.
Christian