cancel
Showing results for 
Search instead for 
Did you mean: 

Error when creating user defined function

Former Member
0 Kudos

hi Experts,

I am getting the Internal error when creating userdefined .

com.sap.aii.utilxi.swing.framework.FrameworkException: Internal problem occurred

at com.sap.aii.utilxi.swing.toolkit.ExceptionDialog.init(ExceptionDialog.java:124)

at com.sap.aii.utilxi.swing.toolkit.ExceptionDialog.<init>(ExceptionDialog.java:96)

at com.sap.aii.ibrep.gui.mapping.xitrafo.TabbedPane$TabChangeListener.stateChanged(TabbedPane.java:206)

at javax.swing.JTabbedPane.fireStateChanged(Unknown Source)

at javax.swing.JTabbedPane$ModelListener.stateChanged(Unknown Source)

at javax.swing.DefaultSingleSelectionModel.fireStateChanged(Unknown Source)

at javax.swing.DefaultSingleSelectionModel.setSelectedIndex(Unknown Source)

at com.sap.plaf.frog.TabbedPaneSelectionModel.setSelectedIndex(TabbedPaneSelectionModel.java:23)

at javax.swing.JTabbedPane.setSelectedIndexImpl(Unknown Source)

at javax.swing.JTabbedPane.setSelectedIndex(Unknown Source)

at com.sap.plaf.frog.FrogTabbedPaneUI$MouseGetter.mouseReleased(FrogTabbedPaneUI.java:3668)

at java.awt.Component.processMouseEvent(Unknown Source)

at javax.swing.JComponent.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at com.sap.aii.utilxi.swing.toolkit.Guitilities$EventProcessor.dispatchEvent(Guitilities.java:319)

at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

Caused by: java.lang.IllegalArgumentException: the length 0 of the array 'sortedFunctionKeys' is not equal to the number 1 of functions.

at com.sap.aii.ib.bom.flib.FunctionLibrary.sortFunctions(FunctionLibrary.java:150)

at com.sap.aii.mappingtool.funclib.FunctionLibraryEditor.prepareSave(FunctionLibraryEditor.java:445)

at com.sap.aii.mappingtool.fwutil.api.ViewUtil.prepareSave(ViewUtil.java:110)

at com.sap.aii.ibrep.gui.mapping.xitrafo.XiMappingView.prepareSave(XiMappingView.java:269)

at com.sap.aii.ibrep.gui.mapping.xitrafo.TabbedPane$TabChangeListener.stateChanged(TabbedPane.java:200)

... 29 more

how can i solve this.

Regards,

Syed

Accepted Solutions (1)

Accepted Solutions (1)

former_member181985
Active Contributor
0 Kudos

Close the IR framework, reopen and try creating again.

Thanks,

- Gujjeti.

Answers (2)

Answers (2)

prateek
Active Contributor
0 Kudos

The error clearly states

the length 0 of the array 'sortedFunctionKeys' is not equal to the number 1 of functions.

Check the UDF code for array named 'sortedFunctionKeys'. There must be some improper usage of this array.

Regards,

Prateek

Former Member
0 Kudos

Hi Prateek,

I am working on PI7.1 and even I am getting same error, though array sortedFunctionkeys is not used at all in my UDF.

My udf code is :

//Add the values of all var1 occurrences.

int counter = 0;

for( int j = 0;j< var1.length;j++)

{

int i = Integer.parseInt(var1[j]);

counter = counter + i;

}

String s = new Integer(counter).toString();

result.addValue(s);

And UDF test is done successfully. I get this error only when I try to save my message mapping.

Any help on this is much appreciated.

Thanks & Regards,

Anurag Garg

Former Member
0 Kudos

Hi,

I am working on PI 7.1 and even I am getting the same error. Did you find the reason and solution for this?

Thanks!,

Amulya

Former Member
0 Kudos

I has to do with your JRE version,i had the same issue some time ago and after JRE change ,it started working fine.

i think you need JRE 1.5 for PI 7.1.(you need to check this though)

for PI 7.0 you need 1.4

Thanks

Aamir

Former Member
0 Kudos

Hi,

I just found that, I could successfully create the function with same code, when I used 'Functions' tab, and defined at 'Functions and Java Areas'. Strange, but I got rid of the error and my function works fine.

Just thought if this can be a useful piece of information for some of you.

Amulya

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Umar,

let me know what code u written,wts u r requirement.

regards,

Raj