Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

Usage of tSAPInput and RFC_READ_TABLE

I would like to use RFC_READ_TABLE with the tSAPInput component.
Can anyone explain me, how I must set the parameters for this RFC?
Which inputs parameters do I have to set, in order to pick only certain
fields out of a table (delimitation 512 characters) and how can I implement
a filter?
Thanks in advance.

Labels (1)
  • Other

26 Replies
Anonymous
Not applicable

Hi Matz,
there is a webinar in German Language which may help you at http://www.talend.com/webinar/archive/
Kind regards,
Marcin K.
_AnonymousUser
Specialist III
Specialist III
Author

Thank you for the hint. Unfortunately the topic in the video is not treated so in detail, as I need it.
Does anyone have experience with the topic? That would help me much.
Anonymous
Not applicable

Do you need any specific settings? Could you give more details, please?
_AnonymousUser
Specialist III
Specialist III
Author

you can use the SAP function RFC_READ_TABLE with input parameters type table.
there is a table for the fields you want to retrieve and there is a table for the conditions.
matz_abg (and me 0683p000009MACJ.png) wants to know, how you have to set the "initialize input" and "extract data" section to get data.
Sample data:
In SAP, you have a table named "T001"
You want to retrieve the columns "MANDT", "BUKR", "BUTXT"
You only want BUKR > "0999"
For RFC_READ_TABLE, you have to set:
- Input Parameter "QUERY_TABLE" to "T001"
- Table "FIELDS" has to contain 3 entries with the following infos:
"FIELDNAME", "OFFSET", "LENGTH", "TYPE", "FIELDTEXT" (for each field MANDT; BUKR, BUTXT
- Table "OPTIONS" has to have one entry with
"TEXT" containing "BUKR > '0999'"
You receive
- Table "DATA" with 3 columns as specified
_AnonymousUser
Specialist III
Specialist III
Author

Thanks for the assistance mue2000. Your hint gave me an idea for the next step 0683p000009MACn.png
If I use the following configuration, I receive data (10 rows as specified) for exactly one field of the result structure (here ZDATUM)
			com.sap.mw.jco.IFunctionTemplate functionTemplate_tSAPInput_1 = repository_tSAPInput_1
.getFunctionTemplate("RFC_READ_TABLE");
com.sap.mw.jco.JCO.Function function_tSAPInput_1 = functionTemplate_tSAPInput_1
.getFunction();
com.sap.mw.jco.JCO.ParameterList importParameterList_tSAPInput_1 = function_tSAPInput_1
.getImportParameterList();
com.sap.mw.jco.JCO.ParameterList exportParameterList_tSAPInput_1 = function_tSAPInput_1
.getExportParameterList();
com.sap.mw.jco.JCO.ParameterList tableParameterList_tSAPInput_1 = function_tSAPInput_1
.getTableParameterList();
importParameterList_tSAPInput_1.setValue("", "DELIMITER");
importParameterList_tSAPInput_1.setValue("", "NO_DATA");
importParameterList_tSAPInput_1.setValue("ZEEIN", "QUERY_TABLE");
importParameterList_tSAPInput_1.setValue(10, "ROWCOUNT");
importParameterList_tSAPInput_1.setValue(0, "ROWSKIPS");
com.sap.mw.jco.JCO.Table table_input_table_tSAPInput_1 = tableParameterList_tSAPInput_1
.getTable("FIELDS");
table_input_table_tSAPInput_1.appendRow();
table_input_table_tSAPInput_1.setValue("ZDATUM", "FIELDNAME");
table_input_table_tSAPInput_1.setValue(0, "OFFSET");
table_input_table_tSAPInput_1.setValue(8, "LENGTH");
table_input_table_tSAPInput_1.setValue("CHAR", "TYPE");
table_input_table_tSAPInput_1.setValue("ZDATUM", "FIELDTEXT");
client_tSAPInput_1.execute(function_tSAPInput_1);

If I want to see more than one field, I must add new lines into the table " Initialize input". If I put new lines for the field LFDNR the generated code looks like
			table_input_table_tSAPInput_1.appendRow();
table_input_table_tSAPInput_1.setValue("ZDATUM", "FIELDNAME");
table_input_table_tSAPInput_1.setValue(0, "OFFSET");
table_input_table_tSAPInput_1.setValue(8, "LENGTH");
table_input_table_tSAPInput_1.setValue("CHAR", "TYPE");
table_input_table_tSAPInput_1.setValue("ZDATUM", "FIELDTEXT");
table_input_table_tSAPInput_1.setValue("LFDNR", "FIELDNAME");
table_input_table_tSAPInput_1.setValue(0, "OFFSET");
table_input_table_tSAPInput_1.setValue(3, "LENGTH");
table_input_table_tSAPInput_1.setValue("CHAR", "TYPE");
client_tSAPInput_1.execute(function_tSAPInput_1);

So the second definition (LFDNR) overwrites the first (ZDATUM).
If I execute this job, I receive 10 rows with LFDNR, the column ZDATUM was not displayed.
How can I say, that a new record of the table FIELDS begins?
Second Problem:
If I want to define a filter, I must fill the table "OPTIONS".
If I insert in addition a new line OPTIONS for the table (using also table_input),
the generated SOURCE code contains an error, because the variables for the table FIELDS
and the table OPTION have the same names. Is this a bug?
Anonymous
Not applicable

Is here a talent team member, who can give me answers to the questions?
Anonymous
Not applicable

Hi folks.
I have just discovered Talend and trying to evaluate it with SAP (3.0.4 version).
MUE2000, I have tried to do what you explained to get the t001 table data, but I do not find the way to send the table with the fields information to the RFC function.
Could you please explain in detail to a noob user as I am 😉
Thanks a lot in advance.
Anonymous
Not applicable

HERE is a screen Shot of a similiar RFC_TABLE_READ, but for a Custom Query. It Should Help you as well..
Anonymous
Not applicable

Thanks a lot for your quick reply alanc007
Unfortunately beacause of the picture resize, they are unreadable 😞 I cannot read the parameters of the sap connector (or maybee I am not opening them in the right way)
Could you please try to republish them...