‎2006 Nov 15 4:41 PM
Hi,
I have a requirement and I am not sure If I can do this using a function module.
I'll import a single value and do a lookup on a table for all the records that match this. Then I'll need to export this list of values.
Can this be done? thanks a lot
If you can send me an example, I'll appreciate it.
‎2006 Nov 15 4:44 PM
Of course you can do that.
Have a IMPORT variable and have internal table in the TABLES parameter that would refer to one of the data dictionary strucutres.
In the function
SELECT * FROM TAB INTO ITAB WHERE COLUMN = IMPORTED VALUE.
This is the simplest way of doing.
Regards,
Ravi
Note Please mark all the helpful answers
‎2006 Nov 15 4:44 PM
Of course you can do that.
Have a IMPORT variable and have internal table in the TABLES parameter that would refer to one of the data dictionary strucutres.
In the function
SELECT * FROM TAB INTO ITAB WHERE COLUMN = IMPORTED VALUE.
This is the simplest way of doing.
Regards,
Ravi
Note Please mark all the helpful answers
‎2006 Nov 15 4:59 PM
Ravi,
thanks. But how do I export that Internal table?
If I have to do that, my export parameter should be of type table. how do I do that?
Thanks
‎2006 Nov 15 5:02 PM
If you are working with the latest version then TABLES parameter is obsolete.
For that create a TABLE TYPE and use that to refer for the parameter in the EXPORT section of the function module.
If its custom structure, then
1. Create a structure in SE11,
2. Create a table type referrting to strcture above, in SE11
3. Use the table type to refer in the function module.
You can create a table type using DATA TYPE option of SE11
Regards,
Ravi
Note - Please mark all the helpful answers
‎2006 Nov 15 4:58 PM
hi Gova,
First check for the values whether there exists any match in the database at at selection screen event.
at selection-screen.
select * from Table where <Conditions>.
if sy-subrc <> 0.
message e000 with 'No records Found'.
endif.
Start-of-selection.
perform get_data.Regards,
Santosh