Application Development 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: 

Enhancement sections:- More than one implementation.

Former Member
0 Kudos

Hi Experts,

I have created one enhancement spot, with two implementations, see the image below. Both implementations are assigned to the same package. When I run the program, only enhancement 1 that is implementation "ZSAC_IMP1" is executed, but I want second implementation to execute and first one to suppress/deactivate, how could I do it, kindly suggest.

Moreover, if only one implementation can be created for an enhancement section, then why does SAP allow us to create more than one implementation, I believe there is some reason behind it, please could anyone share some thoughts on this topic.

 

I have written the same code here:

DATA: i TYPE i.

START-OF-SELECTION.

i = 20.

ENHANCEMENT-SECTION ZSAC_TEST1 SPOTS ZSAC_SPOT1 .
  DO  i TIMES.
    WRITE : 'Hello'.
  ENDDO.
END-ENHANCEMENT-SECTION.

*$*$-Start: ZSAC_TEST1--------------------------------------------------------------------------$*$*

ENHANCEMENT 1  ZSAC_IMP1.    "active version
  DO  i TIMES.
    WRITE : 'sachin'.
  ENDDO.
ENDENHANCEMENT.

ENHANCEMENT 1  ZSAC_IMP2.    "active version
  write : '/'.
  DO  i TIMES.
    WRITE'sharma'.
  ENDDO.
ENDENHANCEMENT.

*$*$-End:   ZSAC_TEST1--------------------------------------------------------------------------$*$*

you can copy paste the above code and try.

3 REPLIES 3

former_member1716
Active Contributor
0 Kudos

Hi Sachin,

For deleting an enhancement you have to do the following steps:

1) Go to your enhancement point and click on the Enhance icon as marked below.

2) Now place the cursor on the start of the enhancement (Where you have named it- Line Number 25 or 32 as in your screen shot), and then right click and navigate as shown below,

Now on clicking the Undo Implementation you will be able to achieve your requirement. On creating multiple enhancements part, we can create 2 or more enhancements in a sub routine of user exits but am not sure on the restriction with respect to Enhancement spot.

Please get back for further queries.

Regards,

Satish

0 Kudos

Hi Satish,

Thanks for the reply, but still my question is not answered, I want to know how could I activate or deactivate one of the two implementations at a time.

I searched for this question's answer at many places, but couldn't get it, none of my friends or colleagues knows about it.

Regards,

Sachin

0 Kudos

Hi Sachin,

You have to undo the implementation to make it ineffective, which I have explained above. You cannot deactivate your enhancement as we do in BADI Implementation.

Regards,

Satish