‎2009 Oct 22 5:54 AM
Hi all,
My requirement is to get a bapi or fm in which i should provide the table name and one value of a field in that table, which then should retrieve all the values of the other field matching my selection criteria. (like select statement with where condition)
Pls can anyone help me reg.
Regards,
Revathi.
‎2009 Oct 22 7:46 AM
You can use RFC_READ_TABLE function module to achieve this functionality.
‎2009 Oct 22 6:17 AM
Check whether any of these matches your requirement
RSAQSZT_SELECT_TABLE
LXE_COMMON_SELECT_FROM_TABLE
MONI_CREATE_SELECTION_TABLE
I_MASS_SELECT_TABLE
SELECT_ONE_TABLE
DB_SELECT_FULL_TABLE
SKTI_SELECTION_OPTIONS_TABLE
SLWY_SELECT_VALUE_FROM_TABLE
RKD_SEL_BUILD_SELECT_CLAUSE
RRW3_GET_QUERY_VIEW_DATA
‎2009 Oct 22 7:46 AM
You can use RFC_READ_TABLE function module to achieve this functionality.
‎2009 Oct 22 7:59 AM
Hello,
You can use function module RFC_READ_TABLE to do exactly that.
You pass the tables 'fields' (fields to be selected)
and 'options' (the 'where' clause), and get back the table 'data'.
It also returns field descriptions (length, type etc) for each
entry in 'fields'.
An example follows below.
NB. The optional parameter 'delimiter' puts that delimiter char
between each field in the 'data' table.
data: begin of i_options occurs 0.
include structure rfc_db_opt.
data: end of i_options.
data: begin of i_fields occurs 0.
include structure rfc_db_fld.
data: end of i_fields.
data: begin of i_data occurs 0.
include structure tab512.
data: end of i_data.
specify the fields to be selected in table 'i_fields'
i_fields-fieldname = 'AUART'.
append i_fields.
i_fields-fieldname = 'AUTYP'.
append i_fields.
specify the selection conditions in table 'i_options'
i_options = 'AUART = ''OA01'''.
append i_options.
i_options = 'AND AUTYP = 01'.
append i_options.
call function 'RFC_READ_TABLE'
destination 'NONE'
exporting
query_table = 'AUFK'
delimiter = '|'
tables
options = i_options
fields = i_fields
data = i_data.
cheers
Paultje Bakker
Hanabi Technology
‎2009 Oct 22 8:59 AM
Hi,
Thanx for all your replies. I'm just testing the fm RFC_READ_TABLE IN SE37. So can someone guide me to test it to perform the following statement.
select lifnr name1 from lfa1 where land1 = 'IN'.
Pls help me to solve it. What should be given in options, field and data.
Regards,
Revathi.
‎2009 Oct 22 9:46 AM
specify the parameters for the function module RFC_READ_TABLE as follows:
Import parameter
Query_Table LFA1
Tables
OPTIONS LAND1 = 'IN'
FIELDS NAME1
LIFNR
The output will be available in the table DATA.
Regards,
Ginu Litta
‎2009 Oct 22 10:12 AM