cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HCI - Groovy Script code to process Fixed Field Length text file

former_member183908
Active Contributor
0 Kudos

Hello Everyone,

I have a requirement to parse the source Fixed Field Length text file and convert to XML.Parsed XML will split into two different structures and routing to SFSF EC to two different entities.

I am looking for the groovy script code to do this.Please If anyone already did this kindly share the code.I never did groovy script coding.

Thanks

Pavan

Accepted Solutions (0)

Answers (4)

Answers (4)

Sriprasadsbhat
Active Contributor

Hello Pavan,

Could you please share sample input file with few liner of specification.

Regards,

Sriprasad Shivaram Bhat

0 Kudos

Hey Pavan,

If your need is something like in https://answers.sap.com/questions/742225/fixed-filed-length-into-xml-using-groovy-in-sap-cp.html

please do check 🙂

Regards

Akash

0 Kudos

Hi Pavan,

you got the script ?

if yes, can you please share the same.

Thanks

former_member183908
Active Contributor
0 Kudos

Hi Sriprasad,

Thank you so much for the response.Please find attached sample file and also find the attached image which converted using PI for better understanding.Some fileds does not have the data and comes with spaces which you can find in the sample text file.Below are the field lengths which used in PI for the content conversion for your reference.

11,9,41,11,5,11,15,7,7,6,6,5,6,5,5,5,5,5,5,11,42

Thanks In Advance

Pavan

capture.jpg

sample-file.txt

0 Kudos

Hello Pavan,


Not able to access the sample-file.txt.

Regards

Akash