Application Development 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: 

Custom Function Module - internal table with employee data

Former Member
0 Kudos

In a customized function module, in source code can we define the internal table of fields like export parameter and fetch the data?

Example:

employee number is import parameter and name, address , telephone number is export parameter.

Can I define the internal table of name , address and telphone number field and fetch the data.

If yes how can I do it?

Edited by: Julius Bussche on Sep 16, 2008 3:45 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Reshma,

I hope you can do it.

Suppose Import parameter is matnr and export parameter is maktx.

Now in the sourcs code you can write this way-

Data:

begin of wa_material,

maktx type makt-maktx,

end of wa_material.

Data:it_material like table of wa_material.

4 REPLIES 4

Former Member
0 Kudos

Hi Reshma,

I hope you can do it.

Suppose Import parameter is matnr and export parameter is maktx.

Now in the sourcs code you can write this way-

Data:

begin of wa_material,

maktx type makt-maktx,

end of wa_material.

Data:it_material like table of wa_material.

asik_shameem
Active Contributor
0 Kudos

Hi

Since the FM is global, you have to use global data types.

Create a global structure as ZEMP_DET in SE11.

There include fields Name, Address, telephone.

In the FM, Tables Tab section

EMP_DET TYPE ZEMP_DET.

Former Member
0 Kudos

hi,

yes you can.

write code for fetching data from db into int table.

pass that table i.e. under tables tab declare one more table like that int table.

now as u have table for required output no need to specify

export parameters.

when u call that FM extract output into one more table .

display that output.

i hope it will resolve ur query

naveen_inuganti2
Active Contributor
0 Kudos

Hi..

Best way to meet your reuirement is..,

1. Create one structure from SE11 with reuired fields in the same package

2. Now in the table parameters

> TABLE LIKE <CREATED STRUCTURE>

3. Now in the sourse code write simply select statement with where condition as import parameter.

You can define above internal table in your source code also, but you can't get output table until you define it as TABLE parameter!

Thanks,

Naveen.I