03-13-2007 5:45 AM
03-14-2007 10:51 AM
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
03-14-2007 10:51 AM
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
03-14-2007 11:05 AM
about your flash into a form element you may want to have a look at this
good day
Quentin
03-14-2007 11:16 AM
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
03-14-2007 11:19 AM
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
03-14-2007 1:05 PM
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
03-14-2007 7:40 PM
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