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

export parameters in a Z function module

former_member189629
Active Contributor
0 Likes
1,516

Hi All,

I have a program that returns data in an internal table. While converting the program J_into a custom FM, <b>is it a must that the exporting table (with data) be declared with reference to a dictionary table/structure?</b>

14 REPLIES 14
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,428

When using EXPORTING paramater with a table, I think it must be defined using a Table Type, when using a TABLES parameter, it can be like a structure, but it also doesn't have to have a type.

Regards,

Rich Heilman

Read only

0 Likes
1,428

I was hoping you should answer this query Rich

You mean the table being exported from the FM has to have a dictionary reference right?

Read only

0 Likes
1,428

I mean the exporting table (say E_MARA) should be referred to a dictionary type (E_MARA TYPE MARA)?

Can't a normal itab declaration in the FM do?

Read only

0 Likes
1,428

I believe that it does, and it must be a table type.

Regards,

Rich Heilman

Read only

0 Likes
1,428

You must use a table type defined in the data dictionary.

Regards,

Rich Heilman

Read only

0 Likes
1,428

Thank you, Sir.

Regards,

Karthik

Read only

Former Member
0 Likes
1,428

You can export data in a table parameter with generic Type reference TABLE (any data).

Read only

0 Likes
1,428

Right, you can gernerically define in TABLES parameter, but in EXPORT parameter, you need to use a table type from ABAP dictionary.

Regards,

Rich Heilman

Read only

0 Likes
1,428

I just created, checked & activated a Ztable in the DDIC but it is not being recognized by the FM. Says it doesn't exist. What could be the prob?

Read only

0 Likes
1,428

Did you create a "Z" transparent table or a table type? You need to create a table type in SE11, select radiobutton for Data Element(Data Type).

Regards,

Rich Heilman

Read only

0 Likes
1,428

Hi

It depend on where you're using that ZTABLE and what's the ZTABLE:

- As reference for an export/import parameter?

- As reference for a TABLE parameter?

Rich

Riccardo is right, I don't know which release you're using (my rel. is 4.6C), but It's possible to use the generic type TABLE to define an import or export parameter as table.

Max

Read only

0 Likes
1,428

Then I stand correctly, I assumed that you could only use Tables Types when defining a table in an exporting parameter.

Regards,

Rich Heilman

Read only

0 Likes
1,428

Hi Max,

I have an internal table being populated exported from the FM. So my question was whether reference for an export/import parameter should be to the DDIC.

BTW I am on ECC 5.0

Message was edited by: Karthik

Read only

0 Likes
1,428

Hi

No you don't need to do that, but it would be better to do because it wouldn't be easy to manage a table without reference, you should use the field-symbols.

So I believe it's better to define a dictionary structure like your internal table and define a TABLE paramenter like that structure.

Max