cancel
Showing results for 
Search instead for 
Did you mean: 

Use BLS transaction to execute XLS transformation, which executes Javascrip

Former Member
0 Kudos

Hi,

I have BLS transaction which submits a query and then executes an XLS transformation. I would like this transformation to execute a javascript but I have having overall problems with the syntax of calling the sapscript function.

Also, how would my sapscript function pick up the inbound XML which is passed into the transformation.

Thanks

Martin

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Martin,

I have not ever heard of anyone trying to go that route in processing an xml dataset. Is your xml content eventually going to end up in a webpage?

If that is the case, then I would not try to do the script call until the data arrives in the webpage. You could also execute the xsl from the webpage, but would suggest you do some performance testing to see which provides better.

Regards,

Mike

Former Member
0 Kudos

Hi MIke,

I want to use an IBrowser using 4 columns. In order to do this I need to build the XML in a hierarchy like structure. I was hoping to use a BLS transaction to firstly extract the data I want and then a transformation to create the XML structure the IBrowser requires. I was hoping using Javascript in the transformation would help me format the data better.

This resulting XML structure would then be written to a file, in which an XML query would read the content of the file. The IBroser would then use the XML query to create the tree structure.

I have been able to prototype all of this expect the creation of the XML structure I want.

Thanks

Martin

0 Kudos

Hi Martin,

I would think that between the xml functions and the xsl transformation, that you would not need to use javascript to format the data. It might be better to simply retrieve the data and rather than use the inline transformation, use the separate action block in combination with some of the xml action blocks and expression editor functions.

It might also help if you could provide some specific data and output xml structures in your particular scenario.

Regards,

Mike

Former Member
0 Kudos

This is my source XML.

<?xml version="1.0" encoding="UTF-8" ?>

- <Rowsets DateCreated="2011-09-29T14:33:25" EndDate="2011-09-29T14:33:25" StartDate="2011-09-29T14:33:25" Version="12.1.7 Build(47)">

- <Rowset>

- <Columns>

<Column Description="Division" MaxRange="1" MinRange="0" Name="Division" SQLDataType="1" SourceColumn="Division" />

<Column Description="Site" MaxRange="1" MinRange="0" Name="Site" SQLDataType="1" SourceColumn="Site" />

<Column Description="Room" MaxRange="1" MinRange="0" Name="Room" SQLDataType="1" SourceColumn="Room" />

<Column Description="Machine" MaxRange="1" MinRange="0" Name="Machine" SQLDataType="1" SourceColumn="Machine" />

</Columns>

- <Row>

<Division>Div1</Division>

<Site>Site1</Site>

<Room>Room1</Room>

<Machine>Machine1</Machine>

</Row>

- <Row>

<Division>Div1</Division>

<Site>Site1</Site>

<Room>Room1</Room>

<Machine>Machine3</Machine>

</Row>

- <Row>

<Division>Div1</Division>

<Site>Site1</Site>

<Room>Room2</Room>

<Machine>Machine2</Machine>

</Row>

</Rowset>

</Rowsets>

The tree hierarcy I want to see on my IBrowser is : -

->Division

-->Site

--->Room

-


>Machine

The format of the XML for the IBrowser needs to be like: -

<Rowsets DateCreated="2011-09-28T12:49:58" EndDate="2011-09-28T12:49:58" StartDate="2011-09-28T11:49:58" Version="12.1.9 Build(108)">

<Rowset>

<Columns>

<Column Description="Id" MaxRange="1" MinRange="0" Name="Id" SQLDataType="12" SourceColumn="Id"/>

<Column Description="ParentId" MaxRange="1" MinRange="0" Name="ParentId" SQLDataType="12" SourceColumn="ParentId"/>

<Column Description="ParentName" MaxRange="1" MinRange="0" Name="ParentName" SQLDataType="12" SourceColumn="ParentName"/>

<Column Description="Name" MaxRange="1" MinRange="0" Name="Name" SQLDataType="12" SourceColumn="Name"/>

</Columns>

<Row>

<Id>aa</Id>

<ParentId>---</ParentId>

<ParentName/>

<Name>Div1</Name>

</Row>

<Row>

<Id>bb</Id>

<ParentId>aa</ParentId>

<ParentName>Div1</ParentName>

<Name>Site1</Name>

</Row>

<Row>

<Id>cc</Id>

<ParentId>bb</ParentId>

<ParentName>Site1</ParentName>

<Name>Room1</Name>

</Row>

<Row>

<Id>dd</Id>

<ParentId>cc</ParentId>

<ParentName>Room1</ParentName>

<Name>Machine1</Name>

</Row>

<Row>

<Id>ee</Id>

<ParentId>bb</ParentId>

<ParentName>Site1</ParentName>

<Name>Room2</Name>

</Row>

<Row>

<Id>ff</Id>

<ParentId>ee</ParentId>

<ParentName>Room2</ParentName>

<Name>Machine2</Name>

</Row>

The values of the nodes id and ParentId need to be randomly generated also, but the are required by the IBroswer to build the hierarchy structure.

This format is taken from another example I have seen, however, the IBrowser xml is formatted by a stored procedure. I am hoping I can use some MII functionality for this....transformations, javascript etc .

Thanks

Martin