Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
preethireddy_morsu
Product and Topic Expert
Product and Topic Expert
4,198

Overview

What is an IDoc?

IDoc or Intermediate Document is an SAP document format for business transaction data transfers. 
This blog describes the detailed steps to be followed for setting up and sending an IDoc from an SAP R3 system to SAP BPM via SAP PI  in a Process Orchestration setup.

An IDoc cannot be directly imported into SAP BPM.  The WSDL generated from an imported IDoc in ESR is not WS-I compliant – hence you may face runtime issues when BPM tries to consume the service interface created of IDoc type.

Let us see how we can overcome this constraint and have the scenario run successfully.


Creation of Design objects


Creation of wsdls


The IDoc we import from an SAP R/3 system will be used on the sender side but we cannot use this on the receiver side (BPM) because it is not WS-I compliant as mentioned in the earlier section.  We need to modify certain tags before using it on the receiver side. (Note:1414292)

  1. Import the IDoc from corresponding R/3 system in ESR.
    1. Open ESR,  right click on Imported objects, provide R3 system details and import IDoc (A)
      This will be used in the sender interface – let us denote this as 'A'.
  2. After the import is successful, open the IDoc, switch to the WSDL tab and Export the WSDL into a file
  3. Make a copy of the WSDL and edit it to reflect the following changes:
    1. Set the targetNamespace attribute to "urn:sap-com:document:sap:idoc:messages" and xmlns attribute to "urn:sap-com:document:sap:idoc:messages" for the xsd:schema
    2. Set the xmlns attribute to "urn:sap-com:document:sap:idoc:messages" for the <WSDL:definition> element
      Refer to the image below for an example.
    3. Import the modified WSDL as an external definition. (B)
      This will be used in the receiver interface – let us denote this as 'B'.
    4. Save and Activate all the changes.

Note : To set a relevant type for a data object in BPM for an element, there needs to be a name associated with the complex type.

For example.. Below is the structure of the exported idoc in ESR

<xsd:element name="HRCC1UPTEVEN01"><xsd:complexType><xsd:sequence><xsd:element name="IDOC" type="HRCC1UPTEVEN.HRCC1UPTEVEN01"/></xsd:sequence></xsd:complexType>

We need to have an associated name to the complex type as shown below.

<xsd:element name="HRCC1UPTEVEN01" type=”named_example_complex_type><xsd:complexType name=”named_example_complex_type><xsd:sequence><xsd:element name="IDOC" type="HRCC1UPTEVEN.HRCC1UPTEVEN01"/></xsd:sequence></xsd:complexType>


Creation of Service Interfaces

  1. Create these Interfaces with the listed attributes.
FieldSender Interface (SI_A)Receiver Interface (SI_B)
CategoryAbstractAbstract
Interface patternStateless XI 3.0 CompatibleStateless XI 3.0 Compatible
ModeAsynchronousAsynchronous
Request TypeIdocExternal Definition (3.d in Creation of wsdl section)

  2. Save and Activate all the changes.

Creation of Mappings

  1. Create a Message Mapping with source as IDoc (A) and target as External Definition (B)
    Note : This is required as the sender and receiver do not use the same schema.
  2. Perform the mapping with the corresponding field
  3. Create an Operation Mapping with source as Sender Interface (SI_A) and Target as Receiver Inteface (SI_B)
  4. Assign the message mapping to this operation mapping
    Save and Activate all the changes

Creation of Integration Flows

  1. Create an Iflow with following attributes
    FieldSenderReceiver
    InterfaceSI_ASI_B
    AdapterIdoc_AAESOAP, XI 3.0, JPR URL
  2. Assign the operation Mapping created to this integration Flow.
  3. Save , Activate and deploy all the changes

Modelling BPM Process

  1. Create a new Process Composer Development Project
  2. Import the SI_B from ESR under service Interfaces tab.
  3. The data types should be created under a namespace "urn:sap-com:document:sap:idoc:messages"
  4. Assign this to the SE of the BPM Process
  5. Create a data object and map in Output Mapping
  6. Build and Deploy the processes

Note : The WSDL might have errors  as "s4s-att-invalid-value: Invalid attribute value for 'maxOccurs' in element 'element'.
Recorded reason: cvc-datatype-valid.1.2.1: '9999999999' is not a valid value for 'nonNegativeInteger'."
This can be ignored.

Sending IDoc from R/3 System

  1. Trigger the IDoc from the R/3 system.
  2. Monitor the messages using the Message Monitor page in NWA. Verify that they have been delivered.
  3. The BPM Process should be started and the context data should be updated in the corresponding sent fields. This can be monitored in Manage Processes Page in NWA.



7 Comments
Former Member
0 Kudos

Hi preethireddy.morsu,

Thanks for your great blog.As you suggested I have followed point no:3 .When I'm trying to import the wsdl(SI) into BPM ,I'm getting below error .Could you please share your thoughts on this as early as possible.

>>>An internal error occurred during: "Importing MOIN models for XSDs and WSDLs...".

java.lang.OutOfMemoryError: Java heap space

at java.util.ArrayList.<init>(ArrayList.java:112)

