cancel
Showing results for 
Search instead for 
Did you mean: 

segregation of data records based on a field value

Former Member
0 Kudos

Hi,

My scenario is a IDOC TO FILE scenario where i have to create 1-unbounded recordsets based on a few conditions.My requirement now is that, each record may contain n number of data records Which contains a field called TARGETMARKET. So now i need to segregate all the data records which contain TARGETMARKET="US" under one recordset and all the data records which contain TARGETMARKET="GB" under one recordset and all the data records which contain TARGETMARKET="NU" under one recordset.Im able to create all the DATARecords but im unable to segregate them.

My Output Target Structure should be like this.

<RecordSet>

-


<DataRecord>

-


<TargetMarket>US<TargetMarket>

-


</DataRecord>

-


<DataRecord>

-


<TargetMarket>US<TargetMarket>

-


</DataRecord>

</RecordSet>

<RecordSet>

-


<DataRecord>

-


<TargetMarket>GB<TargetMarket>

-


</DataRecord>

-


<DataRecord>

-


<TargetMarket>GB<TargetMarket>

-


</DataRecord>

</RecordSet>

<RecordSet>

-


<DataRecord>

-


<TargetMarket>NU<TargetMarket>

-


</DataRecord>

-


<DataRecord>

-


<TargetMarket>NU<TargetMarket>

-


</DataRecord>

</RecordSet>

As it for now im able to create only upto this extent.

<RecordSet>

-


<DataRecord>

-


<TargetMarket>US<TargetMarket>

-


</DataRecord>

-


<DataRecord>

-


<TargetMarket>US<TargetMarket>

-


</DataRecord>

-


<DataRecord>

-


<TargetMarket>GB<TargetMarket>

-


</DataRecord>

-


<DataRecord>

-


<TargetMarket>GB<TargetMarket>

-


</DataRecord>

-


<DataRecord>

-


<TargetMarket>NU<TargetMarket>

-


</DataRecord>

-


<DataRecord>

-


<TargetMarket>NU<TargetMarket>

-


</DataRecord>

</RecordSet>

<RecordSet>

</RecordSet>

<RecordSet>

</RecordSet>

Can anyone please explain me how to attain my desired structure.

Thanks in advance,

Bhargav

Message was edited by:

bhargav gundabolu

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I have tried with SplitbyValue using "ValueChange".But than it is only creating the DATA record three times under each Recordset.But i want all the DataRecords to be segregated.Please help ASAP.

Thanks,

Bhargav

Former Member
0 Kudos

Can you please provide some more information :

The actual sample input and output structure you are using and the complete mapping between these fields.

Cheer's

Former Member
0 Kudos

Bharghav,

here is my suggestion...

I your mapping duplicate your recordset 3 times (in target side) and put a condition in the DataRecord node present in each of the 3 recordset.. the datarecord condition should be createif => Us/gb/nu...

cheers

Arvind R

Former Member
0 Kudos

I think you can get it by using SPLITBYVALUE function .try that.

apply it on 'Datarecord'

Former Member
0 Kudos

use the function splitbByValue for the mapping to the 'datarecord' as mentioned earlier and select the option " after each change to the value" to insert a context change to get you desired output.

http://help.sap.com/saphelp_nw70/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm

Cheer's