One Star

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.

  • Talend SAP RFC Server
26 REPLIES
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

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

Re: Usage of tSAPInput and RFC_READ_TABLE

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.
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Do you need any specific settings? Could you give more details, please?
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

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 Smiley Very Happy) 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
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Thanks for the assistance mue2000. Your hint gave me an idea for the next step Smiley Happy
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?
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Is here a talent team member, who can give me answers to the questions?
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

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.
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

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

Re: Usage of tSAPInput and RFC_READ_TABLE

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...
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Sure that was my first try on the Upload Image thing. i have an 20" 1600x900 so i will try..
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

TRY 2
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Now as you notice the tSapInput need to have the same Schema as the Function of which you are trying to call. There are many Variables within Most Built in RFC so try to only use what you will really need to help on processing time. Sap for RFC is inhertianly slow for me (1secto process is a revolution of the world for me) so i try to keep it Simple..... Using the TOS you will for sure need to have access to SE37 within SAP to Visualize the RFC you want to Use, so be sure to check with you company SAPController for the Correct access... HAVE FUN
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Thanks a lot for your answer.
I will try that.
It seems to be painfull to use ;-)
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Actually not so bad if u know how sap structure works(TOS Version). If your not familiar with Sap then i highly recommed TIS minimum
Your Welcome..
NOW.
SAP 'Commit' anybody know how to use this structure with the SAP Components yet?
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

When you are quoting something that has a spelling or grammar mistake or presents material in a confusing way, insert the term sic in italics and enclose it in brackets. Sic means, "This is the way the original
material was."
Example: She wrote, "I would rather die then be seen wearing the same outfit as my sister."
Should be than, not then.
testking 1Y0-264
testking 412-79
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

You have at this link a complete example of the use of tSapInput component:
http://churriwifi.wordpress.com/2010/01/13/ejemplo-talend-sap/
Good lucky!!!
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Great job, thanks. Interested in passing a popular IT certification exam like testking NS0-501, testking 1z0-042 and getting a promotion!
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Hi, I'm using RFC_READ_TABLE to extract data from a table... but I only want to get certain fields of the table.
How can I implement it or which input parameters I have to set in order to get only the fields I want?
thanks in advance
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Hi,

it is not that difficult.
You need to send the columns you want to the table 'FIELDS' and the parametername is 'FIELDNAME'
Obviously it has to be a table_input type and the parametervalue is a list of the wanted columns each in "" and seperated by ,
I attached a screenshot using SFLIGHT table
The last row in the input setting is the equal to a sql where planetype = 'A330-300'
Regards,
Harald
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

If you are interested in querying SAP Tables you may try http://remoteopensql.codeplex.com/ . Remote Open SQL is an Open Source project with a lot of limitations now but I hope to solve issue as quick as possible Smiley Very Happy
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Hi, I am using the tsapinput for the first time. I have successfully established the connection to the SAP server and created the job... I have also defined the input parameters as defined but when i run the program, i keep getting errors... One example is : " Exception in Component tSAPInput_1 com.SAP.conn.jco.JCoRuntimeException: (127) JCO_ERROR_FIELD_NOT_FOUND : Field not a member of tables at ....."
Can someone help on this please???
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Hi,
i am trying to use the tSapInput component successfully. Unfortunately trying to limitate the number of fields extracte dy the RFC_READ_TABLE i always obtain the following error:
Exception in component tSAPInput_2
java.lang.RuntimeException: Field FIELDS not a member of INPUT
at mdr.use_sap_rfc_original_0_1.USE_SAP_RFC_ORIGINAL.tSAPInput_2Process(USE_SAP_RFC_ORIGINAL.java:1385)
at mdr.use_sap_rfc_original_0_1.USE_SAP_RFC_ORIGINAL.tSAPConnection_1Process(USE_SAP_RFC_ORIGINAL.java:436)
at mdr.use_sap_rfc_original_0_1.USE_SAP_RFC_ORIGINAL.runJobInTOS(USE_SAP_RFC_ORIGINAL.java:2525)
at mdr.use_sap_rfc_original_0_1.USE_SAP_RFC_ORIGINAL.main(USE_SAP_RFC_ORIGINAL.java:2358)
Can you help me ?
Many thanks in advance.
Alessandro
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Hi,
I get the same error when I'm using the parameter type "table_input" in tSAPInput, too.
connected
Exception in component tSAPInput_1
com.sap.mw.jco.JCO$Exception: (127) JCO_ERROR_FIELD_NOT_FOUND: Field FIELDS not a member of INPUT
at com.sap.mw.jco.JCO$MetaData.indexOf(JCO.java:9278)
at com.sap.mw.jco.JCO$Record.getTable(JCO.java:14030)
at testproject.zz_rfctest_0_1.ZZ_RFCtest.tSAPInput_1Process(ZZ_RFCtest.java:594)
at testproject.zz_rfctest_0_1.ZZ_RFCtest.tSAPConnection_1Process(ZZ_RFCtest.java:344)
at testproject.zz_rfctest_0_1.ZZ_RFCtest.runJobInTOS(ZZ_RFCtest.java:943)
at testproject.zz_rfctest_0_1.ZZ_RFCtest.main(ZZ_RFCtest.java:811)
disconnected
My environment is below:
sapjco3
Talend Open Studio for Data Integration (5.1.2.r90681)
Is this error caused by using new TOS version??

Re: Usage of tSAPInput and RFC_READ_TABLE

Hi, 
I am also getting the same error.
connecting to socket on port 3950
connected
Exception in component tSAPOutput_2
java.lang.RuntimeException: Field MATERIALDESCRIPTION is not a member of INPUT
at fuso_mdm.sap_connectivity_0_1.SAP_Connectivity.tFileInputDelimited_1Process(SAP_Connectivity.java:1130)
at fuso_mdm.sap_connectivity_0_1.SAP_Connectivity.tSAPConnection_2Process(SAP_Connectivity.java:406)
at fuso_mdm.sap_connectivity_0_1.SAP_Connectivity.runJobInTOS(SAP_Connectivity.java:1422)
at fuso_mdm.sap_connectivity_0_1.SAP_Connectivity.main(SAP_Connectivity.java:1281)
disconnected
Is there a way to resolve this issue or an alternative ?
Talend Version: TOS 5.4.2
OS: Windows 64 bit
Environment: Java 7 (64 bit)
One Star

Re: Usage of tSAPInput and RFC_READ_TABLE

Hi,

it is not that difficult.
You need to send the columns you want to the table 'FIELDS' and the parametername is 'FIELDNAME'
Obviously it has to be a table_input type and the parametervalue is a list of the wanted columns each in "" and seperated by ,
I attached a screenshot using SFLIGHT table
The last row in the input setting is the equal to a sql where planetype = 'A330-300'
Regards,
Harald


thank you very much!

this sloved my current problem Smiley Happy