cancel
Showing results for 
Search instead for 
Did you mean: 

Flex and BSP parameters

Former Member
0 Kudos

I have developed little application using Flex 3.0 and SAP BSP. When i click the button in Flex my BSP page is called correctly but my page attributes is not populated. I have check Flex in debug mode and the address look ok "http://dev.xxxxxxxx-indltd.com:8001/sap/bc/bsp/sap/appl/login.xml?persno=3999". In my BSP i have the same attribute name "persno" in my login page with auto checked. Any ideas why the parameter is not transferred.

Regards,

Daniel Cantin

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

I was able to debug in Flex not in SAP. I am not able to debug in SAP, I have set my external breakpoint in the code and i have activated debug for my SAP user but no result. I am going to investigate little more. Thanks for your help.

GrahamRobbo
Active Contributor
0 Kudos

Hi Dan,

Can I ask you again to refer to my original response and just try it? This works for me.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
<mx:Script>
	<![CDATA[
		private function go():void
		{
			var parameters:Object = new Object; 
			parameters["sap-client"] = "200";
			parameters.persno = "3999";
			myhttpService.request = parameters;
			myhttpService.send();			
		}
	

		
	
]]>

Cheers

Graham Robbo

Former Member
0 Kudos

Thanks for your advises. I am not able to set an external breakpoint in my BSP, so I tried to transfer the parameters table in a SAP table. When I test my BSP page in SAP, the table of parameters is transferred in my SAP table correctly. But when I call the page from Flex, nothing is transferred in my SAP table, but I know that the table contains some lines. So the page reacts differently if the call comes from inside SAP or outside SAP from Flex. My BSP user has full authorization.

Hope this help.

Regards.

GrahamRobbo
Active Contributor
0 Kudos

Hi Dan,

I am a bit confused how two messages ago you managed to use the debugger but now you can't! Are you calling the correct SAP Client? with the correct username?

It seems pretty apparent to me that when you manually call the BSP you receive the passed parameters, but when you call it from Flex you don't. Therefore something is wrong with the way you are calling the BSP from Flex.

My suggestion is to create a simple test Flex app - perhaps using the sample code I have already provided - and work on it until you find what is wrong.

Cheers

Graham Robbo

Former Member
0 Kudos

I have check in debug mode and my HTTP request is ok and my URL too. My page is called because the text message i receive in flex come from there. In my BSP page i receive the "persno" type String with initial value. So i receive the message 'No value BSP!' in the Flex application.

Here is the code;

DATA lwa_persno TYPE persno.

lwa_persno = persno.

IF NOT lwa_persno IS INITIAL.

CLEAR application->error_text.

CALL FUNCTION 'ZDZTB_LOGIN'

EXPORTING

pi_persno = lwa_persno

IMPORTING

pe_error_text = application->error_text.

ELSE.

application->error_text = 'No value BSP!'.

ENDIF.

BTW the SAP R3 version is ECC 5.0

Regards,

GrahamRobbo
Active Contributor
0 Kudos

You can retrieve the HTTP header fields from the request like this...

  data: lt_fields type TIHTTPNVP.
  request->get_header_fields( changing fields = lt_fields ).

...and the HTTP form fields like this...

  request->get_form_fields( changing fields = lt_fields ).

Try this to see exactly what you are passing in the HTTP request.

Cheers

Graham Robbo

Former Member
0 Kudos

Here is my syntax to call the BSP page in flex.

<mx:HTTPService url="" id="login_data"

useProxy="false"

result=

"check_login(event.result.error_text)"/>

public function makeEvent():void {

g_pernr = ti_pernr.text;

g_url = g_base_url + "login.xml?persno=3999";

login_data.send();

}

I have try with your code but no parameter is send to the BSP. The page is called but no parameters is send to the BSP.

What is BTW.

Regards

GrahamRobbo
Active Contributor
0 Kudos

BTW = "By the way"

How do you know that no parameter is being sent? Have you interrogated the HTTP request fully?

Cheers

Graham Robbo

athavanraja
Active Contributor
0 Kudos

i guess the url is not get set to the HTTPservice properly.

may be try this code

public function makeEvent():void {

g_pernr = ti_pernr.text;

g_url = g_base_url + "login.xml?persno=3999";

login_data.url = g_url ;

login_data.send();

}

GrahamRobbo
Active Contributor
0 Kudos

It sort of depends how you are building your Flex HTTP request.

Something like this would probably work.

	var urlLoader:URLLoader = new URLLoader;
	var myURL:String = "login.xml?persno=3999";
	var urlRequest:URLRequest = new URLRequest(myURL); 
	urlLoader.load(urlRequest);

If you have used mxml to create your HTTP request like this...

	<mx:HTTPService id="myhttpService" url="login.xml" />

... then you can assign parameters and make the call like this...

	var parameters:Object = new Object; 
	parameters.persno = "3999";
	myhttpService.request = parameters;
	
	myhttpService.send();

I guess there are probably heaps of other ways as well.

BTW there is a RIA forum that is more appropriate for this thread.

Cheers

Graham Robbo