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

Reg:RFC LOGIC for the function module RFC_READ_TABLE

Former Member
0 Kudos
1,805

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
Read only

Former Member
0 Kudos
1,421


Yes its working Thanks a Lot

11 REPLIES 11
Read only

0 Kudos
1,421

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.

Read only

paul_bakker2
Active Contributor
0 Kudos
1,421

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.

Read only

0 Kudos
1,421

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

Read only

0 Kudos
1,421

Hi ,

budat  BETWEEN '21040101' AND '20140102' .

append i_options .

Read only

0 Kudos
1,421

Its not working

ERSDA  = BEWEEN '20140820'AND'20140911'

Read only

0 Kudos
1,421

WHY '= BETWEEN'??? REMOVE = 

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

Read only

0 Kudos
1,421


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

Read only

0 Kudos
1,421


i am not getting any values

Read only

Former Member
0 Kudos
1,422


Yes its working Thanks a Lot

Read only

0 Kudos
1,421

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

cheers

Paul

Read only

pearlin123
Newcomer
0 Kudos
1,302

You can use

call function 'f4_conv_selopt_to_whereclause'