cancel
Showing results for 
Search instead for 
Did you mean: 

useOneAsMany--Error thows becuase when tesing in test tab

Former Member
0 Kudos

Hi,

My source field is not mandatory at target side and the value for this field comes only rarely in the message.

My mapping is-->

source field>exist----/

segment-useoneasmany->target field

segment--\

If i dont use exist function it throws error "Too few values in first queue in function useoneasmany".

When i use exist function after source field it is sending true or false at the target.

My requrement is when source field comes the value should be passed to target otherwise nothing to pass.

How to handle this?

Pls help !!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

> My requrement is when source field comes the value should be passed to target otherwise nothing to pass.

Why are you using UseOneAsMany function? Do you want when your souce field comes then it should be mapped to target field for it's all occurrence. If your ans is yes then do your mapping like this..

source --> exists --> ifWithoutElse --> Then --> Source --> CopyValue(0) -->Target

Douple click on CopyValue function and enter zero, by this way your source field will be mapped to target field for it's all occurrences.

Regards,

Sarvesh

Former Member
0 Kudos

Thanks to everyone for the information !!

I have to use useoneasmany function because i have to generate multiple idocs based on condition.

I am doing almost similar kind of mapping for the whole structure.

source field>exist----/

segment-useoneasmany->target field

segment--\

Whenever the value doesn't come in source field, no such field should be generated at target side, not even empty field.

Please help me !!

Regards,

Suresh.

Former Member
0 Kudos

Hi suresh,

please try a udf with similar logic as useoneamany ,give it a try ..lets see if it solves ur problem.

udf with two inputs 1. Soure field 2. segment take as string array.

inside udf :


  if source="";
{
       result.addSuppress();
}
else
{
 for (i=0;i<segment.length;i++)
  {
       result.addValue(segement<i>);
}
}

Please make some correction if required in udf ...not very good at this:)

Regards,

Srnivas

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Suresh,

Please try using a simple udf with same logic instead of use one as many function.You can code the logic in udf easily . Sometime its the best working option.

Regards,

Srinivas

Former Member
0 Kudos
If i dont use exist function it throws error "Too few values in first queue in function useoneasmany".

Thats because the first context of your source node doesn't have a value for the source field.

My requrement is when source field comes the value should be passed to target otherwise nothing to pass.

Just use a mapByDefault.

source field>mapByDefault(blank constant)>Target field.

This way when there's no value for source field a blank constant would be passed...

Hope this helps...

Regards

Soumen...

former_member200962
Active Contributor
0 Kudos
My requrement is when source field comes the value should be passed to target otherwise nothing to pass.

Why use useOneAsMany for above requirement? The error will be thrown as your source field is 0..1.....it should be ideally 1..1

Use the below logic:

Source --> Exists --> ifWithElse (then Source) --> Target
                      Else(map Blank Constant)

Use ifWithElse in case you want to have a empty target node created when the source node does not exist.

Regards,

Abhishek.

Former Member
0 Kudos

Use an IF before the useoneasmany or set a default value in case the field comes empty

regards,

Pablo