Skip to Content

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

Importing the internal into functional module and exporting the same from the functional module.

I have  internal table "itabfinal" with fields "pernr, werks, btrtl, plan, ansal, Persk".

now i need to pass "itabfinal" into the functional module and get back the all of "itabfinal"  field from the function module into the program.

for this i am creating the funtional module " ZFM1"


inside the functional module i have given the import as "itab1-type-table"

inside the functional module i have given the export as "itab2-type-table".

inside the functional module i have given the changing  as "itab3-type-table"

inside the functional module i have given the Table as "itab4-type-ZFM1_STRU_T"

where "ZFM1_STRU_T" is the table type with reference to itabfinal.

in my program i am calling the functional module as below.

CALL FUNCTION 'ZFM1'


   EXPORTING

     itab1         = itabfinal


  IMPORTING

    ITAB2         = itab4


   changing

     itab3         = itab4.

But in functional module i had given the code as below :

FUNCTION zfm1.

*"----------------------------------------------------------------------

*"*"Local Interface:

*"  IMPORTING

*"     REFERENCE(ITAB1) TYPE  TABLE

*"  EXPORTING

*"     REFERENCE(ITAB2) TYPE  TABLE

*"  TABLES

*"      ITAB4 TYPE  ZFM1_STRU_T

*"  CHANGING

*"     REFERENCE(ITAB3) TYPE  TABLE

*"----------------------------------------------------------------------

data: wa type ZFM1_STRU.

clear wa.

loop at itab1 into wa.

move wa to itab4.

   modify itab4.

   endloop.

ENDFUNCTION.

please help me to get the itabfinal into the program using above funtional module

Former Member

Helpful Answer

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