Using the Component for Creating Inbound IDoc Documents 
Purpose
The IDoc Connector for XML component can accept one or more XML document(s) or file(s) and send them as inbound IDoc(s) to a specified R/3 system.

Prerequisites
Note that when sending inbound IDoc documents, the IDoc Connector for XML only verifies the syntax of the XML tags in the XML document you provide. It does not verify the resulting IDoc, or the data in it.
You can obtain a skeleton XML file for a specific IDoc type by using the
SAP Assistant product (which is a part of
SAP Automation). See the topic
Creating the XML Document for Inbound IDocs.
Process Flow
To use this feature, of sending inbound IDocs from XML documents, you use the
SAPIDocProcessorInbound object in your application.You can do so in one of the following ways:
Method |
Details |
By using an existing Destination entry from the
SAP DCOM Connector product |
Use the SetConnectionParameters method of the SAPIDocProcessorInbound object, specifying the Destination name (from the SAP DCOM Connector) as a parameter.See the documentation of the
SAP DCOM Connector product for how to set up destinations. Note that the complete documentation for the product is available after you install the product. |
By allowing an end use to enter connection information through a logon dialog |
DCOM Connector Logon Component (from the
SAP Automation suite of tools) to display a Logon dialog to the user.
|
This connects to the destination system using the connection information you have set up in the previous step. It converts the specified XML document into an IDoc, and sends it to the receiving R/3 system.
Visual Basic Example
The following example uses a destination name that had been defined in the SAP DCOM Connector (SYS1). It then uses the XML file the end user specifies to send an inbound IDoc to R/3.
Private Sub SendDoc_Click()
'Instantiate the inbound object:
Dim idoc As New SAPIDOCPROCLib.SAPIDocProcessorInbound
On Error GoTo bad_news
idoc.SetConnectionParameters ("SYS1")
'SYS1 is an existing destination entry
'in SAP DCOM Connector
'
'Send the IDoc synchronously.
' Let the user specify the XML file path in an edit box (Text1):
Call idoc.SendIDocToR3(INBOUND_IDOC_PROCESS, Text1.Text)
MsgBox "IDoc processed and sent to R/3", vbInformation, "Cheers."
Exit Sub
bad_news:
MsgBox Err.Description & " " & Err.Source, vbCritical, Err.Number
Exit Sub
End Sub