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: 

How to read all the variables along with there types from a report program?

naveenmaaroju
Explorer
0 Kudos

Hi Experts,

I have a required to write a program to check the naming convention of the variables used in the report provided in the selection screen.

For that purpose, i require to read all the variables of the report that has been provided in the selection screen along with their type (eg: constant, variable, structure).

Can anyone please suggest, how can i achieve this?

5 REPLIES 5

matt
Active Contributor
0 Kudos

If you read this blog you might realise that in the opinion of many, enforcing naming standards on variables is merely enforcing bad programming practice.

0 Kudos

Hi Matthew,

Thanks for the response.

But we are forced to use the naming conventions from our business itself, they have provided the document how the naming standards that need to be followed.

While we are doing a code review of the larger report programs, it is consuming hours to complete the code review, so we want to automate it using a program.

If we have to proceed with, how can we achieve it?

Former Member
0 Kudos

Hi,

you can use your own variant in SCI for Code review and define your naming standards there and ask the developer to provide you with the screen shot where he has no errors for Naming conventions.

I dont have further details of how to create this Variant but we have used this kind of Code review process in our project where Naming standards are provided by the Customers .

This is just to give you and Idea, if you explore further on this you will get something from SCN.

Also try the FM      RS_PROGRAM_INDEX.

Hope this helps.

ceedee666
Active Contributor
0 Kudos

Hi Naveen,

first I have to say I fully agree with Matthews comment.

If you want to check naming conventions nevertheless you should have a look at the SAP code inspector instead of write a custom report. Besides other check functionality the code inspector enables the checking of naming conventions as well.

Code Inspector - ABAP Development - SCN Wiki

Christian

matt
Active Contributor
0 Kudos

Others have pointed out the best way to achieve your task.

Of course, you must always follow the conventions that are laid down - however, you are always free to challenge those conventions if, in your professional opinion, they are unnecessary, or could even be harmful. I did this once and was then tasked with rewriting the conventions! That raised my profile within the organisation, which was good for my career.

Why not gently point the author of the document to that blog - just as food for thought.

My personal conviction is that no matter what your position within an organisation is, you should always strive for improvement.