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

Obsolete Statements

0 Likes
3,346

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

20 REPLIES 20
Read only

Former Member
0 Likes
2,718

What is ur release?Why u want to list the obsolete statements?

Read only

0 Likes
2,718

@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

Read only

Former Member
0 Likes
2,718

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.

Read only

0 Likes
2,718

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

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,718

Call the FM EXTENDED_PROGRAM_CHECK with parameter TEST_FLAGS sub field X_WOO set in your report.

Regards,

Raymond

Read only

0 Likes
2,718

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

Read only

0 Likes
2,718

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!

Read only

0 Likes
2,718

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

Read only

Former Member
0 Likes
2,718

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

Read only

0 Likes
2,718

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.

Read only

0 Likes
2,718

Can anyone please tell me how to scan a program line by line and compare it with a custom table storing obsolete statements

Read only

0 Likes
2,718

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.

Read only

0 Likes
2,718

Thank you....Can we use SCAN keyword also to scan a report? What is the difference between SCAN and read report?

Read only

0 Likes
2,718
Read only

0 Likes
2,718

Thank you

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,718

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

Read only

0 Likes
2,718

ok...thanx...ill check it

Read only

0 Likes
2,718

What is the purpose of CL_CI_TEST_SEARCH? How do we use it in our program?

Read only

0 Likes
2,718

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

Read only

0 Likes
2,718

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