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

Call a function with tables in a FORM

Former Member
0 Likes
831

Hi all,

I am currently willing to create a FORM that would call a function (which has a table in its parameters).

In the form, I modify the fields of this table, and then I call the function.

I put the table in the FORM parameters (either 'USING' or 'TABLES').

Problem is: the syntax check keeps on telling me that my internal table is not correctly defined (missing the statement 'OCCURS 0') and won't compile.

I tried to add this statement 'OCCURS 0', even 'WITH HEADER LINE', but I cannot make it work.

Can anyone help ?

Thx a lot.

Isa.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
783

while defining your internal table use same type as

declared in FUNCTION MODULE tables parameter.

and

pass Table body to your fun.module like this

TABLES

TABLE = ITAB[]

here ITAB is your internal table

try it

bye

Hi all,

I am currently willing to create a FORM that would call a function (which has a table in its parameters).

In the form, I modify the fields of this table, and then I call the function.

I put the table in the FORM parameters (either 'USING' or 'TABLES').

Problem is: the syntax check keeps on telling me that my internal table is not correctly defined (missing the statement 'OCCURS 0') and won't compile.

I tried to add this statement 'OCCURS 0', even 'WITH HEADER LINE', but I cannot make it work.

Can anyone help ?

Thx a lot.

Isa.

5 REPLIES 5
Read only

Former Member
0 Likes
783

Hi,

Declare a Ztable inside the form of the type declared in the FM with a header line.Assign the fields that u require to pass through the table and append to this Ztable.

Now pass this Ztable to the parameters of the FM.

This should help u out...

Mark useful answers...

Read only

Former Member
0 Likes
784

while defining your internal table use same type as

declared in FUNCTION MODULE tables parameter.

and

pass Table body to your fun.module like this

TABLES

TABLE = ITAB[]

here ITAB is your internal table

try it

bye

Read only

0 Likes
783

Thx for the answer.

Anyhow, my problem remains the same, since I call a standard function: I cannot modify it!

Anyhow, I declared my internal table in the FORM just as it is declared in the function I call, and it does not work ...

Any idea ?

Read only

Former Member
0 Likes
783

if it is possible please send me your code

i will check it

bye

Read only

0 Likes
783

oups ... my mistake, I had forgotten to change 'USING' with 'TABLES' in the FORM declaration (stupid hey?)...

Next time I'll check twice

Thx a lot for your answers !!!!