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 - Can't activate post-exit method

Former Member
0 Kudos

Hello,

I'm facing an issue with my enhancement point: I can't activate it although I didn't write a single line of code in it! It is just a post-exit method for method CONVERT_IF_TO_UI of class CL_HRTMC_AC_DEV_PLAN.

I first faced another issue, so maybe my activation issue is related to this.

Let me describe the entire process, including the initial issue and how I solved it, and I hope somebody will tell me what I'm doing wrong.

  1. Opened SE80 for class CL_HRTMC_AC_DEV_PLAN
  2. Chose menu Class > Enhance
  3. A new window appears, with an "Enhancement Implementation" field where I typed "Z_MY_IMPLEMENTATION" and a description field where I typed some description
  4. Clicked on the "Validate" icon
  5. Prompted for a Transport Package. I chose Local Object because I'm doing some tests in Sandbox that we don't want to transport.
  6. Placed the cursor on the CONVERT_IF_TO_UI method and chose Edit > Enhancement Operations > Insert Post-Method.
  7. Got an error message saying "The class has not yet been converted to the new class-local types". To solve this, the "trick" is to do Utilities > Convert class-local types. When prompted for Access Key, click on "Display" as many times as required. Success message "Class CL_HRTMC_AC_DEV_PLAN successfully converted". Maybe my issue comes from this "trick".
  8. Can now do Edit > Enhancement Operations > Insert Post-Method
  9. Window with question "Access to Private/Protected Components of ClassCL_HRTMC_AC_DEV_PLAN?". Clicked on "Yes".
  10. Clicked on the PostExit icon that just appeared.
  11. Prompted for saving, clicked on "Yes".
  12. Tried to activate -> Error message saying that I have problems. Chose "Display Errors"
  13. Error is "Enhancement Implementation Z_MY_IMPLEMENTATION. Type "LCL_Z_MY_IMPLEMENTATION" is unknown" (Row 30). When I click on it, it brings me to the Enhancement Include tab of the Implementation Overview. Row 30 contains code "CREATE OBJECT LCL_Z_MY_IMPLEMENTATION=>OBJ"

As you can see, I didn't write a single line of code and I get an error. Needless to say, if I write some code, I still get the error.

Thanks in advance for your help!

2 REPLIES 2

Clemenss
Active Contributor
0 Kudos

Hi Mateo,

interesting. You gave pretty much detail. Can you say where LCL_Z_REMOVE_ADD_QUALIF_DEV is defined as a class?

If it's a global class, then it should be activated.

If it's a local class, then make sure that it is visible here. I think, only global classes can be accessed in Post-Method enhancements because there is no enhancement available to add a local class to an existing class.

Regards

Clemens

Former Member
0 Kudos

Sorry, I did a mistake when I copied/pasted: there's no LCL_Z_REMOVE_ADD_QUALIF_DEV

I updated the original post with:

Row 30 contains code "CREATE OBJECT LCL_Z_MY_IMPLEMENTATION=>OBJ"

This class has been automatically created and its definition is located just before the post exit method:


CLASS LCL_Z_MY_IMPLEMENTATION DEFINITION DEFERRED.
CLASS CL_HRTMC_AC_DEV_PLAN DEFINITION LOCAL FRIENDS LCL_Z_MY_IMPLEMENTATION.
CLASS LCL_Z_MY_IMPLEMENTATION DEFINITION.
PUBLIC SECTION.
CLASS-DATA OBJ TYPE REF TO LCL_Z_MY_IMPLEMENTATION. "#EC NEEDED
DATA CORE_OBJECT TYPE REF TO CL_HRTMC_AC_DEV_PLAN . "#EC NEEDED
INTERFACES  IPO_Z_MY_IMPLEMENTATION.
  METHODS:
   CONSTRUCTOR IMPORTING CORE_OBJECT
     TYPE REF TO CL_HRTMC_AC_DEV_PLAN OPTIONAL.
ENDCLASS.
CLASS LCL_Z_MY_IMPLEMENTATION IMPLEMENTATION.
METHOD CONSTRUCTOR.
  ME->CORE_OBJECT = CORE_OBJECT.
ENDMETHOD.

METHOD IPO_Z_MY_IMPLEMENTATION~CONVERT_IF_TO_UI.
*"------------------------------------------------------------------------*
*" Declaration of POST-method, do not insert any comments here please!
*"
*"methods CONVERT_IF_TO_UI
*"  importing
*"    !S_IF_DOCUMENT type HAP_S_DOCUMENT
*"  changing
*"    !S_UI_DOCUMENT type HRTMC_S_WD_DP_DOCUMENT
*"    !S_UI_NAVIGATION type HAP_S_WD_PMP_NAVIGATION .
*"------------------------------------------------------------------------*

ENDMETHOD.
ENDCLASS.