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?
Hello Thomas
I strongly recommend to not build the IDoc by directly manipulating the RFC function module used for transferring it to an ABAP system via RFC, but to use the Java IDoc Library instead. It is an add-on library for JCo and will take care of a correct structure for the IDoc and will populate the metadata of the RFC table correctly. On IDoc level, you simply need to set the content.
Best regards,
Markus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you I appreciate your answer!
As I am currently replacing a .NET solution the first approach was to call the RFC function module directly, as it is very similar to the old solution, that can not be maintained anymore.
I would like to do as you suggested, unfortunately I have two obstacles:
Do you have a source example for a more substantial documentation of the SAP IDoc Library?
User | Count |
---|---|
77 | |
11 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.