cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate record in CSV file

former_member335553
Active Contributor
0 Kudos

Hi

Needed your inputs to take forward this scenario

It is an IDOC - CSV File scenario where WBS elements are sent across in the file to the legacy system

9 fields are sent in the file and in those 2 fields are mapped with constants .

Requirement here is to have a duplication of record in the file with only one constant changed My CSV file should look like this for each IDOC occurence

AAA,0123.45,Edgbaston,1234,WBS_Code1,,Airline,

AAA,0123.45,Edgbaston,1234,WBS_Code2,,Airline,

it would just be the duplication of record with only one field changed (WBS_Code1 and WBS_code2) so that each IDOC occurence would comprise one WBSelement information sent from the IDOC and the generated file would have 2 lines of the same record

Thanks

Anusha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anusha,

Under 1 root node, create 2 substructures, say A and B.

Keep the structures for both A & B same.

Even in the mapping part, it would be same for all fields for both the structures except for WBS_Code field.

For substructure A, it would be mapped to WBS_Code1 & for substructure B, it is WBS_Code2.

Use the below FCC:

Recordset Structure : A,B

For the table:

A.fieldNames : Name of the 9 fields

B.fieldNames : Name of the 9 fields

A.fieldSeparator : ,

B.fieldSeparator: ,

A.endSeparator : 'nl'

B.endSeparator : 'nl'

-Supriya.

Answers (4)

Answers (4)

former_member335553
Active Contributor
0 Kudos

Created a record node and 2 substructures

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

Hi, have you try sort the main structure by LEVEL Field?

Edited by: Rodrigo Alejandro Pertierra on Sep 3, 2010 11:18 AM

Edited by: Rodrigo Alejandro Pertierra on Sep 3, 2010 11:19 AM

former_member335553
Active Contributor
0 Kudos

Hi

Unable to get you and I have my receiver strcuture as mentioned below .And only last 2fields are getting populated from the IDOC and rest all mapped with the constants

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_WBSCodes xmlns:ns0="http://us.abc.com/PI/aaaat">

<WBSFile> 0..unbounded

<RecordTypeIdentifier>FIELDLISTVALUES</RecordTypeIdentifier>

<CompanyID>UNIT_TOP</CompanyID>

<CustomFieldID>CL_WBS_CODE_1</CustomFieldID>

<CustomFieldValue1></CustomFieldValue1>

<CustomFieldValue2></CustomFieldValue2>

<Status></Status>

</WBSFile>

<WBSFile>0..unbounded

<RecordTypeIdentifier>FIELDLISTVALUES</RecordTypeIdentifier>

<CompanyID>UNIT_TOP</CompanyID>

<CustomFieldID>CL_WBS_CODE_2</CustomFieldID>

<CustomFieldValue1> - </CustomFieldValue1>

<CustomFieldValue2></CustomFieldValue2>

<Status></Status>

</WBSFile>

</ns0:MT_WBSCodes>

Edited by: Anusha Ramsiva on Sep 3, 2010 4:58 PM

Former Member
0 Kudos

Hi Anusha,

This cant be done in FCC, you need to do it in Mapping only .You need to Duplicate the root node..map all the fields as it is except the Constant field(WBS_Code).

Thanks,

hemanth

former_member335553
Active Contributor
0 Kudos

Hi

FIELDLISTVALUES,UNIT_PC_TOP,CL_WBS_CODE_1,4.0001652.016 - LEVEL 3,4.0001652.016,

FIELDLISTVALUES,UNIT_PC_TOP,CL_WBS_CODE_1,4.0001652.017 - Level 4,4.0001652.017,

FIELDLISTVALUES,UNIT_PC_TOP,CL_WBS_CODE_2,4.0001652.016 - LEVEL 3,4.0001652.016,

FIELDLISTVALUES,UNIT_PC_TOP,CL_WBS_CODE_2,4.0001652.017 - Level 4,4.0001652.017,

But I need to get output as

FIELDLISTVALUES,UNIT_PC_TOP,CL_WBS_CODE_1,4.0001652.016 - LEVEL 3,4.0001652.016,

FIELDLISTVALUES,UNIT_PC_TOP,CL_WBS_CODE_2,4.0001652.016 - LEVEL 3,4.0001652.016,

FIELDLISTVALUES,UNIT_PC_TOP,CL_WBS_CODE_1,4.0001652.017 - Level 4,4.0001652.017,

FIELDLISTVALUES,UNIT_PC_TOP,CL_WBS_CODE_2,4.0001652.017 - Level 4,4.0001652.017,

Sort has to be made to the file at the receiver side to obtain this output ?

Thanks

Anusha

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

Sorry, i missunderstanded you

former_member335553
Active Contributor
0 Kudos

Hi

At the receiver end I would require this sort to get the correct format that is required .please adivse

Former Member
0 Kudos

Hi Ramsiva,

Create two sub structures unde rone main structure. Then map the same fields to the substructure except the constant field. Then do the conversion.

Regards,

---Satish