Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BSP & Flex

Former Member
0 Kudos

This is the continuation from the following thread

hi Quentin

can you post the bsp code for calling flex here. how did you overcome the IE issue with embedding movie within form tags?

Regards

Raja

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Raja,

Here is the code of my bsb that's call a flash from the mime.

Page attributes :

APPLI	TYPE	STRING
URL	TYPE	STRING

APPLI is the application ¨BSP wich contains the swf.

URL is the path inside the bsp application.

onInitialization EventHandler :

*

 event handler for data retrieval
*--------------------
* local variables
*--------------------
DATA: l_xstring TYPE xstring.
DATA: l_mimetype TYPE string.


* References
DATA: lo_mr_api TYPE REF TO if_mr_api.
DATA: i_url TYPE string.

CONCATENATE 'SAP/' appli '/' url  INTO i_url.

* instantiate MIME API class
CALL METHOD cl_mime_repository_api=>if_mr_api~get_api
      RECEIVING
        r_mr_api = lo_mr_api.


* Get file from MIME repository
    CALL METHOD lo_mr_api->get
      EXPORTING
       i_url             = i_url
*      I_CHECK_AUTHORITY  = 'X'
      IMPORTING
*       e_is_folder      =
        e_content         = l_xstring
        e_mime_type       = l_mimetype
*      E_LOIO             =
*    CHANGING
*      C_LANGUAGE         =
      EXCEPTIONS
        parameter_missing  = 1
        error_occured      = 2
        not_found          = 3
        permission_failure = 4
        OTHERS             = 5.


response->set_data( l_xstring ).

navigation->response_complete( ).

Here how i call the flash inside my javascript, it write inside a

"data" as it id, and create a flash element with and id "myflash".

var so;
var version = deconcept.SWFObjectUtil.getPlayerVersion();		
if  (version['major'] >= 9 ){

so = new SWFObject("../Z0000/P9994.htm?APPLI=Z0000&URL=Z0003/FLEX/P1020.swf", "myflash", "1000", "600", "8", "#B3D2D7");
						
so.addParam("FlashVars", 'idmaj=' + idmaj);
so.addParam("vmode", "opaque");
so.addParam("allowScriptAccess", "always");
so.write("data");
}

WHy do you need to put the flash inside a from element ???

Because i tried it and it is not working, i'll look into it

good day

Quentin

6 REPLIES 6

Former Member
0 Kudos

Hello Raja,

Here is the code of my bsb that's call a flash from the mime.

Page attributes :

APPLI	TYPE	STRING
URL	TYPE	STRING

APPLI is the application ¨BSP wich contains the swf.

URL is the path inside the bsp application.

onInitialization EventHandler :

*

 event handler for data retrieval
*--------------------
* local variables
*--------------------
DATA: l_xstring TYPE xstring.
DATA: l_mimetype TYPE string.


* References
DATA: lo_mr_api TYPE REF TO if_mr_api.
DATA: i_url TYPE string.

CONCATENATE 'SAP/' appli '/' url  INTO i_url.

* instantiate MIME API class
CALL METHOD cl_mime_repository_api=>if_mr_api~get_api
      RECEIVING
        r_mr_api = lo_mr_api.


* Get file from MIME repository
    CALL METHOD lo_mr_api->get
      EXPORTING
       i_url             = i_url
*      I_CHECK_AUTHORITY  = 'X'
      IMPORTING
*       e_is_folder      =
        e_content         = l_xstring
        e_mime_type       = l_mimetype
*      E_LOIO             =
*    CHANGING
*      C_LANGUAGE         =
      EXCEPTIONS
        parameter_missing  = 1
        error_occured      = 2
        not_found          = 3
        permission_failure = 4
        OTHERS             = 5.


response->set_data( l_xstring ).

navigation->response_complete( ).

Here how i call the flash inside my javascript, it write inside a

"data" as it id, and create a flash element with and id "myflash".

var so;
var version = deconcept.SWFObjectUtil.getPlayerVersion();		
if  (version['major'] >= 9 ){

so = new SWFObject("../Z0000/P9994.htm?APPLI=Z0000&URL=Z0003/FLEX/P1020.swf", "myflash", "1000", "600", "8", "#B3D2D7");
						
so.addParam("FlashVars", 'idmaj=' + idmaj);
so.addParam("vmode", "opaque");
so.addParam("allowScriptAccess", "always");
so.write("data");
}

WHy do you need to put the flash inside a from element ???

Because i tried it and it is not working, i'll look into it

good day

Quentin

Former Member
0 Kudos

about your flash into a form element you may want to have a look at this

http://blog.deconcept.com/swfobject/forum/discussion/19/new-script-fixes-externalinterface-and-forms...

good day

Quentin

0 Kudos

first of all thank you very much.

have more questions:

1. is there any limitation for the size of flashvar?

the idea is sending the abap generated xml via flashvar to the movie and thru actionscript dynamically build the array (data provider) for datagrid.

do you see any problem with this approach

Regards

Raja

0 Kudos

by the way my json to ABPA itab is ready, but not able to update the wiki, it throwing errors and i have emailed sdn@sap.com. if you want to have a look i can email it to you

0 Kudos

Raja,

I do not use flash vars to pass xml or json.

I either call a javascript function from my flex on the <b>createcomplete</b> event

(ExternalInterface.call("MyJsonFunc","MyJsParam" )).

Or i use the httpservice object from the flash to call a sap bsp

(you can find a sample <a href="http://weblogs.macromedia.com/mesh/archives/2006/03/one_of_the_litt.html">here</a>).

I had the same problem posting the code, when you have to much " character, it won't work.

you can post the code inside the forum post about abap and json and make a reference

of it inside the wiki, that's waht i did for mine.

I also complete a function json to abap (so far i worked from a flex array to an abap table)

Quentin

Message was edited by:

Quentin Dubois

0 Kudos

thanks, i have successfully used http service (utilizing bsp as xml data provider) and also webservice. why i want to send via flashvars is that the environment i work doesnt support JS, thus trying flashvar. but it looks like the size is limited to 64kb. i need to come up with some owrk around.

thanks again

Regards

Raja