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

Enhancement Sections???

Former Member
0 Likes
1,524

Hi,

I cannot seem to figure this out. I have a form routine i Standard SAP

in main program SAPMV60A.

Here there is an enhancement section XVBRP_MARKIEREN_01 (see below).

We have actived an industry solution, which means that the enhancement

section below has two implementations:

DIMP_GENERAL_SAPMV60A

OID_EXTD_SAPMV60A

When debugging it seems that only one of them is executed

(DIMP_GENERAL_SAPMV60A). Can an enhancement section only have one

implementation? Is it by chance which one of the two gets executed?

If I decide to have a 3 implementation, creating my own implementation

of the enhancement section XVBRP_MARKIEREN_01. This coding is not

executed. Still the former implementation (DIMP_GENERAL_SAPMV60A) is

executed.

Am I not able to overwrite existing enhancement section

implementations of an industry solution?

Maybe there is a documentation on this area I havent found yet.

Maybe someone has some answers. We are on ECC 604 (Enhancement Pack 4)

Best regards,

Martin

FORM XVBRP_MARKIEREN.

DATA: LOC_CHAR_FIELD(20) TYPE C.

  • Reset MSGID für XVBRP_LESEN

CLEAR: SY-MSGID.

DATA: BEREITS_MARKIERT.

ENHANCEMENT-SECTION XVBRP_MARKIEREN_01 SPOTS ES_SAPMV60A.

IF FCODE = 'FPDE' ...

...

END-ENHANCEMENT-SECTION.

$$-Start: XVBRP_MARKIEREN_01----

-


$$

ENHANCEMENT 3 DIMP_GENERAL_SAPMV60A. "active version

  • Former Switches /NFM/SD_SAPMV60A; AD_BOS_01_SAPMV60A

IF FCODE = 'FPDE' ...

...

ENDENHANCEMENT.

ENHANCEMENT 1 OID_EXTD_SAPMV60A. "active version

IF FCODE = 'FPDE' ...

...

ENDENHANCEMENT.

$$-End: XVBRP_MARKIEREN_01----

-


$$

IF FCODE = 'MKAL'.

XVBRP_TABIX = XVBRP_ERSTER.

WHILE XVBRP_TABIX LE XVBRP_LETZTER.

READ TABLE XVBRP INDEX XVBRP_TABIX.

IF SY-SUBRC = 0.

XVBRP-SELKZ = 'X'.

MODIFY XVBRP INDEX XVBRP_TABIX.

ENDIF.

ADD 1 TO XVBRP_TABIX.

ENDWHILE.

ENDIF.

IF FCODE = 'MKLO'.

XVBRP_TABIX = XVBRP_ERSTER.

WHILE XVBRP_TABIX LE XVBRP_LETZTER.

READ TABLE XVBRP INDEX XVBRP_TABIX.

IF SY-SUBRC = 0 AND XVBRP-SELKZ = 'X'.

XVBRP-SELKZ = ' '.

MODIFY XVBRP INDEX XVBRP_TABIX.

ENDIF.

ADD 1 TO XVBRP_TABIX.

ENDWHILE.

ENDIF.

ENDFORM.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,037

hi read the last line of the below mentioned blog ie Caution: [https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=77988719] regards surender.s

6 REPLIES 6
Read only

nitesh_jain3
Active Participant
0 Likes
1,037

Dear Claus,

Whatever i have read & understood about Enhancement Sections, it can have only one active implementations at run time. In this case the two active implementation are one each for Automotive Industry Solution (DIMP_GENERAL_SAPMV60A) and the other for Oil IS (OID_EXTD_SAPMV60A). In your system from the information that you have provided, i can infer DIMP is active and Oil IS is not active (Switched Off). Since DIMP is active, the implementation DIMP_GENERAL_SAPMV60A is executed. In case you need to have a custom implementation then you would need to replace this specific implementation. If Oil IS would have been active in your system then the implementation OID_EXTD_SAPMV60A would have been executed and NOT DIMP_GENERAL_SAPMV60A.

Please note replacing standard implementation have to be done very very judiciously from the maintenance perspective and normally should be avoided. It would be better to find an Enhancement Point where multiple implementation would be possible.

Some useful blogs by Thomas Weiss of SAP would be worth a read to get a good insight into this new Enhancement / Switch framework concepts:

[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8021] [original link is broken] [original link is broken] [original link is broken];

[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8048] [original link is broken] [original link is broken] [original link is broken];

[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8108] [original link is broken] [original link is broken] [original link is broken];

[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8310] [original link is broken] [original link is broken] [original link is broken];

[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8216] [original link is broken] [original link is broken] [original link is broken];

[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8311] [original link is broken] [original link is broken] [original link is broken];

[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8312] [original link is broken] [original link is broken] [original link is broken];

[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/12225] [original link is broken] [original link is broken] [original link is broken];

In case you have any further queries, shoot at will.

Cheers

Nitesh

Read only

naimesh_patel
Active Contributor
0 Likes
1,037

I guess only One Source Code can be active. This status is derived based on its switch status.

From SAP Keyword help: http://help.sap.com/abapdocu/en/ABAPENHANCEMENT-SECTION.htm

When the program is generated, exactly one source code plug-in replaces the assigned enhancement implementation whose switch has the status stand-by or on. If no switch is assigned to a source code plug-in, it is treated as if the switch is in the status on.

....

If several source code plug-ins are found when the program is executed with the switch position on or stand-by, a conflict resolution is performed internally and the primary conflict resolving enhancement implementation is used. If there are several high priority conflict resolving enhancement implementations or if there are none, then correct conflict resolution is not possible. Instead, one of the primary conflict resolving enhancement implementations or one of the conflict resolving enhancement implementations is used. Exactly which one is used is the same for each program execution, but is otherwise undefined.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
1,038

hi read the last line of the below mentioned blog ie Caution: [https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=77988719] regards surender.s

Read only

Former Member
0 Likes
1,037

Thanks for your replies. To me as a customer making customer ABAP enhancements this means: DON'T USE ENHANCEMENT SECTIONS for adding customer functionality, if you have switched on an industry solution. Either SAP has delivered a solution for an enhancement section (you don't want to modify this one, mod. assistent is not supported), or if not, our implementing of an enhancement section might be overwritten by an Support Package or SPStack from SAP. The latter could also mean, i am stuck with my implementation, and standard industry implementation from SAP will not be activated.

Read only

0 Likes
1,037

Hi Claus,

Replacing a standard implementation will have its overheads as you have stated.. In case one decides to do so then ofcourse one needs to monitor the modifications which SAP has done with laters SPs, which will need to be incorporated in your custom implementation. In the future if SAP delivers the solution for which you needed to replace the standard implementation earlier you can always delete your custom implementation, after which the standard SAP implementation takes over.

Possible solution in your specific case could be:

1. Use modification assistant to create a Custom Enhancement Point and then create an implementation for this enhancement point. This way the standard enhancement implementation remains & is executed as it is. Subsequent changes via SPs also become effective.

2. Implicit enhancement option can also be explored

regards

Nitesh

Read only

thomas_weiss
Product and Topic Expert
Product and Topic Expert
0 Likes
1,037

1. In general, there should be only one active implementation for an enhancement section.

2. In case, there are several implementations of an enhancement section, the first one in alphabetical order is processed.

3. As already stated, overwriting or replacing an enhancement causes higher maintenance effort. So implementing an enhancement point which can have many implementations is the better choice.

4. For reasons of mainentance the solution shown above to create an enhancement point by modification instead of replacing an enhancement is also a good solution.