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.

IdocToBPM.JPG

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.

WSDLs.JPG

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.
Field Sender Interface (SI_A) Receiver Interface (SI_B)
Category Abstract Abstract
Interface pattern Stateless XI 3.0 Compatible Stateless XI 3.0 Compatible
Mode Asynchronous Asynchronous
Request Type Idoc External 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
    Field Sender Receiver
    Interface SI_A SI_B
    Adapter Idoc_AAE SOAP, 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.



To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. Venkat Nimmagadda

    Hi Preethi,

    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

    (0) 
  2. Preethi Reddy Morsu Post author

    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

    (0) 
    1. kalyan golla

      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.Capture.PNG

      (0) 
  3. Nikoleta Deneva

    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

    (0) 
  4. Nikoleta Deneva

    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.

    (0) 
    1. Venkat Nimmagadda

      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

      (0) 

Leave a Reply