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

Extended Program Check, TABLES statement obsolete

Former Member
0 Likes
6,288

Hi,

I am using a field from "DD02L" in my parameters and therefore have declared the table using TABLES statement.

When I do an EPC on my program, it gives me the following under Programming Guidelines(Warnings) :-

"TABLES statement (DD02L) is obsolete

Cannot be suppressed using a pragma or pseudo-comment"

What is the alternative to this statement?.

I am working ECC 6 Ehp5.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,954

If by parameters, you mean to say , selection screen parameters,why you need Tables Statement to define parameter. You can directly do it like:

Parameters p_tab type dd02l-tabname.

Kindly let me know if I understood your requirement incorrectly.

8 REPLIES 8
Read only

Former Member
0 Likes
2,954

Why dont you use the data element of the table for your parameter?

Read only

Former Member
0 Likes
2,955

If by parameters, you mean to say , selection screen parameters,why you need Tables Statement to define parameter. You can directly do it like:

Parameters p_tab type dd02l-tabname.

Kindly let me know if I understood your requirement incorrectly.

Read only

0 Likes
2,954

You can direct refer to the Data Element of the field which you want to refer and accordingly you can adjust your Parameter declaration. For that you do not need to use TABLES statement.

Table statement actually allows you to use a structure with the same name and hence it creates a conflict in a Obj Oriented scenario. Hence that statement is made Obsolete.

Read only

Kartik2
Contributor
0 Likes
2,954

Dear Asshrith HG,

When you use the statement TABLES, then an internal table with header line will get declared and sice internal tables with header lines are obsolete you are getting that error message.

As suggested you can use the data element directly. Data element for that field is TABNAME.

Declare a variable of type TABNAME and use it in your program. Thank you.

Regards,

kartik

Read only

ThomasZloch
Active Contributor
0 Likes
2,954

TABLES statement is obsolete because it declares a work area of the same name as the DB table, thus leading to ambiguous code, similar topic as internal tables with header lines, also obsolete.

Better declare separate work areas for the relevant DB tables for the use in the SELECT statements.

Thomas

Read only

Private_Member_49934
Product and Topic Expert
Product and Topic Expert
0 Likes
2,954

For parameters you don't need TABLES statement You can directly refer using TABLE-FIELDNAM or Data element name. LIke

parameters : p_matnr type matnr.

If you are trying to create select option the you may create an auxilarry variable for the same.

Like

data : gv_matnr type matnr.

select-options : so_matnr for gv_matnr.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,954

TABLES should only be used when fields are used in a dynpro, else declare a workarea of type database name. (ex: DATA: vbap TYPE vbap.)

Regards,

Raymond

Read only

Former Member
0 Likes
2,954

Thanks all for your quick & valuable replies.