‎2009 Jan 06 5:11 AM
Hi ,
I'm getting errors(Obsolete statements) when checking for extended program check for a report program.
When I'm going for "UCCHECK" i'm not getting any errors & in code inspector also it is not showing the errors.
Here what is the reason for this?why it showing error in one transaction & not showing the same in other transaction..
Here I'm pasting the code..
REPORT ZHCM_OBSOLETE.
infotypes : 0000.
DATA: BEGIN OF itab1 OCCURS 0,
col1 TYPE i,
col2 TYPE i,
col3 TYPE string,
END OF itab1 VALID BETWEEN col1 AND col2.
DATA: BEGIN OF itab2 OCCURS 0,
col1 TYPE i,
col2 TYPE i,
col3 TYPE string,
END OF itab2 VALID BETWEEN col1 AND col2.
itab1-col1 = 1.
itab1-col2 = 6.
itab1-col3 = 'Itab1 Int1'.
APPEND itab1 TO itab1.
itab1-col1 = 9.
itab1-col2 = 12.
itab1-col3 = 'Itab1 Int2'.
APPEND itab1 TO itab1.
itab2-col1 = 4.
itab2-col2 = 11.
itab2-col3 = 'Itab2 Int1'.
APPEND itab2 TO itab2.
provide col3 FROM itab1
col3 FROM itab2
BETWEEN 2 AND 14.
WRITE: / itab1-col1.
* \, itab1-col2, itab1-col3, itab1_valid.
WRITE: / itab2-col1.
* , itab2-col2, itab2-col3, itab2_valid.
SKIP.
ENDPROVIDE.
Thanks in advance..
Pradeepa
Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 2:22 PM
‎2009 Jan 06 5:17 AM
Hi
In your program PROVIDE is the absolute statement. That's why it is throwing error.
Regards
Akshay
‎2009 Jan 07 4:02 AM
Hi Akshay,
Can you tell me the replacement statement for this PROVIDE ... ENDPROVIDE statement?
Thank you,
Pradeepa
‎2009 Jan 06 5:19 AM
hi,
provide and end provide are Obsolete statements .instead use select or macros.
thanks
‎2009 Jan 06 5:23 AM
Hi,
You are probably getting obsolete statements on the declaration of internal tables. Avoid using begin of itab occurs 0, this statement is not used as it automatically creates a header line. Use types statement to define a type and then use it to create an internal table and workarea, this will remove the obsolete statements in extended program check.
types : begin of t_itab,
col1 type i,
col2 type i,
col3 type string,
end of t_itab.
data itab type table of t_itab
data wa_type t_itab.
Use these to populate your internal table.
begin of itab occurs 0 was a statement which was used in prior versions (<4.0) and now are considered obsolete, but still functional due to backward compatibility.
Hope this helps you.
Regards,
Sachin Dargan.
Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 2:22 PM
‎2009 Jan 06 5:24 AM
Hi,
Obsolete stataments error you chech extended program check only is displays.
Regards
Md.MahaboobKhan
‎2009 Jan 06 5:27 AM
Hi,
Use Oops based declaratipon for internal table.
E.g. :
data: itab type standard table of <dtab>,
wa_tab type <dtab>.
Try this and also use type in place of like.
‎2009 Jan 06 5:25 AM
Hi,
Each TCODE has its own functionality.
UCCHECK is for Unocode compatibility.
Obsolete statements can be shown in code Inspector
In Code inspector press (CTRL + F1)
Expand the folder "Syntax check/ Generation"
Under "Extended program Check" Click on attribute and use the check box for "Obsolete statements" (This is unchecked by default).
Note : "Specific Tests" Radio button must be checked in the Extended program check screen
Run the code inspector again to see the changes
Regards
‎2009 Jan 07 4:22 AM
Hi Ravi,
I did both checking s., but getting obsolete statements in Extended program check & in UCCHECK it is not showing any errors.
My client need a code which is unicode compatible.can we omit those errors which we got in extended program check or have to find the solution for this?if there is a way can you explain me the solution for that?
‎2009 Jan 07 4:49 AM
Hi Pradeep,
Are you doing a upgrade ? Here we usually follow a scope which tells which obsolete statements to be handled in Extended program check and Unicode check. This scope may be given by the client.
If your client only needs unicode compatibility, then your code is fine.
Regards
‎2009 Jan 07 4:21 AM
Hi,
Use a read table statement instead of PROVIDE.
provide col3 FROM itab1
col3 FROM itab2
BETWEEN 2 AND 14.
Best regards,
Prashant
‎2009 Jan 07 4:54 AM
Prashant,
I hope read table statement is also obsolete ..
Is there any other statement in place of this?
‎2009 Jan 07 9:05 AM
‎2009 Jan 07 8:56 AM
Hi,
i think you could replace PROVIDE with the SELECT statement, along with APPENDING CORRESPONDING FIELDS OF TABLE internal_table.
and then yes, loop the internal_table
example:
loop at internal_table where...(optional)
...
endloop.
Regards,
Anki Reddy.
‎2009 Jan 07 9:20 AM
Hi,
problem with provide..... endprovide,use the select incase of provide.
Madhu