Skip to Content

After having read the nice article from Saha Dipankar about performance problem with large XML process in BLS (see http://scn.sap.com/people/dipankar.saha3/blog/2011/05/03/optimizing-bls-performance-for-xml-handling-in-sap-mii ), I decided to go deeper as we were encountering almost the same scenario, and so I develop a new solution with XSLT process…

First, our scenario… We have POD (production operator dashboard) on the floor, linked to SAP ME system through MII with BLS transactions exposed a web services. One of this web services was really struggling with performance on some machine and did almost cause the servers to crash…

This web service was used to show all the BOM (build of materials) for all materials that are in the production line of the machine, with all revisions (or almost). This could mean a lot of data’s (for example, 60 Boms and around 1000 items).

Example of data retrieved :

/wp-content/uploads/2013/01/blog1_178552.jpg

The goal here is to group all Item by pair Bom, Bom_revision (so we had a key in first column to manage this in a easiest way).

Structure of the output XML is :

<?xml version=”1.0″ encoding=”UTF-8″?>

<data>

  <BOMList>

    <BOMData>

      <Bom>BOM-1</Bom>

      <Revision>A2</Revision>

      <Description>01.Alternative</Description>

      <Status>201</Status>

      <ValidFromDate>20120131</ValidFromDate>

      <CurrentRevision>true</CurrentRevision>

      <BomComponentList>

        <BomComponent>

          <Component>

            <Item>Item-1</Item>

            <Revision>WCAL</Revision>

          </Component>

          <Sequence>10</Sequence>

          <Quantity>0.62</Quantity>

        </BomComponent>

        <BomComponent>

          <Component>

            <Item>Item-2</Item>

            <Revision>1</Revision>

          </Component>

          <Sequence>20</Sequence>

          <Quantity>1.00</Quantity>

        </BomComponent>

        <BomComponent>

          <Component>

            <Item>Item-3</Item>

            <Revision>1</Revision>

          </Component>

          <Sequence>30</Sequence>

          <Quantity>1.00</Quantity>

        </BomComponent>

        <BomComponent>

          <Component>

            <Item>Item-4</Item>

            <Revision>1</Revision>

          </Component>

          <Sequence>40</Sequence>

          <Quantity>0.10</Quantity>

        </BomComponent>

        ….

      </BomComponentList>

    </BOMData>

  </BOMList>

</data>

When I applied the “classic” way to do it, using local XML template, looping into the query result with grouping by bom, revision, doing assignments, like the third scenario described in Saha’s article, the performance could be very poor, sometimes more than one minute… Which is not acceptable for a shop floor system.

So I did apply an XSLT action block… As I was not really a XSLT expert, it took me some time to design it. Especially due to the fact that MII (12.1.9 in our case) is not supporting XSLT 2.0 and the powerfull commande “for-each-group”… But after some trials and errors steps, I finally find a good way to achieve this (based on this article : http://www.jenitennison.com/xslt/grouping/muenchian.html )

The result in term of performance was really great, dividing the process times by around 10 times less…

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply