How To Get only Transparent Table in SAP Table using Java Connector (JCo)

300 views Asked by At

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.

1

There are 1 answers

3
Sandra Rossi On

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'");
...