Outbound Processing Examples

These examples show various outbound processing scenarios.

This section contains examples for the following outbound processing scenarios:

  • Receiving a file-based IDoc from an SAP system using RFC
  • Receiving an ALE/IDoc from an SAP system using RFC
  • Receiving a request from SAP and returning a synchronous response using RFC

Receiving a File-based IDoc from SAP Using RFC

This section includes an example SAP Suite adapter for JCo 3.x configuration and the predefined SAPOutboundIDoc business process that runs when a file-based IDoc is received from an SAP system. The following example illustrates an SAP Suite adapter for JCo 3.x configuration used for receiving a file-based IDoc from an SAP system.

The following example using the GPM illustrates the SAPOutboundIDoc business process that runs by the SAP Suite adapter for JCo 3.x for an outbound file-based IDoc. This business process retrieves the filed-based IDoc from a directory on the SAP system and processes the file (translates the IDoc to EDI format and sends it to a trading partner). In addition, the business process starts a subprocess that uses an instance of the SAP Suite adapter for JCo 3.x to send a status message back to the SAP system.

The following example illustrates the same business process using BPML.

The following example illustrates the status message sent to the SAP system upon successful completion of the outbound business process that ran.

An SAP administrator can then view the status messages in the SAP system.

Receiving an ALE IDoc from SAP Using RFC

This section includes an example SAP Suite adapter for JCo 3.x configuration and the predefined SAPOutboundALE business process that runs when an IDoc is received from an SAP system using ALE technology. The following example illustrates an SAP Suite adapter for JCo 3.x configuration used for receiving an IDoc from an SAP system using ALE Technology.

The following example using the GPM illustrates the SAPOutboundALE business process that runs by the SAP Suite adapter for JCo 3.x for an outbound ALE IDoc. With ALE technology, the IDoc is included in the outbound request and becomes the primary document for the outbound business process that ran. The business process processes the IDoc (translates the IDoc to EDI format and sends it to a trading partner). In addition, the business process starts a subprocess that uses an instance of the SAP Suite adapter for JCo 3.x to send a status message back to the SAP system.

The following example illustrates the same business process using BPML.

The following example illustrates the status message sent to the SAP system upon successful completion of the outbound business process that ran.

EDI_DC40 900    46C   2   SYSTAT01
    STATUS      ALETSTPORTLI  0000001111                       
                                                               
   SAPI02    LS  SITEST        20040408041857                  
                                                               
                                                 
E2STATS001
     900       000001000000  EDI_DS40  90000000000006922012004040804185724
           Sterling SAPSuite         Control information of EDI
subsystem OK                                                   
                                                               
                                                               
                                                               
                                                               
                                        S 
E2STATS001
     900       000002000000  EDI_DS40  90000000000006922012004040804185706
           Sterling SAPSuite           Translation OK          
                                                               
                                                               
                                                               
                                                               
                                                               
                                                               
         S 
E2STATS001     
900       000003000000  EDI_DS40  90000000000006922012004040804185708
           Sterling SAPSuite          Syntax check OK          
                                                               
                                                               
                                                               
                                                               
                                                               
                                                               
        S 
E2STATS001      900
      000004000000  EDI_DS40  90000000000006922012004040804185710
           Sterling SAPSuite          Interchange handling OK  
                                                      
                                                               
                                                               
                                                               
                                                               
                                                               
   S

An SAP administrator can then view the status messages in the SAP system.

Receiving a Request from SAP and Returning a Synchronous Response Using RFC

This section includes an example SAP Suite adapter for JCo 3.x configuration and an example business process that runs when a request is received from an SAP system that requires a synchronous response. For example, a trading partner might need a price list for a particular order item before fulfilling the order.

Preconditions:
  • The RFC must exist in the SAP system so the SAP Suite adapter for JCo 3.x can retrieve the RFC metadata description for it.
  • The RFC must be registered in the RFC server of the SAP Suite adapter for JCo 3.x so the RFC server can listen for the selected RFC call.

You register an RFC in the SAP Suite adapter for JCo 3.x configuration instance that receives outbound RFC requests.

The following example illustrates a simple custom RFC module Z_TRIGGERSI that starts by the SAP system. This RFC module has two import parameters – PARAM and VALUE – and one export parameter – RES.

FUNCTION Z_TRIGGERSI. 
*"---------------------------------------------------------------------- 
*"*"Locale Interface: 
*"  IMPORTING 
*"  VALUE(PARAM) TYPE  STRING OPTIONAL 
*"  VALUE(VALUE) TYPE  STRING OPTIONAL 
*"  EXPORTING 
*"  VALUE(RES) TYPE  STRING 
*"---------------------------------------------------------------------- 
write 'test'. 
 
ENDFUNCTION. 

The following example illustrates an SAP Suite adapter for JCo 3.x configuration used for receiving the RFC request.

When an outbound RFC is detected by the SAP Suite adapter for JCo 3.x, the RFC server runs the business process specified on the SAP Suite adapter for JCo 3.x configuration. The RFC parameters are input to the business process and become the primary document. For example:

<?xml version="1.0" encoding="UTF-8"?> 
<Z_TRIGGERSI> 
<PARAM>AAA</PARAM> 
<VALUE>BBB</VALUE> 
<RES></RES> 
</Z_TRIGGERS

The following is an example of the structure of RFCTriggerParams:

<RFCTriggerParams>
    <Ashost></Ashost>
    <OrigPathAndName></OrigPathAndName>
    <IdocBaseName></IdocBaseName>
    <OrigPath></OrigPath>
    <MappedPath></MappedPath>
    <MappedIdocPathAndName></MappedIdocPathAndName>
    <command></command>
  </RFCTriggerParams>

The following example using the GPM illustrates an example business process that starts by the SAP Suite adapter for JCo 3.x for an outbound RFC request. This business process creates and returns a response to the RFC back to SAP.

The following example illustrates the same business process using BPML.

Note: You must set the ServerResponse parameter to 1 and pass it to the SAP Suite adapter for JCo 3.x used for sending a response back to SAP. Additionally, you must pass the ServerSessionID and ServerSessionSequenceNumber parameters to the SAP Suite adapter for JCo 3.x. Both ServerSessionID and ServerSessionSequenceNumber parameters are passed using process data in the previous example. See Business Process Definition Parameters for a description of these parameters.

The following example illustrates the response sent back to the SAP system:

<Z_TRIGGERSI>
<RES>My Response</RES> 
</Z_TRIGGERSI>