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: 

Code Scanner for Implicit Enhancements

bryan_cain
Contributor

So I know about code_scanner for Reports, FMs, and classes.

Is there an equivalent for implicit enhancements?

As an alternative, what table is implicit enhancement code stored in?

Thanks

Bryan

1 ACCEPTED SOLUTION

bryan_cain
Contributor

For those of you that have been waiting with baited breath for an answer here (ha!):

I'm still working on web dynpro enhancements, but for report/FM/class based enhancements, you can find what you need in table:

ENHINCINX

Field ENHINCLUDE has an include name that can be read at runtime using the READ REPORT command.

I'll update again if I can find web dynpro enhancements.

16 REPLIES 16

Former Member
0 Kudos

Hi Bryan,

This information can help you, look at these tables, they contain enhancments.

Tables:

ENHOBJ - Enhancement Objects

ENHHEADER - Enhancement Header Table

Regards,

Jr Vieira

0 Kudos

That's helpful, thanks.

Any idea how I can scan the actual code for keywords?

For reference, I am looking for places where a certain value was hard-coded.  I can scan programs, FMs, and classes using code_scanner.  I need a way to do it for implicit enhancements.

Thanks

krishnendu_laha
Active Contributor
0 Kudos

Hello,

This is interesting question, is it not standard tool provided by SAP like code inspector, performacne analysis checking the code written in enhancement?

....Implicit enhancement provided by SAP as like plug in to insert custom logic and it treated and compiled as a single object where it is written; only managed throuhg enhancement framework...

.

So in my opinion all standards option should be available.

.

Regards

Krish

0 Kudos

In theory, perhaps.  But if I run code_scanner for a program I know has implicit enhancements using a search string I know is there, it finds no hits.

bryan_cain
Contributor
0 Kudos

Anyone else have thoughts?  I'm looking for a way to scan enhancements for a certain hard-coded value.

Thanks!

0 Kudos

Try Z_USEREXIT by Pete Atkin. 

0 Kudos

Hi,

take a look at function group ENH_EDT_HOOK, include LENH_EDT_HOOKF01,

seems that what you're looking for it's been done in the implementation of method  'handle_function_selected'.

Clemenss
Active Contributor
0 Kudos

... does not find implicit enhancement

bryan_cain
Contributor

For those of you that have been waiting with baited breath for an answer here (ha!):

I'm still working on web dynpro enhancements, but for report/FM/class based enhancements, you can find what you need in table:

ENHINCINX

Field ENHINCLUDE has an include name that can be read at runtime using the READ REPORT command.

I'll update again if I can find web dynpro enhancements.

0 Kudos

Hi, I have a similar requirement, but the enhancement code to be searched is under webdynpro. Please let me know if you have a solution for scanning webdynpro enhancements. 

0 Kudos

Take a look at the class cl_wdy_wb_naming_service.  It has a method for getting the generated class name of a WDY component.  The implementation of that class is basically a list of includes.  You can then use READ REPORT on each include.

I ended up cloning AFX_CODE_SCANNER and adding the ability to search enhancements & web dynpro components.  It has been a very valuable tool for me and my team.

0 Kudos

Hi Bryan,

thanks for your research and sharing.

one comment: i'm having the same needs to scan all the hard coded constants in our projects development object.    i found that the program: RS_ABAP_SOURCE_SCAN is more powerful, coz it can search with regex, i don't think AFX_CODE_SCANNER can.

and could you share the report you've cloned?

Regards,

Aaron.

0 Kudos

Aaron,

Thanks, I wasn't aware of that other code scanner.  The code in that program is far more modularized; I may be able to plug into it using enhancements instead of needing to clone it.

I will check with my boss about sharing the code.  If he's OK with it, I will probably do it as a blog post.

Bryan

0 Kudos

Hi Bryan,

i did some research on enhancements, i found there're just too many types: badi, function group, class......

i'm wondering how did you achieve to scan the source code only about the enhancement implementation?  i mean if we enhance a class method with a post exit, how can i just scan the post exit part without scan the complete standard method?

And how did you manage to scan the source code of  all types of enhancements?

Regards,

Aaron.

Let me take a step back.  AFX_CODE_SCANNER requires you to specify either a package or an object name.  We run it by package.  I look at packages Z*.

I was not trying to find a program that will only search enhancements; I was searching for a  program that will search everything including enhancements.

AFX_CODE_SCANNER already covers function group enhancements (the include will show up as a report object) and classic BAdIs (the implementing class can be scanned).  New Enhancements are not covered in either of these scenarios, so I went looking for a way to find them.  The result of my research is above.

Joris
Explorer
0 Kudos

With SAP Standard report RS_ABAP_SOURCE_SCAN or the SAP Code Inspector (transaction SCI) it is not possible to do text based searches through Enhancement Implementations.

I put together below little ABAP code scanner for Enhancement implementations.

Report to search ABAP code in Enhancement implementations | SAP Blogs

best regards,

Joris