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

Current Enhancement:

Former Member
0 Likes
1,166

Hi, I have a question:


I would like to know if there is any function (or method) that returns the name of the enhancement (if the code is inside one) of the calling code.


You know if there is anything?


Thank you so much!

Carlos.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,114

Hi,

  Try this..You can use the function module SYSTEM_CALLSTACK..

ENHANCEMENT ZTEST_ENH.    "active version

   data: callstack type ABAP_CALLSTACK,

         s_callstack type line of ABAP_CALLSTACK.

   CALL FUNCTION 'SYSTEM_CALLSTACK'

    IMPORTING

      CALLSTACK          = callstack.

   read table callstack into s_callstack index 1.

   write: / s_callstack-include.

*

ENDENHANCEMENT.

Hi, I have a question:


I would like to know if there is any function (or method) that returns the name of the enhancement (if the code is inside one) of the calling code.


You know if there is anything?


Thank you so much!

Carlos.

6 REPLIES 6
Read only

Former Member
0 Likes
1,115

Hi,

  Try this..You can use the function module SYSTEM_CALLSTACK..

ENHANCEMENT ZTEST_ENH.    "active version

   data: callstack type ABAP_CALLSTACK,

         s_callstack type line of ABAP_CALLSTACK.

   CALL FUNCTION 'SYSTEM_CALLSTACK'

    IMPORTING

      CALLSTACK          = callstack.

   read table callstack into s_callstack index 1.

   write: / s_callstack-include.

*

ENDENHANCEMENT.

Read only

0 Likes
1,114

It works perfectly!!!

But the enhancementis contained in a Composite Enhancement.

How can I know the Composite Enhancementthat contains it?

Thank you so much!

Carlos.

Read only

0 Likes
1,114

Hi,

  Query to the table..ENHCOMPCHILDENH..give the enhancement name in the column CHILDENH..you will get the composite enhancement from the column ENHCOMPOSITE..

Thanks

Naren

Read only

0 Likes
1,114

Works Perfectly!!!

Thank you so much!

Carlos.

Read only

0 Likes
1,114

I have a little problem:

I tried to implement the proposal (Fm ABAP_CALLSTACK ) .

On an enhancement of a post-exit method of WebDynpro, but does not return the enhancement name , returns _pst_00o2tgn7mg1vxx8rf2bfi31zo .

Is there a table that relates this with the name of the enhancement?

Thank you so much!

Carlos.

Read only

0 Likes
1,114

I auto-answer my question

Applying the method cl_enh_utilities_xstring => get_data actually providing as input the DATA field ENHHEADER table, get the translation of _PST_ .... the name of the enhancement.

Thank you so much!

Carlos.