Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sourcecode Plugin - no open "IF" Statement

ChristianFi
Active Participant
0 Likes
1,088

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

3 REPLIES 3
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
559

its because the 'IF' part is in your report and the 'else' part is in the enhancement.

Read only

Former Member
0 Likes
559

From the help for ENHANCEMENT:

>The control structures and processing blocks contained in the implementation must be complete.

Rob

Read only

0 Likes
559

Obviously this is the reason why.

Thank you for pointing that out.

Christian