• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » How set changingparameter for the tSapInput component in Talend

#1 2012-07-26 11:13:59

felixfang
New member
Registered: 2012-07-25
Posts: 7

How set changingparameter for the tSapInput component in Talend

Hi,

I have an java project which gets data from remote SAP, then I want to implement it with Talend.

In Talend I used tSapConnection and tSAPInput, and tLibraryLoad to load sapjco.jar lib.

The connection is OK but after I met error, "JCO_ERROR_FIELD_NOT_FOUND : Field CHECKPOINT not a member of INPUT".

I checked the original java code, and found that two input parameters are needed, the first is "BATCHHINT", it is set using getImportParameterList().setValue(string, int). The second is "CHECKPOINT", which is set by getChangingParameterList().setValue(string, int).

But in Talend after I set the "Initialize input" of tSAPInput,(I added two rows in the 'initialize input' table, one named "BATCHHINT and one named "CHECKPOINT") and then switched to code view, both "BATCHHINT" and "CHECKPOINT" are set with getImportParameterList().setValue(string, int), I think this should be the reason of errors.

So how can I set the input of tSAPInput to set the changing parameter? Any suggestions will be appreciated.
My environment: Talend TOS 4.2.3 + sapjco3.jar + sapjco3.dll

regards,

Offline

#2 2012-07-26 11:24:15

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: How set changingparameter for the tSapInput component in Talend

Hi

I think you didn't configure Initialize input and Outputs of tSAPInput correctly.
Have you read the scenarios about tSAPInput in the document [TalendOpenStudio_Components_RG_xxx_EN]?

Regards,
Pedro


Only Paranoid Survive.

Offline

#3 2012-07-26 15:06:25

felixfang
New member
Registered: 2012-07-25
Posts: 7

Re: How set changingparameter for the tSapInput component in Talend

Thanks a lot for your reply, Pedro. I read the book but it has just a small part about tSAPInput.

In fact, I looked into the code for some while and found that I was wrong, it is not the problem of parameters. Even I  delete the parameter "CHECKPOINT" in the input table of tSAPinput I still got the same error.

"com.sap.conn.jco.JCoRuntimeException: (127) JCO_ERROR_FIELD_NOT_FOUND : Field CHECKPOINT not a member of INPUT"

In the java code I found one line:

resumeUtil.addLog("CHECKPOINT",
                                "CONNECTION:SUBJOB_OK:tLibraryLoad_1:OnSubjobOk",
                                "", Thread.currentThread().getId() + "", "",
                                "", "", "", "");

it has nothing to do with my configuration of tSAPInput, once I add this component this line appears. Does any one know what "CHECKPOINT" keyword in this line is used for?

Thanks in advance

Offline

#4 2012-07-27 03:49:26

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: How set changingparameter for the tSapInput component in Talend

Hi

First, I think these codes are not the root reason which caused this error.

Code:

resumeUtil.addLog("CHECKPOINT",
                                "CONNECTION:SUBJOB_OK:tLibraryLoad_1:OnSubjobOk",
                                "", Thread.currentThread().getId() + "", "",
                                "", "", "", "");

Have you tried to create a new job? Not simply delete the parameter CHECKPOINT?
Then could you upload the images about this job and the settings of tSAPInput?

Regards,
Pedro


Only Paranoid Survive.

Offline

#5 2012-07-27 10:58:27

felixfang
New member
Registered: 2012-07-25
Posts: 7

Re: How set changingparameter for the tSapInput component in Talend

Thanks Pedro,

You are right, it is not the root reason. I create a new job and found that once I use the component "tLibraryLoad", that code line I mentioned ( resumeUtil.addLog("CHECKPOINT",....) ) appears. Then I modified directly the function I called in SAP system and change both "BATCHINT" and "CHECKPOINT" into unchanged parameter, after that my original job works. (well, at least it has no errors in the input process)

euh.. sorry then I met another problem

com.sap.conn.jco.JCoRuntimeException: (127) JCO_ERROR_FIELD_NOT_FOUND : Field DATA not a member of OUTPUT
    at com.sap.conn.jco.rt.AbstractMetaData.indexOf(AbstractMetaData.java:384)
    at com.sap.conn.jco.rt.AbstractRecord.getTable(AbstractRecord.java:2941)
    at com.sap.conn.jco.rt.AbstractRecord.getTable(AbstractRecord.java:52)
    at newproject.sapconnjob_0_1.SapConnJob.tSAPInput_1Process(SapConnJob.java:720)
    at newproject.sapconnjob_0_1.SapConnJob.tSAPConnection_1Process(SapConnJob.java:351)
    at newproject.sapconnjob_0_1.SapConnJob.runJobInTOS(SapConnJob.java:1090)
    at newproject.sapconnjob_0_1.SapConnJob.main(SapConnJob.java:958)

"Data" is the table returned from remote function, I checked the java codes created by Talend, and found that this table is got from this code line,
"com.sap.conn.jco.JCoTable table_registros_devueltos_tSAPInput_1 exportParameterList_tSAPInput_1.getTable("DATA");" where "exportParameterList_tSAPInput_1" is got from "com.sap.conn.jco.JCoParameterList exportParameterList_tSAPInput_1 = function_tSAPInput_1.getExportParameterList();"

I wrote several java codes in eclipse for testing this remote function, when I use the list got by "getTableParameterList" rather than "getExportParameterList" to get the table "DATA", it will work with no errors. So I wonder whether I can modify my configuration in output of "tInSAPInput" to make the codes it generated use "getTableParameterList" but not "getExportParameterList".

My setting can be seen in my configurtion attached.
Regards,
Felix


Uploaded Images

Offline

#6 2012-07-27 11:01:07

felixfang
New member
Registered: 2012-07-25
Posts: 7

Re: How set changingparameter for the tSapInput component in Talend

also a image of the components.


Uploaded Images

Offline

#7 2012-07-27 11:02:57

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: How set changingparameter for the tSapInput component in Talend

Hi

In fact, you might try to modify the source code of this component by using your own code.
Besides, if you use tSAPConnection, you need to add tSAPCommit at the end of this job.

Regards,
Pedro


Only Paranoid Survive.

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » How set changingparameter for the tSapInput component in Talend

Board footer

Powered by FluxBB