Application Development 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: 

Reg:RFC LOGIC for the function module RFC_READ_TABLE

Former Member
0 Kudos

hi EXPERTS

how can use options in RFC_READ_TABLE like SQL where clause.

date
ex: includes creation date and changed date from Mara table


1 ACCEPTED SOLUTION

Former Member
0 Kudos


Yes its working Thanks a Lot

10 REPLIES 10

0 Kudos

REFRESH: OPTIONS, FIELDS, ITAB.

        CONCATENATE '''' IUST10S-OBJCT '''' INTO OPTIONTEXT.

        CONCATENATE '''' IUST10S-AUTH '''' INTO OPTIONTEXT1.

      CONCATENATE 'OBJCT =' OPTIONTEXT 'AND' 'AUTH = ' OPTIONTEXT1 INTO

                                          OPTIONTEXT SEPARATED BY SPACE.

        OPTIONS-TEXT = OPTIONTEXT.

        APPEND OPTIONS.

        FIELDS-FIELDNAME = 'OBJCT'. APPEND FIELDS.

        FIELDS-FIELDNAME = 'AUTH'. APPEND FIELDS.

        FIELDS-FIELDNAME = 'FIELD'.  APPEND FIELDS.

        FIELDS-FIELDNAME = 'VON'.  APPEND FIELDS.

        FIELDS-FIELDNAME = 'BIS'.  APPEND FIELDS.

        CALL FUNCTION 'RFC_READ_TABLE' DESTINATION RFCSYS

             EXPORTING

                  QUERY_TABLE          = 'UST12'

             TABLES

                  OPTIONS              = OPTIONS

                  FIELDS               = FIELDS

                  DATA                 = ITAB

            EXCEPTIONS

                 TABLE_NOT_AVAILABLE  = 1

                 TABLE_WITHOUT_DATA   = 2

                 OPTION_NOT_VALID     = 3

                 FIELD_NOT_VALID      = 4

                 NOT_AUTHORIZED       = 5

                 DATA_BUFFER_EXCEEDED = 6

                 OTHERS               = 7.

paul_bakker2
Active Contributor
0 Kudos

Here's a simple example.

cheers

Paul

* 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.

0 Kudos

Hi ,

Thanks for the update,

but i need to extract Created materials from MARA Between two dates.

how can i pass two dates to to  I_OTIONS ..

please help me it s very urjent

0 Kudos

Hi ,

budat  BETWEEN '21040101' AND '20140102' .

append i_options .

0 Kudos

Its not working

ERSDA  = BEWEEN '20140820'AND'20140911'

0 Kudos

WHY '= BETWEEN'??? REMOVE = 

IT SHOULD BE   ERSDA  BEWEEN  '20140820' AND '20140911'

0 Kudos


Hi,,

i passed the same ERSDA BETWEEN '20140918' AND '20140930'

in FM 'RFC_READ_TABLE' but i am getting the exception 7. i am gettig the values after run this FM.

Can u plse help me

0 Kudos


i am not getting any values

Former Member
0 Kudos


Yes its working Thanks a Lot

0 Kudos

That's great news. Please close the thread by marking the answers.

cheers

Paul