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

table statement in the user exit

Former Member
0 Likes
563

hi,

in the include program for user exits for some transaction that operates on some database tables,

whether i can declare the same table names using the tables statement in the user exit include program ,if i can whether any

problem arises.

Many Thx & Regards,

kiran

4 REPLIES 4
Read only

Former Member
0 Likes
481

I don't see a reason why you should declare using a TABLES statement in a user exit. If you need a structure of that table type use the DATA statement and declare a structure of the table type.

As such it should not cause a problem even if you declare it using a TABLES statement, as long as the variable names are different.

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

Former Member
0 Likes
481

Hi,

if tables are declared already then u cant declare them again in Include.

If you declare tables again , it will not give any error when u just check for the include. But when u check with main progarm or activate ur include it throws an error saying tables are already created.

<b> no need to declare tables again in the include if they already exist.</b>

Madhavi

Read only

Former Member
0 Likes
481

Hi

Please don't get confused. People who come from C/C++/etc back ground get confused and think that TABLE statement is to include something. NO IT IS NOT.

It is just to declare a structure (Work area). You can do the same by using DATA statement also. Ex. TABLES: MARA. Is equal to DATA: MARA TYPE MARA.

So in your user exit, if the table is already used you can use it in your include. If you get any error when you use... you can declare in either of the above ways.

And for any other reason you want some work area... then obviously you can declare it with DATA statament. You can give even some other name (for example MARA2).

Regards

Surya.

Read only

Former Member
0 Likes
481

Hello kiran,

you user exit is an funtion module. An funtion module is included in a funtion group. If you uses an tables statement in your user exit ( funtion module ) and another funtion module included en your function group uses the same statement ( TABLES: xxx. )an error message arise. All statements TABLES: xxx in user exits must be included in include TOP of funtion group of funtion module.

Kind Regards.