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

FM RFC_READ_TABLE

TJRP
Participant
0 Likes
3,200

Hi,

I have writtten a program in APO that is required to read data from a bespoke table in R/3, so I'm using FM RFC_READ_TABLE to do this, I can easily retrieve 1 material by adding it to the Option table. My problem is that I have a select option in APO that I want to use to restrict the values being returned and I'm not sure how to code it.

Any ideas would be appreciated,

Regards

J-J

Hi,

I have writtten a program in APO that is required to read data from a bespoke table in R/3, so I'm using FM RFC_READ_TABLE to do this, I can easily retrieve 1 material by adding it to the Option table. My problem is that I have a select option in APO that I want to use to restrict the values being returned and I'm not sure how to code it.

Any ideas would be appreciated,

Regards

J-J

4 REPLIES 4
Read only

Former Member
0 Likes
2,044

Hi

In Option You can write simple where clause as you write in select statement.

may be you will have to build string everytime using "Concatenate" in your program to pass it to the "option" parameter

Regards,

Prajakta

Read only

former_member222860
Active Contributor
0 Likes
2,044

Hi,

In the Options tab you can write your where clause

like this:

matnr BETWEEN 'M1000' AND 'M1500'

thanks\

Mahesh

Read only

Former Member
0 Likes
2,044

HI,

try something like belwo..



LOOP AT s_matnr.
CONCATENATE   'MATNR-SIGN = '  s_matnr-sign
                          'MATNR-OPTION =  ' s_matnr-option
                         'MATNR-LOW = ' s_matnr-low
                         'MATNR-HIGH = ' s_matnr-HIGH
                         OPTIONTEXT into OPTIONTEXT seperated by sapce.  
ENDLOOP.

   OPTIONS-TEXT = OPTIONTEXT.
   APPEND OPTIONS.

Pas this 
 CALL FUNCTION 'RFC_READ_TABLE' DESTINATION RFCSYS
           EXPORTING
                QUERY_TABLE          = 'AGR_1016'
           TABLES
                OPTIONS              = OPTIONS        "Pass to this as a option 
                FIELDS               = FIELDS
                DATA                 = ITAB .
              IF SY-SUBRC <> 0.
              ENDIF.

Prabhudas

Read only

TJRP
Participant
0 Likes
2,044

I built up the select statement by loop through the select option, I thought there would be a quick way but no such luck.