cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass a table of data to transaction.

Former Member
0 Kudos

Hi,

I need to pass several rows of data to an internal table of a bapi from a page .

I know how to create a table in xMII transaction within itself.

But I couldn't figure how to pass several rows from a HTML page to an input parameter of a Xacute query.

Here is the scenario.

My HTML page is having a table of 3 rows and 12 columns.

I need to pass this data to an input parameter of a Xacute query.

Can some one help me in this regard.

Thanks,

Srinivas.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In general, there are two approaches to passing complex data to an xMII transaction.

1) You can merge the table cells into a single comma-separated list, and pass this as a string input parameter to the transaction. There are parsing actions and functions in xMII that can decompose this string into its constituent elements.

2) You can create a string representing an XML document from your table data, and pass this in to xMII as an XML input parameter.

Both approaches require iterating through the table cell(s) using JavaScript and structuring the output parameter string. I'll usually use an iCommand object to invoke the xMII business logic transaction, so you'll be building your string and assigning it to one of the query parameters (e.g. Param.1).

Alternatively, you could use an HTTP Post in an HTML form directly to the "Runner" service in xMII (invoking BLS directly), but this requires a bit more work.

Best regards,

Rick

Former Member
0 Kudos

Rick,

Thank you very much Rick. Your work around is working fine.

I am trying to enhace it a little bit this concept as below.

I created a transaction which takes string input through transaction parameters and impliments your logic of saving to a local text file and loads as XML data through XML loader and finally assigning to OUTPUT parameter of xml type.

Through this I can call this transaction where ever I need to convert string to XML.

But the problen I am facing here is whenI test this transaction through Xacute Query with some well formed XML data as input I am getting nothing in the test page.

Here are the steps I followed in the transaction:

1. Save the input text to a local file.

2. Load the same file using XML Loader.

3. Assign the xmlLoader.xmlContent -> Transaction.OUTPUT ( Assign XML) through assignment block.

4. Delete the temporary file.

Can you help in this regard.

Thanks,

Srinivas.

Thanks,

Former Member
0 Kudos

There is a hotfix that will be available shortly that will eliminate the need for saving a local file and using XMLLoader. You will be able to use the StringToXml action to parse the incoming XML.

Try running your transaction without deleting the file. Does it look like it is OK? Valid XML? Try loading it in XMLSpy or some other XML editor just to make sure.

- Rick

Former Member
0 Kudos

Hi srinivas,

1. Test your xactue query with the option of XML instead of HTML. I hope the xml is not in the valid format of XMII XML.

2. To avoid this create a document , define the columns and assign the values from xml loader.

3. To get the XML structure of xml loader document use the first option and make it available through the reference documents....

I hope this solves problem...

Regards,

Kishore

Former Member
0 Kudos

Kishore/Rick,

Kishore, Thanks for the first point.

I was returning the internal table which is returned from BAPI. So this will not be in the format of xMII xml format and therefore xAcute query is not able to display or get the data returned from transaction. When I actually used this transaction within the other transaction and pass it on to another BAPI then it is working fine.

It is just we can't see the data which is not in the format of xMII XML.

I think SAP should come up with an enhancement to xMII XML to understand SAP XML ( data returned from BAPIs ) so that we can simplify our transactions with out the need of using Illumedoc and Illumerows to push the data out of transaction in order to make xMII server to understand the SAP Data.

Hope some one in SAP see this thread.

Thanks,

Srinivas.

Former Member
0 Kudos

Hi, Srinivas.

I actually built an action like this at one point - basically an RFC return "flattener" - that worked nicely. I never turned it into product, though...

- Rick

Answers (1)

Answers (1)

Former Member
0 Kudos

Using Javascript build an xml string by iterating through the rows of the grid/table on your page. The nodes for the xml would be what your BAPI is expecting.

Pass this string xml then to your Xacute.

In your transaction link this xml (Append XML) to the Request Node of the BAPI

Hope this helps.