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 tables/structure from FM

Former Member
0 Likes
785

Hi SAPMASTER,

Please, I need your help!!!!

Forgive my stupid doubt.

I need to export a table from FM.

Below is my FM:

FUNCTION ZZEXPORTA.

*"----


""Local Interface:

*" EXPORTING

*" VALUE(OUT1) TYPE ZZSTRU_ZZQTDMAT

*"----


DATA: itab TYPE TABLE OF ZZSTRU_ZZQTDMAT,

wa LIKE LINE OF itab.

wa-material = '123'.

wa-descricao = 'nothing'.

wa-unidade = 'ea'.

wa-quantidade = 123.

MOVE-CORRESPONDING wa to out1.

CLEAR wa.

wa-material = '234'.

wa-descricao = 'all'.

wa-unidade = 'xyz'.

wa-quantidade = 456.

MOVE-CORRESPONDING wa to out1.

CLEAR wa.

ENDFUNCTION.

The result is just the "last" data that I put in wa (this is right).

Please, how can I add 2 "registers" to structure ?

I tried APPEND but I got an error message:

"out1 is not a internal table".

I appreciate your help.

Regards,

Edson Luiz

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
665

Hello,

you can change EXPORTING parameter to TABLES parameter...

then you will be able to do APPEND

Cheers!

4 REPLIES 4
Read only

Former Member
0 Likes
666

Hello,

you can change EXPORTING parameter to TABLES parameter...

then you will be able to do APPEND

Cheers!

Read only

0 Likes
665

Hi Krishnendu Laha,

Thank you for your help but I have already put in TABLES tab.

SAP did not permit. I got the error message:

"TABLE is OBSOLETE".

So, I put in Export tab.

Please, is there any way to put in the TABLES tab?

Regards,

Edson Luiz

Read only

0 Likes
665

Hello,

Create one table type from SE11 and declare output (exporting table) ref. of that table type. Let us know if you have any issue.

Thanks,

Naveen Inuganti.

Read only

0 Likes
665

Hi Naveen Inuganti,

Thank you so much for your answer.

Now everything is ok.

Best Regards,

Edson Luiz