‎2012 May 18 9:27 AM
Hi
I have been asked to develop a program which lists the obsolete statements in the program passed to it in the selection screen. Can anyone please suggest me ideas as to how i should do it??
Thank you
regards
Vivikta
‎2012 May 18 9:38 AM
What is ur release?Why u want to list the obsolete statements?
‎2012 May 18 10:39 AM
@R Karthik We have been asked to develop reusable tools in abap. So they asked us to develop a report program in abap which scans a program and displays a pop up box giving the obsolete statement , line number and the replacement for it. So that its easy to check and replace obsolete statements .
regards
Vivikta
‎2012 May 18 9:39 AM
You can use SLIN to find the Obsolete statements in a Program.
You can also use this in a custom program and output the same.
‎2012 May 18 11:30 AM
It shows us the obsolete statement and function modules. But sometimes it doesnt show the replacement for the obsolete statements. I want the replacements for obsolete statements also to be displayed
‎2012 May 18 9:49 AM
‎2012 May 18 12:02 PM
It shows us the obsolete statement and function modules. But sometimes it doesnt show the replacement for the obsolete statements. I want the replacements for obsolete statements also to be displayed
‎2012 May 18 8:27 PM
What? You want the program to tell you how to fix the programs? If we get that developed, we won't need any junior programmers...just write some code then run the fixer-upper. What a wonderful idea...a programmatic replacement for staff members who lack training, research, design, coding and analysis skills!
‎2012 May 20 3:39 AM
Hehehe gud point..... I have been thinking abt it....but what to do our seniors have asked us to develop the code and we are only freshers...i cudnt believe myself...they have over expectations
‎2012 May 18 12:49 PM
Hi Vivikta
Which Obsolete statements do you require replacements for?
For example if the transaction SLIN or the Function Module FM EXTENDED_PROGRAM_CHECK
Gives you a reply like "Tables with headers are no longer supported", then you have a statement "WITH HEADER LINE". I don't believe that the FM nor the SLIN program is going to give you a whole explanation as to how to fix it. That is what the ABAP Academy is there for.
Please give us a little more info as to what obsolete statements you are having trouble with.
Regards
Vic
‎2012 May 20 3:47 AM
Yeah they give us limited info.....its about obsolete statements in general....actually we have to develop a tool which scans a program line by line (taking program name in its selection screen) and compare it with a table(table which stores obsolete statements like RODIR etc) and displays a pop up box showing the obsolete statement, the line number and the replacement for it. We have to create a custom table having the fields obsolete statement , type (Function module/statement), replacement. So the program should compare with this table while scanning and display the pop up box.
‎2012 May 20 3:48 AM
Can anyone please tell me how to scan a program line by line and compare it with a custom table storing obsolete statements
‎2012 May 20 4:19 AM
This keyword will help you to read a existing Report name into a internal table.
Syntax:
DATA: IT_REPORT TYPE TABLE OF string.
READ REPORT 'REPORT NAME' INTO IT_REPORT.
Then you can loop at this table and compare with your custom table.
‎2012 May 21 3:34 PM
Thank you....Can we use SCAN keyword also to scan a report? What is the difference between SCAN and read report?
‎2012 May 21 3:56 PM
You need to read report first, then use scan keyword.
See example:
‎2012 May 21 4:09 PM
‎2012 May 20 8:07 PM
Hi,
Code inspector also contains a check for setting the obsolete statements you want: "Find Unwanted Language Elements"; it should be more easy to copy the corresponding class CL_CI_TEST_SEARCH_UNWANTED, and adapt it as you like.
Sandra
‎2012 May 21 3:34 PM
‎2012 May 23 1:38 AM
What is the purpose of CL_CI_TEST_SEARCH? How do we use it in our program?
‎2012 Jun 05 11:37 PM
Sorry, I forgot to answer.
It's code inspector. It's the SAP's "latest" tool that controls ABAP source code. You can customize this tool by adding your own checks. There are many standard checks that do the job you need.
CL_CI_TEST_SEARCH_UNWANTED class corresponds to the scan of unwanted ABAP statements. You create a code inspector check variant in which you enter the list of unwanted ABAP statements. You then run code inspector on your programs using this check variant, and it will display all the ABAP lines that contain these statements.
To answer your question, I think the logic shouldn't be that Code inspector is called from your program, but the reverse (your program should be converted into code inspector checks). If it's too complex, then you can call SCI transaction from your program (note: it could be better to use the hidden SCID transaction). You may also probably call it through some CL_CI_* classes, but I can't tell you more.
Sandra
‎2014 Apr 02 11:57 AM
Hi Vivikta,
Did you get a solution for your requirement? Even i have got the same requirement as yours:( If you have found the solution for yours then plz do share the details so that i can get benefitted from it.
Thanks in advance..
Santosh