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: 

Accessing Core_Object from Class in Post-Exit Enhacement

Former Member
0 Kudos

I have a class I need to enhance (Post Exit) and in this class I need to access some of the objects in the method itself which are being
used and I am not sure of how to do this. 

Just as a simple example  in my method I have the following Code (simple trimmed down version)

Data:

        lo_service_manager          TYPE REF TO cl_ehfnd_ena_service_mngr,

         lo_incident                      TYPE REF TO cl_ehfnd_ena_node,

        lo_inv_result_node          TYPE REF TO cl_ehfnd_ena_node,

        lo_inv_step_node            TYPE REF TO cl_ehfnd_ena_node.

   lo_incident = lo_service_manager->get_root_single( iv_key = lr_s_incident->key ).

   lo_inv_result_node = lo_incident->get_subnode_by_key(if_ehhss_inc_c=>sc_association-root-investig_result ).

   lo_inv_step_node = lo_inv_result_node->get_subnode_by_key( if_ehhss_inc_c=>sc_association-investig_result-step ).Class Method

I have a post exit enhancement on this method and I would like to be able to access  the lo_inv_result_node and lo_inv_step_node from this exit.  These objects contain data that I would like to process in the exist.  Does anyone know how I can do this?

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Janice,

The core_object gives you access to the attributes/methods of the class(which is being enhanced).

You are trying to access the local objects of the method & i dont think you can access it via the core_object. Hence they can't be used in the post-exit method

As a matter of fact i think this is quite logical since the scope of the local variables is within the procedure & not outside of it. Let me know if you think otherwise

Back to your problem; if you want to access these objects you should create an implicit enhancement at the end of the method & do your relevant processing.

BR,

Suhas

2 REPLIES 2

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Janice,

The core_object gives you access to the attributes/methods of the class(which is being enhanced).

You are trying to access the local objects of the method & i dont think you can access it via the core_object. Hence they can't be used in the post-exit method

As a matter of fact i think this is quite logical since the scope of the local variables is within the procedure & not outside of it. Let me know if you think otherwise

Back to your problem; if you want to access these objects you should create an implicit enhancement at the end of the method & do your relevant processing.

BR,

Suhas

Former Member
0 Kudos

Thank-you!  Your answer makes perfect sense and the Implicit Enhancement is working for me ... well .. almost .... now I just have to get the code right .  thx again!