cancel
Showing results for 
Search instead for 
Did you mean: 

How to do Scripting in SAP e-Sourcing 9 and view Loginfo

Former Member
0 Kudos

Hi Experts,

         I am new to SAP e-sourcing9 scripting. I try to implement the logInfo for a toolbar scripting. The codes are given below

import com.sap.odp.ibean.*;
import com.sap.odp.api.doccommon.masterdata.*;
         
import com.sap.eso.api.contracts.*;

import java.util.*;

//logging

global.log = Logger.createLogMessage(session);
logInfo(String message){
     global.log.setLogMessage(message);
     Logger.Info(global.log);
}

home = (ContractIBeanHomeIfc)IBeanHomeLocator.lookup(session.ContractIBeanHomeIfc.sHOME_NAME);

contractList = home.findWhere("INACTIVE=0");

logInfo("contract list size : " + contractList.size());

Here I am facing issue, when I try to run this its showing me error. The  error message given below :

Sourced file: inline evaluation of: ``import com.sap.odp.ibean.*;  import com.sap.odp.api.doccommon.masterdata.*;      . . . \'\' : Cannot access field: ContractIBeanHomeIfc, on object: SessionContext( Swastik/-2147483547.-2147483547)

One More thing,  HOW TO VIEW THE LOG MESSAGE FOR A SCRIPT ?

Thanks and Regards,

Swastik

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Swastik,

Script logs will be in the Sourcing log files which can be viewed from the NW log viewer. You can find more details in the blog below

http://scn.sap.com/community/sourcing/blog/2011/11/28/viewing-the-logs-in-sap-sourcing-70-on-premise

With respect to the error you are getting, the lookup method takes 2 arguments but it Looks like instead of a comma you used period as parameter separator. It should be IBeanHomeLocator.lookup(session, ContractIBeanHomeIfc.sHOME_NAME);

Hope this helps.

Regards,

Vikram