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

EPC error on using 'Structure'

Former Member
0 Likes
379

Hi,

In a subroutine

FORM add_dates TABLES t_approvalsdone STRUCTURE z11.

.

.

.

sort t_approvalsdone by name1.

ENDFORM.

Here its giving a Extended program Check error as below

"The current ABAP command is obsolete

Within classes and interfaces, you can only use "TYPE" to refer to ABAP Dictionary

types, not "LIKE" or "STRUCTURE".

Internal Message Code: MESSAGE G/B

(The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET

EXTENDED CHECK OFF/ON)"

Syntax error is given when declared as

FORM add_dates TABLES t_approvalsdone type z11.

If i declare this as FORM add_dates TABLES t_approvalsdone .

then syntax error is given in sort statement saying "no structure, hence no field called name1".

How to handle this please? We have to be free from EPC error also.

Thanks

Meenakshi

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
328

Hello,

I generally create a table type & then decalre the formal param as TYPE <tabletype> like this:

TYPES: ty_approvalsdone_t TYPE STANDARD TABLE OF z11.

DATA: it_approvalsdone TYPE ty_approvalsdone_t.

PERFORM add_date CHANGING it_approvalsdone.

FORM add_dates CHANGING t_approvalsdone TYPE ty_approvalsdone_t .
.
.
.
sort t_approvalsdone by name1.
ENDFORM.

This is standard coding practice.

BR,

Suhas

1 REPLY 1
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
329

Hello,

I generally create a table type & then decalre the formal param as TYPE <tabletype> like this:

TYPES: ty_approvalsdone_t TYPE STANDARD TABLE OF z11.

DATA: it_approvalsdone TYPE ty_approvalsdone_t.

PERFORM add_date CHANGING it_approvalsdone.

FORM add_dates CHANGING t_approvalsdone TYPE ty_approvalsdone_t .
.
.
.
sort t_approvalsdone by name1.
ENDFORM.

This is standard coding practice.

BR,

Suhas