Skip to Content
avatar image
Former Member

Converting text file with multiple orders

We have a requirement, We will be receiving a file with multiple orders in one file.File structure would be like below

[Start]

[Order1]

[header]

[Line Item1]

[Line Item2]

[Line Item3]

[Line Item4]

...

...

...

[Order1 End]

[order2]

[Header]

[Line Item1]

[Line Item2]

[Line Item3]

[Line Item4]

...

...

...

[oder2 end]

...

...

...

...

[order n]

[Header]

[Line Item1]

[Line Item2]

[Line Item3]

[Line Item4]

...

...

...

[Order n End]

[End]

The file contains multiple orders and each order contains multiple line items.And the number is varying.

We have to convert this text file to xml and generate one Idoc per order.

Please suggest whether it could be done using SAP PI/PO features . If not how this could be achieved ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 25, 2017 at 12:00 PM

    Is there any key for the Header and data records? And what is the hierarchy of the file?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      We have keys to specify beginning and end of an order as well as line items,

      More detailed structure would be like below:

      [Order1 start]

      order ID=xx

      Order from=xx

      shipTo=xx

      Number of line item=xx

      [Line items]

      [line item1]

      type=a

      size=b

      qty=x

      [Line item2]

      type=a

      size=b

      qty=x

      [[Line item3]

      type=a

      size=b

      qty=x

      ...

      ...

      ...

      [End of line items ]

      [End of the order1]

      ...
      ...

      ...

      ...

      ...

      [Order start]

      order ID=xx

      Order from=xx

      shipTo=xx

      Number of line item=xx

      [Line items]

      [line item1]

      type=a

      size=b

      qty=x

      [Line item2]

      type=a

      size=b

      qty=x

      [[Line item3]

      type=a

      size=b

      qty=x

      ...

      ...

      ...

      [End of line items ]

      [End of the order n]

      Multiple line items in one order and multiple orders in one file. We have [Order start] and [Order End] also [Line item start] and [Line Item end] . After the order start it is header Feilds, followed by the line items , As specified in the above structure.

  • Oct 26, 2017 at 08:32 AM

    Then Try with FCC keeping recordset occurrence as 0-unbounded which will be root and for Header,Line items define keys.

    Something like mentioned in the below link

    http://www.riyaz.net/sap/xipi-file-content-conversion-for-complex-structures/79/

    Add comment
    10|10000 characters needed characters exceeded