on 01-24-2011 10:59 AM
Hi,
I have a flat file to Idoc Scenario,
record type B is the Header which follows Component Rows (record type C) both constitute an IDoc strucutre formation
Before : I used to generate the target CHA segment based on record type C present for a particular record type B
record type C = CHA segment (1- 1 Mapping)
For example if number of C records for a B record is 10, then 10 CHA segments will be created
Now : record type C, has a field Roc, which will have value either "Yes" or "No"
This CHA segment will be created as per the following rules
a) record type C present for a particular record type B
b) Number of times fields Roc in C records are 'Yes'
For example if number of C records for a B record is 10 and out of these 10 C records, 4 have field RoC = Yes, then a total of 14 CHA segment will be created and where last 4 records would have differerent mapping rules for the fields in the CHA Segment .
Thanks,
Varun
Edited by: Varun Reddy on Jan 24, 2011 4:29 PM
Hi,
pass the values of Rec as input and then use the below..
for(int i=0;i<Rec.Length;i++)
{
if(Rec<i>.equals('Yes') )
{
result.addValue(Rec<i>);
result.addValue(ResultList.CC);
}
}
Check the above..(not sure may be need some corrections..) but basic idea is same as above..
HTH
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Please check the below mentioned code.
Keep the context of C to segment B and field Roc to C.
Input C and Roc queues.
int i,j;
for(i=0;i<C.length;i++)
{
result.addValue();
}
for(j=0;j<Roc.length;j++)
{
if(Roc<i>.equals("Yes")){
result.addValue();
}
}
-Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.