at org.eclipse.xsd.impl.XSDParticleImpl$XSDNFA.initialize(XSDParticleImpl.java:1271)

at org.eclipse.xsd.impl.XSDParticleImpl$XSDNFA.<init>(XSDParticleImpl.java:1050)

at org.eclipse.xsd.impl.XSDParticleImpl$XSDNFA.initialize(XSDParticleImpl.java:1149)

at org.eclipse.xsd.impl.XSDParticleImpl$XSDNFA.<init>(XSDParticleImpl.java:1039)

at org.eclipse.xsd.impl.XSDParticleImpl$XSDNFA.initialize(XSDParticleImpl.java:1272)

at org.eclipse.xsd.impl.XSDParticleImpl$XSDNFA.<init>(XSDParticleImpl.java:1060)

at org.eclipse.xsd.impl.XSDParticleImpl.getDFA(XSDParticleImpl.java:2041)

at org.eclipse.xsd.impl.XSDModelGroupImpl.validateRoot(XSDModelGroupImpl.java:599)

at org.eclipse.xsd.impl.XSDComplexTypeDefinitionImpl.validate(XSDComplexTypeDefinitionImpl.java:1408)

at org.eclipse.xsd.impl.XSDConcreteComponentImpl.validate(XSDConcreteComponentImpl.java:565)

at org.eclipse.xsd.impl.XSDSchemaImpl.validate(XSDSchemaImpl.java:1653)

at com.sap.tc.esmp.tools.core.util.EMFUtils.validate(EMFUtils.java:613)

at com.sap.tc.esmp.tools.xsd.xml.EmfSchemaImporter.calculateAffectedPartitions(EmfSchemaImporter.java:903)

at com.sap.tc.esmp.tools.wsdl1import.Wsdl1Importer$ImportChain.calculateAffectedPartitions(Wsdl1Importer.java:365)

at com.sap.tc.esmp.tools.wsdl1import.Wsdl1Importer$ImportChain.resolveImportLink(Wsdl1Importer.java:545)

at com.sap.tc.esmp.tools.wsdl1import.Wsdl1Importer$ImportChain.createChainLink(Wsdl1Importer.java:522)

at com.sap.tc.esmp.tools.wsdl1import.Wsdl1Importer$ImportChain.init(Wsdl1Importer.java:461)

at com.sap.tc.esmp.tools.wsdl1import.Wsdl1Importer$ImportChain.<init>(Wsdl1Importer.java:337)

at com.sap.tc.esmp.tools.wsdl1import.Wsdl1Importer.prepareWsdlImport(Wsdl1Importer.java:1381)

at com.sap.tc.esmp.tools.wsdl1import.Wsdl1Importer.prepareWsdlImport(Wsdl1Importer.java:1368)

at com.sap.tc.esmp.tools.facade.Import.prepareWsdlImport(Import.java:106)

at com.sap.tc.esmp.tools.editor.jobs.RepositoryMetadataProcessor.doImportFiles(RepositoryMetadataProcessor.java:298)

at com.sap.tc.esmp.tools.editor.jobs.RepositoryMetadataProcessor.access$300(RepositoryMetadataProcessor.java:52)

at com.sap.tc.esmp.tools.editor.jobs.RepositoryMetadataProcessor$4.run(RepositoryMetadataProcessor.java:248)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Regards

Venkat

preethireddy_morsu
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Venkat,

Sorry, I was on vacation and could not respond earlier. Can you please confirm if you imported this wsdl from ESR ?

Meanwhile, let me check from my end by importing this wsdl.

Regards,

Preethi

Nikoleta
Advisor
Advisor
0 Kudos

Hello Venkat,

The reason of the import failure is maxOccurs="9999999999". This value is greater than the limit of an Integer number in Java. That's why the Eclipse EMF API cannot validate the document and the import in the BPM process fails. See SAP Note No 1988746.

Best regards,

Nikoleta

Nikoleta
Advisor
Advisor
0 Kudos

In Java world such great values as maxOccurs="9999999999" should not be ignored. Such a Web Service cannot be invoked from Java Application Server also. The same OutOfMemory will arise. The more proper value in the WSDL would be maxOccurs="unbounded" according to the specification.


Former Member
0 Kudos

Hi Nikoleta ,

Thank you .I raised a ticket to SAP ,even they said the same .

We are using NWDS 7.31 SP10 Patch 04 .This issue has been fixed by SAP in SP10 Patch 05.

Haven't tried on Patch 05 yet .I Will let you know on that status after patch upgrade.

Regards

Venkat

former_member187447
Participant
0 Kudos

Hi Preethi,

I imported the WSDL structure of the IDOC ZIPSPLO as external definition into the BPMN as per your blog, the only I am not doing is "To set a relevant type for a data object in BPM for an element, there needs to be a name associated with the complex type".

When I see the Data Object structure in BPMN I am missing the node IDOC, as shown in the screenshot. Did you come accross an issue like this and is it something to do with setting up the relevant type for a data object? Please suggest.

former_member607993
Contributor
0 Kudos
nikoleta.deneva

Your valuable thought on this please.

https://answers.sap.com/questions/12907416/how-to-collect-and-group-records-by-loop-count-in.html

 

Advance thanks!!