Skip to Content
0

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

Oct 17, 2016 at 04:24 AM

144

avatar image

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ℜgards,

Akhila.A

10 |10000 characters needed characters left characters exceeded

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

0
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Best Answer
Praveen Gandepalli Oct 18, 2016 at 10:29 AM
1

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.

Share
10 |10000 characters needed characters left characters exceeded
Raghuraman S Oct 17, 2016 at 04:42 AM
1

Hello Akhila,

See if the below discussion helps

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

Share
10 |10000 characters needed characters left characters exceeded
Akhila A Oct 18, 2016 at 06:55 AM
0

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ℜgards,

Akhila.A

Share
10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov Oct 18, 2016 at 07:09 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Akhila A Oct 18, 2016 at 08:15 AM
0

Thank you Evgeniy will come back

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Akhila please post the solution once you complete the scenario.

0