0

I'm looking for fetching only Transparent Table for RFC_READ_TABLE using Java JCoFunction

JCoFunction function2 = template2.getFunction();

JCoTable jcoTabled = function2.getTableParameterList().getTable("DATA");
Result :

/BEZ3/CHCDPAL                 
TRANSP  
----------------------------------
/BEZ3/CHCDLSP               
TRANSP  
----------------------------------
/BEZ3/CHCDPAS                
VIEW

Currently getting All Tables along with Transparent Table like VIEW too. So, is there any filter to fetch only TRANSP Table List.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Abhishek C
  • 13
  • 5
  • 2
    Does this answer your question? [Open SQL condition in RFC\_READ\_TABLE call via PyRFC](https://stackoverflow.com/questions/24172130/open-sql-condition-in-rfc-read-table-call-via-pyrfc) - Ignore the fact that the question is about pyrfc, the issue you have is about RFC_READ_TABLE (-> parameter OPTIONS) – Sandra Rossi Jun 17 '21 at 09:13
  • @SandraRossi, Both are Different. I wanted Transparent Table List for RFC_READ_TABLE in Java JcoFunction. – Abhishek C Jun 17 '21 at 12:41
  • Maybe this other answer will participate to do a complete answer then: [JCo RFC_READ_TABLE Data Buffer Exceeded](https://stackoverflow.com/questions/54189708/jco-rfc-read-table-data-buffer-exceeded) – Sandra Rossi Jun 17 '21 at 13:13

1 Answers1

0

Use the parameter OPTIONS of RFC_READ_TABLE to filter rows, below is to read all lines from DD02L where TABCLASS column equals 'TRANSP' :

...
JCoFunctionTemplate template2 = sapRepository.getFunctionTemplate("RFC_READ_TABLE");

function2.getImportParameterList().setValue("QUERY_TABLE", "DD02L");

JCoTable filterOptions = function2.getTableParameterList().getTable("OPTIONS");
filterOptions.appendRow();
filterOptions.setValue("TEXT", "TABCLASS = 'TRANSP'");
...
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
  • use above filter It shows only one result and that too is not correct one. – Abhishek C Jun 18 '21 at 05:51
  • @sandra_rossi, It's not the code Error. we need to do this way for filter of TRANSP Table. `filterOptions.setValue("TEXT", "DD02L~TABCLASS = 'TRANSP'");` – Abhishek C Jun 18 '21 at 14:32
  • I don't understand why your code needs the table "alias" `DD02L~`. It's optional, like in all SQL implementations, and like in all answers in Stack Overflow, like [this one](https://stackoverflow.com/questions/52201563/read-a-table-from-a-sap-system-using-jco). Maybe you are in a special context. – Sandra Rossi Jun 18 '21 at 16:32