Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 06, 2017 at 06:27 AM

    Hello Pavan,

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

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 06, 2017 at 08:22 AM

    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

    Add comment
    10|10000 characters needed characters exceeded