Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Split by value

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
Former Member
replied

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);

}

}

}

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question