Wednesday, February 13, 2013

Excel Upload



Excel Upload




Requirement:

Load data into Siebel Application from a CSV file.

Solution:

Following are some of the possible approaches for uploading the data from CSV file into Siebel application.

·         Import Object
·         Business Service (Vanilla)
·         Business Service (Custom)
·         COM


Implementation:

·         Import Object:

Using Import option, End user can import the data by selecting Import menu option and inputting the data in the form of Text, CSV or any other format.

Limitations:

1.     Import Objects should only be defined on the BCs which are Primary BCs of the BO.
2.     Import Objects will be active for a list applet only.
3.     We cannot configure Imports for Child BCs in a BO.
4.     “Import” menu item is present on all the list applets, but active on only those which satisfies above condition.
5.     Specify all the required fields in the “Import Object” (tools) and in the source file as well. If required data is not loaded, it will be error out, saying required input missing.
 

    Development:

1)     Make sure BC using for Import is Primary BC of the BO. If not modify accordingly or

i)              Create a New BO and add the identified BC as Primary BC
ii)             Create View and List Applet based on the BO and BC created in Step (i).

 


2) Navigate to ‘Import Object’ in Siebel Tools. Create a new record for an Import Object. Specify the BC name and Project. If pre-defined mapping is required then add Import field, Import Key Field, Import Source (these are Child Objects for Import Object). 


3)     Compile the changes and launch the client. Navigate to the view. Click on the Menu-Item of the list applet; you can see the ‘Import’ as active.
       4) Prepare the data file for load. For example, if it is a CSV file or TXT file. 


5)     Click on Import, browse the input file with input format as Comma Separated Text file and input source as Auto Mapping. If you want to select pre define mapping, respective Mapping should be created for Import Object in Tools.


6)     Check the Siebel field mappings with the import file field mappings, if incorrect, you can remap them here.

'Auto Mapping' in Client-side Import functionality uses Applet settings rather than Import Object settings.

The followings are the difference between 'Auto Mapping' and 'Predefined Mapping'.

(1) To use client-side Import with 'Auto Mapping', you only need to add one 'Import Object' record in Siebel Tools. You don't need to create any child records such as 'Import Field' or 'Import Source'.
(2) The fields listed in 'Siebel Field' list box are list columns defined in [Applet]->[List]->[List Column] in Siebel Tools for the applet the client-side Import is invoked.
(3) The field names in 'Siebel Field' list box are based on the following rule:
           - If the field is displayed on the applet, the field name is from 'Display Name' for the list column in Siebel Tools
           - If the field is not displayed on the applet, the field name is from 'Field' field value for the list column in Siebel Tools.
(4) If fields in the import file header and fields in the 'Siebel Field' list box are the same, the fields are automatically mapped and displayed in 'Field Mappings' list box. Other fields need to be manually mapped by using 'Update Mapping' button.
  
7)      After the Load finishes, View Logs to see the imports and reject status.  


·         Business Service (Vanilla) :

   Using Read CSV File and EAI Siebel Adapter Business Services we can build a generic Work flow for importing the data.

Limitations:

·         This approach requires Integration Objects to be developed for all the entities where Import feature is required.
·         Read CSV File can only work on a single integration component at a time. Importing parent-child data and assigning a primary is a 3 step process: Import parent. Import child. Set primary flag at parent.

Development:

1)     Prepare the input CSV file in the required format

Line 1:  Integration Object Name
Line 2:  "Integration Component Name. Column Name1", Integration Component Name. Column Name2 and so on
Line 3: data 1
Line n: data n


1)     Pass the CSV file to the Work flow. Following is the illustration of the Sample Workflow built using the “Read CSV File” and “EAI Siebel adapter” Business Services.
Note: While Performing the Upsert Operation using EAI Siebel Adapter Business Service Send the Inputs argument “ObjectLevelTransactions” as true along with the Siebel Message. With this EAI Siebel adapter will treat each single object in the Siebel Message as a transaction.

It will also return the status object which we can parse in order to find out whether there were any problematic records. They will have an accompanying Error Message property with the error message received during the operation.

Currently there are two standard workflow processes that use the Read CSV File business service
  • Import Marketing Contact
  • Import KPIs

2)    Results




 

·         Business Service (Custom):

Custom Business Service can be created for reading the CSV file Field data. Following is the sample code snippet for reading field data from CSV file.


               if(MethodName=="ImportCSVData")
                          {
                                                  var ofile=Clib.fopen("D:\\test.csv", "rt");
                                                  if (ofile==null)
                                                TheApplication().RaiseErrorText("Error in opening the file");
                                                else
                                                {
                                                         var line;
                                                         var i=0;
                                                while (null!=(line=Clib.fgets(ofile)))
                                              {
                                                                        var array=new Array();
                                                                        array=line.split(",");
                                                                          var a0=array[0];
                                                                          var a1= array[1]
                                                  }//while
                                          }//else
                                                 return(Cancel Operation);
                     }


 

4 comments:

  1. Very helpful post

    ReplyDelete
  2. Nice post . Can yoou please tell where this import.log file will reside

    ReplyDelete
  3. This post saved the day. Thank you for the insight!

    ReplyDelete