This is a test message to test the length of the message box.
Login
ABAP Quick Search in source code
Created by Software-Heroes

ABAP Quick - Search in source code

384

Sometimes it is necessary to search through different source codes in one system. We show you how it works in the SAP GUI and in Eclipse.



For every developer, the focus is on writing source code because it is most fun and creative. But research and understanding of source code is also an important part of daily work as a developer. Today we would like to show you how to search source code in the system, once for the SAP GUI and once as an example in Eclipse, as the new development environment.

 

Classic search

The classic search in the SAP GUI works with the report RS_ABAP_SOURCE_SCAN, which offers various options for searching the source code and further restricting the search quantity by selecting the packages and objects to be searched.

From a performance perspective, this restriction is also necessary because the runtime of the report can sometimes take a little longer until all resources have been searched.

 

For our example we are looking for a ##TODO pragma, which we have added to the source code, because we want to do something later. Such TODOs are mostly used when you later want to complete certain points that you did not manage to implement or were not required in a first prototype. For example, clean exception handling should be mentioned here.

 

The program provides the corresponding search results at the end and you can navigate to the source code by clicking on the corresponding entry.

 

Eclipse

Searching in Eclipse is a bit easier because you don't need your own report here, but you can work directly with the search function. The call is made using the key combination CTRL + H or directly in the menu. Then you will get a popup with various searches. The available searches can differ, as you can activate and deactivate them individually using "Customize ...".

 

In this case the "File Search" is sufficient for us and delivers the desired result. To restrict the amount of files searched, we only search for the pattern in all Z* and LZ* objects.

 

TODO Pragma

The use of the ##TODO pragma has also some other advantages in Eclipse. Even if this pragma does not exist in the system, it can be used. In Eclipse you get a corresponding marking in the source code and in the overview, which makes it easy to find.

 

This also works for FIXIT and XXX if you follow the SAP suggestions and provide the code with standardized comments.

 

Conclusion

The search for any object works in the new and old development world, just a little differently. Which of the searches you choose in the end is up to you, but we recommend searching in Eclipse because it is a bit more powerful and easier to use.


Included topics:
QuickSearchSource codeEclipse
Comments (0)



And further ...

Are you satisfied with the content of the article? We post new content in the ABAP area every Friday and irregularly in all other areas. Take a look at our tools and apps, we provide them free of charge.


ABAP in Practice - Test Driven Development

Category - ABAP

How does TDD actually work in practice and are there simple examples for learning in ABAP? In this exercise we will look at the practical part.

09/24/2024

ABAP in Practice - Merge data sets

Category - ABAP

How do we merge two different data sets in ABAP, especially with regard to Modern ABAP? A practical task for this topic.

09/17/2024

ABAP in Practice - Modern ABAP

Category - ABAP

In this small task we look at existing classic ABAP source code and try to optimize it according to Modern ABAP.

08/27/2024

ABAP Quick - Performance Data Filtering

Category - ABAP

Which statement do you use in ABAP to filter internal tables and is it performant? Read more in this article.

08/13/2024

ABAP in Practice - Type Conversion

Category - ABAP

How would you perform this type conversion in ABAP? A practical example and a suggested solution.

07/16/2024