cancel
Showing results for 
Search instead for 
Did you mean: 

Split by value

former_member188791
Participant
0 Kudos

Hi Group,

I have one requirement File to IDOC , I need to create IDOC based on the Custromer name and address , if customer name change and Street field is populated then I need to one IDOC , in the below example I need to create 4 Idocs , one for John , 2 for Mark and 1 for Adam , can you advice how I do mapping.

Customer Name StreetDistrict
JohnMilton StreetGlos
John
John
John
Mark31 Jameson StreetNorthfield
Mark
Mark32 James StreetNorthfield
Adam99 Johnson StreetSouthfield
Adam
Adam

Accepted Solutions (1)

Accepted Solutions (1)

binod8
Active Participant
0 Kudos

Hi Rajiv,

are you expecting this kind of output ?

Thanks,

Binod

former_member188791
Participant
0 Kudos

Thank you all for your response.

Hi Binod,

Yes, I am expecting the same output as shown on screen Shot.

T

binod8
Active Participant
0 Kudos

You may use this example to understand how we can make use of graphical mapping to achieve this. You may improve this as well if possible.

Below is the input and output structure and also the mapping for Records and subrecord. Rest of the fields are having one to one mapping.

Note: change all the properties of (if then node) to false

Below code is to be used for replacyEmpty UDF

public void replaceEmpty(String[] a,String[] b,ResultList result,Container container){

   //write your code here

String lastValue = null;

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

{

if (!a[i].equalsIgnoreCase(b[0]))

{

  1. result.addValue(a[i]);

lastValue = a[i];

}

else

{

  1. result.addValue(lastValue);

}

}

}

Answers (5)

Answers (5)

former_member189420
Active Participant
0 Kudos

Hi Rajiv,

It looks like you need to create Idocs only when the Street is filled. So you can directly map based on the Street field without having dependency on the customer name.

Street -> remove empty values-> Target Idoc

Regards,

Anand Patil

binod8
Active Participant
0 Kudos

Hi Rajiv,

Can you please share the sample file ?

Thanks,

Binod

javier_alcubilla
Contributor
0 Kudos

Hi Rajiv

Try something like this

Regards

former_member191435
Contributor
0 Kudos

Hi,

Please use below mapping

In place of Header use Name and in place of FLag use adress... you will get the desired output...

Please let me know still face any issue...

Thanks,

Sreenivas

Former Member
0 Kudos

Dear Rajiv,

please do like below might be help you customer name = Street then you map to your Idoc .from below mapping you remove Copy value.

Regrds,

Rajendar K

former_member188791
Participant
0 Kudos

Hi Rajendran,

I didn't get your solution , my requirement is when customer Name in next row is same and Street is Null then needs to extend IDOC , if customer Name is same and Street field is populated (not Null) then it needs to create new IDOC.