SAP RFC_READ_TABLE Length of Selection Criteria

One Star

SAP RFC_READ_TABLE Length of Selection Criteria

I have a list of 1,000+ profit centers contained in a regularly updated file. One of my requirements is to retrieve project information from SAP only where the profit center is a member of that list. I am using RFC_READ_TABLE to retrieve data from the SAP table. My job looks like this so far:
tJava --> tSAPInput --> tFileOutputDelimited
In tJava, I read the file and build the selection criteria string, which looks like "PRCTR = '12345' OR PRCTR = '98765' OR...". I set a context variable to that selection criteria. tSAPInput has its "OPTIONS" table ParameterValue set to context.ProfitCenterCriteria.
After many failures and head scratching I figured out that this method works, until the context variable length grows beyond a certain point. The "OPTIONS" table in RFC_READ_TABLE accepts a string of about 72 characters per row. You must split a single long statement amoung multiple rows. I can't figure out how to split the profit center selection criteria context variable into a form that the "OPTIONS" table will accept. I tried inserting commas in the string where the string should split between rows. I tried inserting line breaks. Nothing works. Is there a way to tell TOS that this string should be divided into multiple table rows?
Just to be clear, if I were to hard code the selection criteria directly in the tSAPInput component it would look like this:
"PRCTR = '12345' OR PRCTR = '98765'", "OR PRCTR = '13335' OR PRCTR = '98885'"
That works because TOS recognizes the comma as a new row. A variable that contains this: ""PRCTR = '12345' OR PRCTR = '98765' OR PRCTR = '13335' OR PRCTR = '98885'" does not work, because it is not being split into multiple rows.

Re: SAP RFC_READ_TABLE Length of Selection Criteria

you might have a better time by trying to modify the component to do what you want--
take a look at the generated code to see exactly what the issue is, and if you find a problem, look here:
Talend components use jet to generate code; look at the begin, main and end .javajet files.
One Star

Re: SAP RFC_READ_TABLE Length of Selection Criteria

I suggest to use tPLSAPInput free component from Talend Exchange ( It has a built in method to split long WHERE conditions into smaller pieces to set properly the OPTIONS table TEXT field.


Join us at the Community Lounge.

Register Now


Talend named a Leader.

Get your copy


Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables


How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration


Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.