Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Declaring table as import parameter in a Function Module

Hi

Can we declare a table as import parameter in a Function Module? If yes, what is the procedure to declare and process it?

Thanks in Advance,

Phani

Tags:
Former Member
Former Member replied

Hi Phani,

Let me cite an example to justify my point.

Suppose you want to display the material number and description using a Function Module.You are selecting the required records and storing it in internal table ITAB with header line. You are calling a Function Module FUNCTION_MAKT.

FUNCTION_MAKT contains an import parameter which is a table type of table MAKT.

In the Function Module, you are displaying the MATNR & MAKTX values.

Just write this code in the source code tab of the Function Module.

COde

-


data: wa_mytab type makt.

loop at mytable into wa_mytab.

write : wa_mytab-matnr,wa_mytab-maktx.

endloop.

In the main program, just write the code.

code

-


tables: makt.

data: itab type table of makt with header line.

start-of-selection.

select * from makt into table itab up to 3 rows.

CALL FUNCTION 'ZSHAIL_FMTABLE1'

EXPORTING

mytable = itab[]

.

Hope your query is solved.

Regards,

SP.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question