Skip to Content
0

Requirement to add the values to the table using function modules, but not able to commit?

Jan 26 at 06:57 PM

30

avatar image
Former Member

<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd"> <Rule language="beanshell" name="Get SAP Cost Centers"> <Source> import sailpoint.object.*; import com.sap.conn.jco.*; import org.apache.log4j.Logger; Logger log = Logger.getLogger("Get Cost Centers"); try{ JCoDestination destination = null; destination = JCoDestinationManager.getDestination("SAP ECC"); log.warn("destination : "+destination); JCoRepository repository = destination.getRepository(); destination.ping(); log.warn("destination attributes : "+destination.getAttributes()); JCoFunctionTemplate template = repository.getFunctionTemplate("Z_SP_RFC_FUNCTION"); log.warn("template : "+template); JCoFunction function = template.getFunction(); log.warn("function : "+function); function.execute(destination); JCoTable table = function.getTableParameterList().getTable("T_CC_DATA"); table.appendRow(); table.setValue("USERID", "ZTRNPOAP1"); table.setValue("COST_CENTER", "0010100280"); log.warn("table : "+table); { JCoParameterList jcoexptparamlist = function.getExportParameterList(); JCoParameterFieldIterator jcoparmfielditr = jcoexptparamlist.getParameterFieldIterator(); while (jcoparmfielditr.hasNextField()) { JCoParameterField jcoparamfield = jcoparmfielditr.nextParameterField(); log.warn(jcoparamfield.getName()+" => "+jcoparamfield.getValue().toString()); } } }catch(Exception e){ log.warn("Error while running Get Cost Centers rule : "+e.toString()); e.printStackTrace(); } </Source> </Rule>

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers