cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Problem

Former Member
0 Kudos

I have an advanced User defined Functions which is set at context.

The message comes from a proxy and if the value is null the proxy wont send the node.

In that case when i loop the array. it is giving an index out of bound exception since the node doesnot exst.

How can i handle that.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

U have to check node exits or not in udf only. check a condition as,

if(inputValue.length>0)

{

Put your recent code here.

}

inputValue is field used in recent Code.

Regards,

Rohit.

Reward points if helpful.

Former Member
0 Kudos

Hi,

Check whether node is empty or exist before looping. I think it will solve the problem.

Thanks,

RamuV

GabrielSagaya
Active Contributor
0 Kudos

Your String array has been accessed with an illegal index

Check the UDF

function myudf(String a[[]],ResultList result, Container container)

{

for(int i=0;i<a.length;i++)

if (!(a[<i>].equals("")))

result.addValues(a[<i>]);

}

Former Member
0 Kudos

Hi Thomas,

I think your problem is with "array index out of bounds".

You are trying to implement some looping logic when the source node exists. When the node does not exist, you will get error.

To avoid it, you can check whether the node at source exists or not using an udf with exception handling. So, node in the source does not exist, you won't get the mapping error instead you can continue with processing. But the respective node will not be created at target. Thats it.

Former Member
0 Kudos

Sebin:

You can use "Exists" and "CreateIf" node functions before the function module to check whether the node is present or not.

Exists:

http://help.sap.com/saphelp_nw04/helpdata/en/db/83f7b88528424c9113b15d5e0fb516/content.htm

CreateIf

http://help.sap.com/saphelp_nw04/helpdata/en/d9/3033f96c79674f90e3ab8d101a595b/content.htm

Former Member
0 Kudos

Guru,

this is an advanced user defined function...

we are passing the entire context