on 04-05-2023 3:17 PM
Hello,
I am new developing a Java SAP JCo application and currently trying to send data over a tRFC interface to the customer.
Basically what it does:
We have a JCoServer that receives iDocs and saves them to a database table e.g. SAP_INBOUND. After processing the data, we store it in another table e.g. SAP_OUTBOUND. The SAP JCoClient will then pick up records from this table and sent them to the SAP gateway. Both use the IDOC_INBOUND_ASYNCHRONOUS JCoFunction.
Client specifics
In the client I just get the JCoDestination, try to get the JCOFunction for the IDOC_INBOUND_ASYNCHRONOUS.
After that I get the JCoTable with
JCoTable idocControlTable = getIDocInboundAsynchronousFunction().getTableParameterList().getTable("IDOC_CONTROL_REC_40");
Then I append one row:
idocControlTable.appendRow();
and iterate all values of a Java Map to set the JCoTable values:
idocControlTable.setValue("KEY", "VALUE");
After that I do the same with the IDOC_DATA_REC_40 table with the only difference, that there are of course more entries to iterate.
The last step is:;
getIDocInboundAsynchronousFunction().execute(jcoDestination);
The problem
The customer claims that there are more iDocs arriving, than they expect. We previously used a .NET SAP interface and the customer received the same amount of iDocs we wrote in the IDOC_CONTROL_REC_40 table. The issue occurred since we used the Java SAP JCo solution.
The program logs (iteration of rows from the database as well as iteration of the IDOC_CONTROL_REC_40 itself) as well as the SAP traces show for instance 10 iDocs have been sent, but the customer has received 30.
Expectation
I know, that without the source code it is more difficult to analyze. The main goal was to ask, if there is another way to add rows to a table or trigger the transmission to the SAP Gateway in SAP JCo?
Maybe other people have experienced the same kind of thing and it is a configuration side effect?
There can only be three reasons for this kind of problem:
But if this can be reproduced consistently, then it should not be difficult to find such a mistake by comparing the JCo trace from the server program with the JCo trace from the client program!
Especially if the client program is running with multiple threads, you need to have a very good "lock concept" for preventing that two threads are working on the same IDoc at the same time... And my recommendation would be that the server program saves the TID of the incoming IDoc into the DB table together with the IDoc data, and the client program then uses the same TID for its call to the target system. That should already prevent duplicates in case two threads are sending the same IDoc into the target system: the target system will ignore one of the two, because the TID is already known!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.