More than Just Lines on a Map: Best Practices for U.S Bike Routes
External system non_sap client_to_idoc_adapter_(aae)
1. https://www.linkedin.com/groups/8483193
INTEGRATION COMMUNITY
0
External System non-SAP Client to Idoc
Adapter (AAE) Part I
Applies to: SAP PO 7.4 SP10 and SAP HR, JCO 3.0.14 (32 BIT), SAPIDOC 3.12
Summary: We want to explain how to generate a java client on NWDS to send idocs from a non-SAP system to a
SAP PO system throw idoc adapter advance extended (AAE).
Author: Integration Community
Created on: 2016/04/05
3. https://www.linkedin.com/groups/8483193
Introduction
On this document we face how to implement a client server to send idocs from a non-SAP system to PO via AAE
idoc. Below step by step procedure explain way to register program ID into PO gateway and obtain metadata to
achieve our goal from a SAP system (metadata repository by default).
You can see into next flow picture how connection should be split into two points:
1. Sending idoc to PO and register idoc on PO via idoc sender AAE (Idoc Message:
HRCC1UPTEVEN.HRCC1UPTEVEN01 )
2. Checking metadata into a SAP system.
Document Scope
non SAP System
SAP System
Process Orchestration
GATEWAY
Sender Idoc
program ID
register
Idoc:HRCC1UPTEVEN01 Idoc:HRCC1UPTEVEN01
Check_metadata_idoc
propertyFile: SERVER_REPOSITORY. jcoDestination
Next integration community document relate will explain opposite direction from SAP system to non-SAP system and
how to handle creation java server to receive idocs.
This document has been created and developed by the Integration Community team (Roberto
Cantero and Federico Abait)
6. https://www.linkedin.com/groups/8483193
4 Add libraries: Add External
JARs…:
-sapjco3.jar (in my case,
version 3.0.14 32BIT, because
my NWDS version is 32BIT)
-sapidoc3.jar
Clock: OK
5 Create new package with name
com.sap.conn.idoc.examples
Click: OK
7. https://www.linkedin.com/groups/8483193
6 By the moment project should
looks like this
7 Create new class
IDocClientExample with the
following characteristics.
Click: Finish
8 Replace default code with that
one
package com.sap.conn.idoc.examples;
import com.sap.conn.jco.*;
import com.sap.conn.idoc.*;
import com.sap.conn.idoc.jco.JCoIDoc;
import java.io.*;
public class IDocClientExample {
public static void main(String[] args) {
try
8. https://www.linkedin.com/groups/8483193
{
String iDocXML = null;
FileReader fileReader;
try
{
fileReader = new
FileReader("...//workspace//JCOExampleIdocAdapterAAE//src//com//sap//conn//idoc//exampl
es//Client_IDocDocumentAsXML_Example.xml");
BufferedReader br = new
BufferedReader(fileReader);
StringBuffer sb = new StringBuffer();
String line;
while ((line = br.readLine()) != null)
{
sb.append(line);
}
iDocXML = sb.toString();
br.close();
fileReader.close();
}
catch(Exception ex)
{
ex.printStackTrace();
}
// see configuration file CLIENT_PO.jcoDestination and
SERVER_REPOSITORY.jcoDestination provided in the installation directory
JCoDestination
destination=JCoDestinationManager.getDestination("CLIENT_PO");
IDocRepository iDocRepository = JCoIDoc.getIDocRepository(destination);
String tid = destination.createTID();
IDocFactory iDocFactory = JCoIDoc.getIDocFactory();
IDocXMLProcessor processor=iDocFactory.getIDocXMLProcessor();
IDocDocumentList iDocList=processor.parse(iDocRepository, iDocXML);
JCoIDoc.send(iDocList, IDocFactory.IDOC_VERSION_DEFAULT, destination, tid);
destination.confirmTID(tid);
}
catch(Exception e)
{
e.printStackTrace();
}
System.out.print("program end");
}
}
9 Take in account the following
line in the code
fileReader = new
FileReader("...//workspace//JCOExampleIdocAdapterAAE//src//com//sap//conn//idoc//exampl
es//Client_IDocDocumentAsXML_Example.xml");
Note in this line we are making reference to xml file that it contents the Idoc to be sent to
PO. In our case it will be in the following path
“//workspace//JCOExampleIdocAdapterAAE//src//com//sap//conn//idoc//examples//”
9. https://www.linkedin.com/groups/8483193
10 Content in file
Client_IDocDocumentAsXML_
Example.xml
<?xml version="1.0" encoding="UTF-8"?>
<HRCC1UPTEVEN01>
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
<TABNAM>EDI_DC40</TABNAM>
<STATUS>50</STATUS>
<DIRECT>1</DIRECT>
<OUTMOD>2</OUTMOD>
<IDOCTYP>HRCC1UPTEVEN01</IDOCTYP>
<MESTYP>HRCC1UPTEVEN</MESTYP>
<SNDPOR>XXX</SNDPOR>
<SNDPRT>LS</SNDPRT>
<SNDPRN>XXXX1002</SNDPRN>
<RCVPOR>XXX</RCVPOR>
<RCVPRT>LS</RCVPRT>
<RCVPRN>XXXCLNT200</RCVPRN>
<CREDAT>20160207</CREDAT>
<CRETIM>053513</CRETIM>
</EDI_DC40>
<E1BPCC1UPTEVEN SEGMENT="1">
<SOURCE_SYS>XXXCLNT200</SOURCE_SYS>
<TEVENTTYPE>P01</TEVENTTYPE>
<TERMINALID>0029</TERMINALID>
<LOGDATE>20160207</LOGDATE>
<LOGTIME>053259</LOGTIME>
<PHYSDATE>20160207</PHYSDATE>
<PHYSTIME>053258</PHYSTIME>
<TIMEID_NO>00003840</TIMEID_NO>
<PERNO>01002461</PERNO>
</E1BPCC1UPTEVEN>
<E1BPCC1UPTEVEN SEGMENT="1">
<SOURCE_SYS>XXXCLNT200</SOURCE_SYS>
<TEVENTTYPE>P01</TEVENTTYPE>
<TERMINALID>0029</TERMINALID>
<LOGDATE>20160207</LOGDATE>
<LOGTIME>053307</LOGTIME>
<PHYSDATE>20160207</PHYSDATE>
<PHYSTIME>053306</PHYSTIME>
<TIMEID_NO>00003865</TIMEID_NO>
<PERNO>00021287</PERNO>
</E1BPCC1UPTEVEN>
<E1BPCC1UPTEVEN SEGMENT="1">
<SOURCE_SYS>XXXCLNT200</SOURCE_SYS>
<TEVENTTYPE>P01</TEVENTTYPE>
<TERMINALID>0029</TERMINALID>
<LOGDATE>20160207</LOGDATE>
<LOGTIME>053449</LOGTIME>
<PHYSDATE>20160207</PHYSDATE>
<PHYSTIME>053449</PHYSTIME>
<TIMEID_NO>00003953</TIMEID_NO>
<PERNO>00021611</PERNO>
</E1BPCC1UPTEVEN>
</IDOC>
</HRCC1UPTEVEN01>
11 Take in account the following
line in the code
JCoDestination destination=JCoDestinationManager.getDestination("CLIENT_PO");
Note: in this line we are making reference to property file CLIENT_PO.jcoDestination (in
the installation directory) where is the necessary parameter to connect to the gateway
defined. The parameters defined are:
CLIENT_PO.jcoDestination
SNDPOR: The port
name should be
same as Logical
system name of the
business system
(Sender) defined in
SLD.
10. https://www.linkedin.com/groups/8483193
jco.client.gwhost: Gateway host
jco.client.gwserv: Gateway Service
jco.client.tpname: Program ID (it will be registered by Sender IDOC Adapter (you can
find the settings bellow)
jco.client.type= Client type (for example “E”)
jco.destination.repository_destination: reference the name of the property file
SERVER_REPOSITORY. jcoDestination (in the installation directory) where is the
necessary parameter to connect to SAP to recovery the metadata of idoc. The parameters
defined are:
SERVER_REPOSITORY. jcoDestination
jco.client.type: Connection Type (for example “3”)
jco.client.client: System Number
jco.client.user: Logon User
jco.client.passwd: Logon Password
jco.client.lang: Logon Language
jco.client.mshost: Application Server (host)
jco.client.r3name: ID System
jco.client.group: Logon Group (for example “SPACE” o “PUBLIC”)
jco.client.trace
12 The project in the NWDS should
looks like follow
SAP PO configuration
11. https://www.linkedin.com/groups/8483193
13 The Communication Channel
Sender IDOC should be as
follow
14 You have to set the system
Java Virtual Machine
parameter
Parameter: “jco.allow_non_abap_partner” to “1”, otherwise the non-SAP
communication is not allowed.
This configuration must be done in the “Config Tool”.
15 Now you can configure
Integrated Configuration (ICO)
You must define:
-Sender Business System (System non-SAP): The port name should be same as Logical
system name of the business system (Sender) defined in SLD.
-Receiver Business System (System SAP):
Program ID to be
registered in the gateway
Gateway to register the
Program ID
12. https://www.linkedin.com/groups/8483193
Configuration is done and now you have to test and monitoring it.
16 Once Sender Idoc has
registered the Program ID in the
gateway, you can execute the
client application in NWDS
17 Once the execution is finished
18 Go to monitoring in PO server
References
http://scn.sap.com/docs/DOC-52483
http://scn.sap.com/thread/3535452
http://help.sap.com/saphelp_nwpi711/helpdata/en/48/634503d4e9501ae10000000a42189b/content.htm?fra
meset=/en/48/707c54872c1b5ae10000000a42189c/frameset.htm¤t_toc=/en/b4/3f9e64bff38c4f9a196
35f57eb4248/plain.htm&node_id=506
http://scn.sap.com/community/pi-and-soa-middleware/blog/2011/09/19/exchanging-idocs-with-non-sap-
system-over-tcpip-using-pi-as-middleware
http://a248.g.akamai.net/n/248/420835/56c2ce22d9f611f223717a77d0032ea05633c0516dffe22233af9fce22
318231/sapasset.download.akamai.com/420835/sapcom/docs/2015/08/dc66efe1-557c-0010-82c7-
eda71af511fa.pdf
Note: 1752276 - Idoc support for non-sap systems
Note: 1729203 - Support for communication with external RFC server
Note: 1717833 - RFC destinations to support external rfc servers
Note: 1877907 - Support of extern-to-extern RFC communication with JCo 3.0
.