Skip to Content
0
Dec 11, 2006 at 01:58 PM

How to Copy programmes with enhancement points?

117 Views

We need to make some customer require changes in transaction ME2o and therefore want to copy standard program RM06ELLB to new ZRM06ELLB.

In program RM06ELLB is used new technology of enhancement ENHANCEMENT-POINT (BADI).

After copy, source code inside enhancement in new program disappear (is not copied).

Copy of enhancement spot object (se18) is automatically assigned to oryginal program (RM06ELLB) and this assign can't be changed.

<b>Example in original programm:</b>

[code]

REPORT rm06ellb NO STANDARD PAGE HEADING MESSAGE-ID me.

ENHANCEMENT-POINT RM06ELLB_G4 SPOTS ES_RM06ELLB STATIC.

$$-Start: RM06ELLB_G4----


$$

ENHANCEMENT 67 MGV_GENERATED_RM06ELLB. "active version

INITIALIZATION.

DATA: mgv_matnr_prog LIKE rsvar-report,

mgv_matnr_selopt_tab like rsldbdfs occurs 0 with header line.

FIELD-SYMBOLS <mgv_matnr_selopt_conv> TYPE STANDARD TABLE.

ENDENHANCEMENT.

$$-End: RM06ELLB_G4----


$$

ENHANCEMENT-POINT RM06ELLB_G5 SPOTS ES_RM06ELLB.

$$-Start: RM06ELLB_G5----


$$

ENHANCEMENT 68 MGV_GENERATED_RM06ELLB. "active version

mgv_matnr_prog = sy-repid.

mgv_matnr_selopt_tab-name = 'S_BAUGR' .

append mgv_matnr_selopt_tab.

mgv_matnr_selopt_tab-name = 'S_MATNR' .

append mgv_matnr_selopt_tab.

call function 'MGV_SELOP_AFTER_INITIALIZATION'

EXPORTING

PROGRAM = mgv_matnr_prog

TABLES

SELOP = mgv_matnr_selopt_tab

EXCEPTIONS

NO_PROGRAMNAME = 1

OTHERS = 2

.

ENDENHANCEMENT.

[/code]

<b>Code after Copy in New programme:</b>

[code]

REPORT zrm06ellb NO STANDARD PAGE HEADING MESSAGE-ID me.

*ENHANCEMENT-POINT RM06ELLB_G4 SPOTS ES_RM06ELLB STATIC.

*ENHANCEMENT-POINT RM06ELLB_G5 SPOTS ES_RM06ELLB.

[/code]

<b>How can we copy source code with enhancements?</b>

Any Ideas ?

THANKS.