09-16-2008 1:28 PM
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
09-16-2008 1:37 PM
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.
09-16-2008 1:37 PM
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.
09-16-2008 1:39 PM
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.
09-16-2008 1:44 PM
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
09-16-2008 1:51 PM
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