cancel
Showing results for 
Search instead for 
Did you mean: 

Asynchronous BLS Call

HariCS23
Contributor
0 Kudos

Hi Everybody

Can we call BLS from another BLS or from Irpt/html as Asynchronously. I have the requirement where in it doesn't matter the step executes or not . And that particular step is inserting data into table so its taking long time execute.

So, wondering whether I can execute BLS transaction asynchronously..

Let me know if any body doesn't understand my question.

Thanks

Hari

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Hari,

Sure you can. Here is a bit of an extreme example, maybe, using jQuery's ajax method. This JS function basically creates an Employee object from a asynchronous call to a BLS transaction where I pass in an employee's identification. Actually, this is a non-asynchronous AJAX call for reasons to large for this post. But, if you are going to use jQuery you can set the async to true or omit it (as it is the default).

function Employee(employeeId) {
	
	var theEmployee = {};	

	if(employeeId != "") {
		var urlForEmployeeInfo = '/XMII/Runner?Transaction=SomeCompany/Production/GetOperatorInformation&Employee='+employeeId+'&OutputParameter=EmployeeXML';
		
		$.ajax({
   			type: "GET",
   			url: urlForEmployeeInfo,
   			async: false,
   			success: function(data){
				
				if($(data).find('FatalError').text() == "") {
					if($(data).find('Messages').text() == "") {
						if ($(data).find('EmpNo').text() != '') {
     							theEmployee.firstName = $(data).find('FirstName').text();
							theEmployee.lastName = $(data).find('LastName').text();
							theEmployee.fullName = $(data).find('FullName').text();
							theEmployee.error = '';
						} else {
							theEmployee.error = 'Invalid Employee';
						}		
					} else {
						theEmployee.error = $(data).find('Message').text();
					}
				} else {
					theEmployee.error = $(data).find('FatalError').text();
				}
   			}
 		});
	} 
	return theEmployee;

}

Of course, you don't need the jQuery library to make an AJAX call to a BLS transaction. It was just code I had handy.

Former Member
0 Kudos

Also, to note, the code sample above assumes the code is on the MII server, otherwise you would have to authenticate the URL/AJAX call.

HariCS23
Contributor
0 Kudos

Thanks Ryan and Kevin for the reply.

The above Code looks promising though but i need some learning curve to use AJAX.

But now.., i am more interested in calling transaction in a transaction Asynchronously.

From the Kevins Ponter..,Seems like this this functionality not there in 12.0 but Targeted in 12.1 .

So,Any body know the time lines for ver 12.1 ram up/un restricted release.

And, Any body has any other idea..to acheive this??

Thanks

Hari

Former Member
0 Kudos

Hari,

The dynamic trx action is brand new 12.1. Currently, 12.1 is in the ramp up phase and should be generally available soon.

You may want to look at [www.w3schools.com |http://www.w3schools.com/ajax/default.asp]for more info on JS / AJAX.

Regards,

Kevin

Former Member
0 Kudos

Hari,

I guess Christian's idea to use the HTTP Post action would solve your request. This way you can "call" a BLS from another BLS without having to wait for it, because the Message Listener starts the second BLS by calling a Processing Rule.

To send your data to the Message Listener, you configure your HTTP Post like this:


URL:
http://<server>:<port>/XMII/Illuminator?service=WSMessageListener&mode=WSMessageListenerServer&name=<yourname>&Session=false

Content-Type: text/html

The Content-type is important to let MII read the payload data correctly. The Session=false prevents MII from creating User sessions for every HTTP Post.

Michael

Answers (2)

Answers (2)

Former Member
0 Kudos

You can do an http post action to post to the Runner and just set a low timout. You can also post to the message listener, which gives you some more visibility and tracking for the "event".

Former Member
0 Kudos

Hari,

FYI....in MII 12.1 there is a dynamic transaction action block which can be set to Asynchronous Call. Keep it in mind for future use....

[12.1 Help on Dynamic Transaction Calls|http://help.sap.com/saphelp_mii121/helpdata/en/49/24c202dd8d13a0e10000000a421138/content.htm]

Regards,

Kevin

Former Member
0 Kudos

interesting...