cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert the flat file to XML without Record type identifiers /Key field value

Former Member
0 Kudos

Hi All,

We have a requirement to convert a flat file with Header, Detail and trailer record into XML. I got the record type identifier (Key field value) for only Header and trailer record but not for Detail record.

Is there any way to handle detail records without key field value in content conversion?

Thanks&Regards,

Akhila.A

former_member182412
Active Contributor
0 Kudos

Thanks Akhila for closing the question, it always helpful for others whoever come across this question in future, they can quickly find the answer.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor

Hi Akhila,

Read the file as simple structure and split header and footer in the message mapping, i have mentioned all the steps in below blog.

Read File Using FCC Some with Key and Some without Key

Regards,

Praveen.

Answers (4)

Answers (4)

former_member186851
Active Contributor

Hello Akhila,

See if the below discussion helps

https://archive.sap.com/discussions/thread/3746518

Former Member
0 Kudos

Thank you Evgeniy will come back

former_member186851
Active Contributor
0 Kudos

Akhila please post the solution once you complete the scenario.

former_member190293
Active Contributor
0 Kudos

Hi Akhila!

The easiest way to split the string in java is to use String.split() method:

String srcStr = "aaa,bbb";

String[] tokens = srcStr.split(",");

String part1 = tokens[0];   //aaa

String part2 = tokens[1];   //bbb

You should consider not using commas inside your field values or provide the special logic for such cases.

To give points to Raghu just click up arrow below his avatar.

Regards, Evgeniy.

Former Member
0 Kudos

Hi Ragha,

Thanks for the thread . The conclusion form the thread are:

1.To use Eng'sAdapter module

2.To take the entire file in one line and split it in mapping

I would like to go with oprion 2 : But fields are not fixed length in my case .Fields are seperated by comma. Is there any way to split the fields based on comma and map it to the target structure.

By the way how should I give points to your answer ?

Thanks&Regards,

Akhila.A