cancel
Showing results for 
Search instead for 
Did you mean: 

RFC_READ_TABLE option comparing fields

hassin
Explorer
0 Kudos
2,229

Hallo,

I'm using the function module RFC_READ_TABLE to read some data from a table.

In my case I would like to extract data where two field as equal (in my case date).

I know that I have the this options to check the field with fixed values (example MATNR EQ '0001234656').

--> https://help.sap.com/doc/abapdocu_740_index_htm/7.40/de-DE/abenlogexp_any_operand.htm

But can I compare to fields with eachother (example date and date)?

I just tried it with SE37 and didn't get the required result.

Regards

Hassin

View Entire Topic
jmodaal
Active Contributor

Hello,

you can use the OPTION parameter for this. For the qualification of the 2nd field you have to use the table name and a "~". Here an example for selecting all records from SFLIGHT where SEATSMAX = SEATSOCC.

QUERY_TABLE: SFLIGHT

OPTION: SEATSMAX = SFLIGHT~SEATSOCC

Kind regards

Jan

hassin
Explorer
0 Kudos

Hallo Jan,

thanks for the feedback, I try it with the table LIPS but it didn't work.

I used the fields MBDAT and AEDAT.

Result:

Regdas

Hassin

jmodaal
Active Contributor
0 Kudos

Hello hassin,

this is another problem. The tables parameter of RFC_READ_TABLE for supplying the data has a length of 512 bytes - the attempt to read records with a bigger size causes the shown error.

If you do not need all fields of the LIPS table, you can specify the necessary fields in table FIELDS (specifying the field name is enough - offset, length etc. will be provided by RFC_READ_TABLE) to reduce the overall length of the data records to be returned.

If you need all fields, you have to leave RFC_READ_TABLE behind you and try another one. If available, CNVCF_CCE_RFC_READ_TABLE offers the capability to read tables with a record length up to 4096, and /SAPDS/RFC_READ_TABLE2 offers the capability for a record length up to 30KB.

Kind regards

Jan

hassin
Explorer
0 Kudos

Hallo Jan,

thanks for you support, it's working!

Regradas

Hassin