Business Processes and Rules: Siebel Enterprise Application Integration > Data Mapping Using Scripts >

Sample Siebel eScript


This section provides a sample Siebel eScript map for transforming data from a Siebel Account to SAP to retrieve an order list. The map is used to convert between Oracle's Siebel Account object and the equivalent SAP R/3 objects.

function GetSAPOrderStatus_SiebelToBAPI (inputMsg, outputMsg)
{
/* Input Objects' Integration Components:
* Order Object (Order - Get SAP Order Status (Siebel))
* Order
*
* Output Object's Integration Components:
* BAPI Import (Order - Get SAP Order Status (BAPI Input))
* Import Parameters
*/

/*
* Set up EAI Lookup objects
*/

/*
* Set up EAI Input Message objects
*/

var iOrderObj; // Siebel Order instance
var iOrderComp; // Order

/*
* Set up EAI Output Message objects
*/

var oGSObj; // BAPI instance
var oGSImportComp; // Import Parameters

/*
* Find and create top-level integration object
*/

iOrderObj = inputMsg.GetIntObj ("Order - Get SAP Order Status
(Siebel)");

oGSObj = outputMsg.CreateIntObj ("Order - Get SAP Order
Status
(BAPI Input)");

/*
* Read int object instances from EAI message
*/

while (iOrderObj.NextInstance ())
{


/*
* Create "Get Status" object
*/

oGSObj.NewInstance ();


/*
* Read "Order" component
*/

iOrderComp = iOrderObj.GetPrimaryIntComp ("Order");

oGSImportComp = oGSObj.CreatePrimaryIntComp
("Import Parameters");

if (iOrderComp.NextRecord ())
{
/*
* Write "Import Parameters" component
*/

oGSImportComp.NewRecord ();
oGSImportComp.SetCopySource (iOrderComp);
oGSImportComp.CopyFieldValue ("SALESDOCUMENT",
"Integration Id");
}
}
}

Business Processes and Rules: Siebel Enterprise Application Integration Copyright © 2006, Oracle. All rights reserved.