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

Passing Internal Tables

Former Member
0 Likes
589

I have a function ZMYFUNCTION belonging to ZMYFUNCTIONGRP function group. In the TOP include of the group I have the following type declared:

TYPES: BEGIN OF bundle_struc,
                  exidv  LIKE vekp-exidv,
                  vhilm  LIKE vekp-vhilm,
             END OF bundle_struc.

Now, in my function I declare an internal table:

DATA: bundle_hu_tab             TYPE TABLE OF bundle_struc.

I then try to pass this table into a FORM using the TABLES option. My problem is that when I try to use

FORM MYFORM TABLES p_bundle_hu_tab STRUCTURE bundle_struc.

It says that bundle_struc is unknown. If I remove the STRUCTURE I can't access any of the fields based by name.

I know I can always add bundle_hu_tab into the TOP include as well, but I'm trying to keep from doing that? Is there any other way?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
553

Hi troy,

1. Instead of declaring in the top include,

<b> create a structure of it,

in DATA DICTIONARY thru se11.</b>

2. then it will work.

regards,

amit mittal.

Hi troy,

1. Instead of declaring in the top include,

<b> create a structure of it,

in DATA DICTIONARY thru se11.</b>

2. then it will work.

regards,

amit mittal.

4 REPLIES 4
Read only

Former Member
0 Likes
553

Troy, are you sure that you first activated the TOP include so your function module knows what global data is available? (or activated all inactive includes together for your FM)

You should have no problem with visibility of the structure if it is in the TOP include and it is first activated.

Read only

0 Likes
553

Daniel,

The TOP include is activated. The only part not active is my function module because of the error. The error says:

Field "BUNDLE_STRUC" is unknown. It is neither in one of the specified tables nor defined by a DATA statement.

Read only

Former Member
0 Likes
554

Hi troy,

1. Instead of declaring in the top include,

<b> create a structure of it,

in DATA DICTIONARY thru se11.</b>

2. then it will work.

regards,

amit mittal.

Read only

Former Member
0 Likes
553

Hi,

Declare Table Type as follows,

TYPES: ty_bundle_hu_tab TYPE TABLE OF bundle_struc.

and while passing use

FORM MYFORM TABLES p_bundle_hu_tab TYPE ty_bundle_hu_tab .

Regards,

Ranjit Thakur.

<b>Please Mark The Helpful Answer.</b>