Using changing and table parameters in Function Modules in SAP

Using tables and chanding parameters as exporting and importing parameters of a Function module in SAP ABAP

A+ A-

Requirement: Develop a Function Module to get a list of materials for a material type.

Analysis: As per business a material type can have 'n' number of materials(we have to use internal tables), so we need to get materials from MARA for a material type input, we have to use function module tables.

As per SAP, tables in function modules obsolete, instead using them, we can create a table type in SE11, use it as exporting parameter.

Changing and Tables are parameters of Function Modules. Changing: Changing parameter acts as both exporting and importing parameters. Tables: These are internal tables which can import and export.

Using Tables in SAP Function Modules

Go to SE37, provide name as ZSAPN_FM_TABLES, click on create.

Using tables in Function Modules

A pop up will open, provide a function group (we have created already), a short text and enter.

tables in SAP FM

Go to import tab, provide parameter name as IM_MTART -> TYPE -> MARA-MTART, enter.

Using tables in SAP FM

Go to 'Tables' tab, provide parameter name as T_MARA -> LIKE -> MARA, enter.You will get a warning message saying tables are obsolete just ignore it, hit enter.

Using tables in function modules

Go to source code tab, add below logic to material details.

Using tables in SAP FM

Execute the Function Module(F8), provide a material type ex: FERT, execute(F8), you will get list of materials for that material type.

Using tables in SAP ABAP Function modules

Learner Questions

No Questions by learners, be first one to ask ..!!

    Please Sign in to ask a question

    Was this lesson helpful to you? Yes No 90 People out of 104 think this lesson helpful

    Lesson Navigation

    ←Previous Chapter
    Next Chapter →