cancel
Showing results for 
Search instead for 
Did you mean: 

IDoc Item Level number Generation Issue.

Former Member
0 Kudos

Hi,

I am in the need of the mapping information.

Header_File1:

1234 567890

1234 678901

Cont_File2:

1234 567890 123456

1234 567890 123457

1234 678901 789012

1234 678901 789013

Cont_Item_File3:

1234 567890 123456 9876543

1234 567890 123456 9876544

1234 567890 123457 9876549

1234 567890 123457 9876550

1234 678901 789012 9876555

1234 678901 789012 9876555

1234 678901 789013 9876596

1234 678901 789013 9876597

According to the above Cont_File2 4 Idocs will be created with the reference of the Cont_File2.

While in the Item Level mapping (Field Name - Itemno) I want to generate the number with the increment of 5.

Using the counter java funcation Inital Value 10, Incement by 5 then Format number function is using and it is mapped with the target field.

Now the problem is for creating the Item level IDoc for the first IDoc it is creating with the the values 10 and 15. 2 Items are created according to the Input file.

While creating the next IDoc the number has to start from 10. But it is taking from 15+5 = 20.

Please let me know what funcation or UDF to fix this issue.

Jane

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi.

What kind is your UDF by context or by queue?

Can you put your UDF?

Former Member
0 Kudos

There is no UDF used as I mentioned I am using the functions of counter and FormatNumber.

Former Member
0 Kudos

Ok. By mistake . you need to use a UDF.

like this Type UDF = By Context

Parameters field[]

Parameters value = constant 10

try this


int inc  = Integer.parseInt(value[0]);
 for (int j = 0; j < field.length; j++){   
       result.addValue(Integer.toString(inc));
       inc = inc+5; 
 }

field--->UDF >splitbyValue->Target

change the context of field.