cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a BLS transaction within an HTML5 embed tag

Former Member
0 Kudos

Hello experts,

I am doing some research in HTML5 .  I want to use an embed tag to call a BLS transaction .  Is it possible ¡?  I am trying with the following tag :

<embed type="text/xml" src="http://<server>/XMII/Runner?Transaction=TransactionName&OutputParameter=OutPut&XacuteLoginName=Login...">

Furthermore,  I want only the BLS calculation ,  not the xml or html .  Is it possibe ¡?

Thanks,

Note . Using an image tag, I can get a image out from the BLS transaction .  Work pretty good, but for numbers or text I still can not get it .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Fernando,

    Yes it is possible to show just the text/numbers when you embed the transaction. Points to consider,

1. Make sure you have an output parameter that would eventually display the result.

2. let the content-type be text/html . This helps when you have an XML Output. It would only render the texts.

The image below is my execution of the embed code. The text highlighted in blue, is the output from the transaction parameter. The calculation logic is a simple execution of a tag query and assigning it to an output parameter.

Further more, if you are calling a transaction from the same MII instance where the HTML is, then in the src, you could just give src="/XMII/Runner/<the regular syntax>" . You do not have to give the server and the credentials. They are taken up internally.

Regards,

Tufale Ashai.

former_member211944
Active Participant
0 Kudos

Hi Tufale,

If the output parameter is of type xml and you specify in your embed tag as type="text/xml", then the embed tag would automatically embed only the data from the XML.

Regards,

Rohit Negi.

Former Member
0 Kudos

Thanks Rohi and Tufale,

I can run the BLS over HTTP and see the output as xml . However when I use it at the embed tag nothing happens .

Please help,

former_member211944
Active Participant
0 Kudos

Hi Fernando,

Which MII version are you using?

I tried on MII 14.0.

I had used the following syntax in the irpt page:

<embed type="text/xml" src="/XMII/Runner?Transaction=<Transaction Full Path>&OutputParameter=<name of the output param of transaction>&Content-Type=text/xml">

Make sure that the output parameter is of type XML. If the output parameter is of type String then the whole XML would be embeded on the UI instead of just the data.

For getting the transaction full path, just right click on the transaction file in the BLS workbench and choose the copy option. This would copy the path of the transaction.

Then you can paste that in the irpt page in the embed tag.

Regards,

Rohit Negi.

Former Member
0 Kudos

Did the transaction run when you execute the webpage? You can check this in MII's Transaction Manager screen. If you find your transaction listed there, then it means your BLS logic was executed but the output was not displayed. I would check the following

1. Check if the output parameter in the URL is correct. I am not sure, but I guess its case sensitive

2. I would try changing the content-type to text/html

3. If none of these work, I would open the web page in the Google chrome, I would open the console (F12) and see if I get an error there. Check if there is a 404/401/500 error. If yes, check the url /credentials.

4. No error means more confusion .

hit and trial : , change the output parameter type to string or Just pass HELLO WORLD from the transaction as output. Check if that prints. Make sure the output param is same as that declared in transaction.

Answers (4)

Answers (4)

Former Member
0 Kudos

Rohit,

By taking the src out I mean to test the BLS over http . It works fine . My problem is using the embed tag .

Please help,

Thanks,

former_member211944
Active Participant
0 Kudos

Hi Fernando,

Can you share the code of your embed tag?

Are you getting this "TRANSACTION EXECUTED OK" in your irpt page.

Regards,

Rohit Negi.

Former Member
0 Kudos

Thanks Rohit,

This is the embed tag code :

<embed type="text/xml" src="http://<server>/XMII/Runner?Transaction=TransactionName&OutputParameter=OutPut&XacuteLoginName=Login...">

Regards,

Former Member
0 Kudos

Hi Fernando,

     Did you check if the transaction is getting executed when using the embed tag? You can check this in transaction manager screen. Also, how do you want your output to look? Should it look as the image in my previous reply? If yes, try changing the content-type to text/html.

Regards

Tufale Ashai

former_member211944
Active Participant
0 Kudos

Hi Fernando,

Kindly add this meta data section in the Head section of the HTML page:

"<META http-equiv="X-UA-Compatible" content="IE=edge">".

Regards,

Rohit Negi.

Former Member
0 Kudos

Thanks Rohit,

I tried the following with no results . The only difference was an empty text area tag . 

<!DOCTYPE html>

<META http-equiv="X-UA-Compatible" content="IE=edge">

<embed type="text/html" src="http://myserver/XMII/Runner?Transaction=mytransaction&OutputParameter=Salida&XacuteLoginName=mylogin...
XacuteLoginPassword=mypassword&Content-Type=text/html">

Best regards,  please help

former_member211944
Active Participant
0 Kudos

Hi Fernando,

I used this code in my irpt page:

<!DOCTYPE HTML>

<HTML>

<HEAD>

          <TITLE>Your Title Here</TITLE>

          <META http-equiv="X-UA-Compatible" content="IE=edge">

</HEAD>

<BODY>

<embed type="text/xml" src="/XMII/Runner?Transaction=Default/trans1&OutputParameter=OutputParameter1&Content-Type=text/xml">

</BODY>

</HTML>

Note:

My transaction name is trans1 and is present in Default project.

Thus namespace of the transaction is 'Default/trans1'

And Output Param of my transaction is named OutputParameter1 and is of type xml.

Regards,

Rohit Negi.

Former Member
0 Kudos

Thanks both of you,

I am using MII version 12.2.3 build 167 sp5 .

1)  I have used the following embed tag syntax as told:

<embed type="text/xml" src="/XMII/Runner?Transaction=<Transaction Full Path>&OutputParameter=<name of the output param of transaction>&Content-Type=text/xml">

2) Taking the src part out of the tag,  I can see the outcome from the BLS  !! Good !!

3) Using the src part at the embed tag in an irpt page nothing happens .  There is no error or warning messages .

Thanks

former_member211944
Active Participant
0 Kudos

Hi Fernando,

I am guessing how the tag is running without the src part because the src part tells the tag from where the data needs to be fetched.

But the solution works for you .

Regards,

Rohit Negi.

Former Member
0 Kudos

Apply an inline transform filtering the data you want displayed in the webpage. You can do that straight in the call to xacute transaction .. see here how it's done:

http://scn.sap.com/community/developer-center/front-end/blog/2012/09

For the sake of the exercise, they wanted there some JSON output. But it can be text, html code .. anything you define in the XSL transform for output.

former_member211944
Active Participant
0 Kudos

Hi Fernando,

I tried the above code you have given.

It directly embedded the returned XML in the page.

You have mentioned that you need BLS calculation. What does BLS calculation refers to?

Can you give an example.

Regards,

Rohit Negi.