Introduction
Due to the fact that WebDynpro for ABAP is on the rise, communication between the existing BSP's and the new WebDynpro's can be a solution, so that the BSP's need no rewriting. The communication can be handled eg with Server Side Cookies.
I "stole" the idea from BSP: Stateless Modelbinding - Proof Of Concept and implemented the parameter-url call towards the WebDynpro.element_model,
node_table TYPE REF TO if_wd_context_node.
node_import = wd_context->get_child_node( name = if_zklab_xml_call=>wdctx_import ).
elem_import = node_import->get_element( ).
elem_import->set_attribute(
EXPORTING
name = `USERNAME`
value = username ).
DATA: istream TYPE string,
xslt_err TYPE REF TO cx_xslt_exception.
*Get cookie
CALL METHOD cl_bsp_server_side_cookie=>get_server_cookie
EXPORTING
name = 'modeldata2'
application_name = application_name
application_namespace = application_namespace
username = username
session_id = session_id
data_name = 'modeldata2'
CHANGING
data_value = istream.
*Do deserialization:
IF istream IS NOT INITIAL.
TRY.
CALL TRANSFORMATION id
SOURCE XML istream
RESULT model = r_model.
CATCH cx_xslt_exception INTO xslt_err.
ENDTRY.
CALL METHOD cl_bsp_server_side_cookie=>delete_server_cookie
EXPORTING
name = 'modeldata2'
application_name = application_name
application_namespace = application_namespace
username = username
session_id = session_id.
ENDIF.
node_table = wd_context->get_child_node( name = if_zklab_xml_call=>wdctx_table ).
node_table->bind_elements( r_model->lt_companies ).
node_model = wd_context->get_child_node( name = if_zklab_xml_call=>wdctx_model ).
elem_model = node_model->get_element( ).
elem_model->set_attribute(
EXPORTING
name = `MODEL`
value = r_model ).
ENDMETHOD.
After consuming the data in the cookie, it will be deleted so the server doesn't get loaded with it. This way you can get your model data to the context.