Application Development and Automation 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: 
Read only

Help reg BAPI

Former Member
0 Likes
843

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.

1 ACCEPTED SOLUTION
Read only

anusurbab
Explorer
0 Likes
802

You can use RFC_READ_TABLE function module to achieve this functionality.

6 REPLIES 6
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
802

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

Read only

anusurbab
Explorer
0 Likes
803

You can use RFC_READ_TABLE function module to achieve this functionality.

Read only

paul_bakker2
Active Contributor
0 Likes
802

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

Read only

Former Member
0 Likes
802

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.

Read only

Former Member
0 Likes
802

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

Read only

0 Likes
802

Hi,

Thanks for your immediate reply.

Regards,

Revathi.