Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Doc1

553 views

Published on

,k,

Published in: Education, Technology, Design
  • Be the first to comment

Doc1

  1. 1. method ONACTIONONUPLOAD .* tables : ZUPLOAD. DATA lo_nd_upload TYPE REF TO if_wd_context_node. DATA lo_el_upload TYPE REF TO if_wd_context_element. DATA ls_upload TYPE wd_this->Element_upload. data fs_url type string. data event type ref to cl_wd_custom_event .. DATA lo_nd_n_dowmload TYPE REF TO if_wd_context_node. DATA lo_el_n_dowmload TYPE REF TO if_wd_context_element. DATA lo_el_n_dowmload1 TYPE REF TO if_wd_context_element. DATA ls_n_dowmload TYPE wd_this->Element_n_dowmload. DATA lt_n_dowmload TYPE wd_this->Elements_n_dowmload. DATA lv_url TYPE wd_this->Element_n_dowmload-url. data ls_file_upload type ZUPLOAD.* navigate from <CONTEXT> to <N_DOWMLOAD> via lead selection lo_nd_n_dowmload = wd_context->get_child_node( name = wd_this->wdctx_n_dowmload ).* navigate from <CONTEXT> to <UPLOAD> via lead selection
  2. 2. lo_nd_upload = wd_context->get_child_node( name = wd_this->wdctx_upload ).* get element via lead selection lo_el_upload = lo_nd_upload->get_element( ).* @TODO handle not set lead selection IF lo_el_upload IS INITIAL. ENDIF.* get all declared attributes lo_el_upload->get_static_attributes( IMPORTING static_attributes = ls_upload ).fs_url = http://in.yahoo.com/?p=us.ls_upload-url = fs_url.ls_upload-file_size = xstrlen( ls_upload-file_contents ).ls_file_upload-file_name = ls_upload-file_name .ls_file_upload-file_type = ls_upload-file_type .ls_file_upload-file_size = ls_upload-file_size .ls_file_upload-file_contents = ls_upload-file_contents .ls_file_upload-url = fs_url .*insert ZUPLOAD from ls_file_upload .* if sy-subrc = 0. select file_name file_type file_size file_contents url from zupload into CORRESPONDING FIELDS OF TABLE lt_n_dowmload .CALL METHOD LO_ND_N_DOWMLOAD->BIND_TABLEEXPORTING NEW_ITEMS = lt_n_dowmload* SET_INITIAL_ELEMENTS = ABAP_TRUE* INDEX = .* endif .
  3. 3. method ONACTIONON_LINK_ACTION . DATA lo_nd_n_dowmload TYPE REF TO if_wd_context_node. DATA lo_el_n_dowmload TYPE REF TO if_wd_context_element. DATA lo_el_n_dowmload1 TYPE REF TO if_wd_context_element. DATA ls_n_dowmload TYPE wd_this->Element_n_dowmload. data fs_url TYPE string.* navigate from <CONTEXT> to <N_DOWMLOAD> via lead selection lo_nd_n_dowmload = wd_context->get_child_node( name = wd_this->wdctx_n_dowmload ).* get element via lead selection lo_el_n_dowmload = lo_nd_n_dowmload->get_element( ). IF lo_el_n_dowmload IS INITIAL. ENDIF.* get all declared attributes lo_el_n_dowmload->get_static_attributes( IMPORTING static_attributes = ls_n_dowmload ).* data lv_url type string .* lv_url = http://www.google.co.in/. DATA lo_api_main TYPE REF TO if_wd_view_controller. lo_api_main = wd_this->wd_get_api( ).data lo_window_manager type ref to if_wd_window_manager.data lo_api_component type ref to if_wd_component.data lo_window type ref to if_wd_window.lo_api_component = wd_comp_controller->wd_get_api( ).CALL METHOD LO_ND_N_DOWMLOAD->GET_LEAD_SELECTION RECEIVING ELEMENT = lo_el_n_dowmload1 .CALL METHOD LO_EL_N_DOWMLOAD1->GET_ATTRIBUTE EXPORTING NAME = URL IMPORTING VALUE = fs_url .*lo_window_manager = lo_api_component-
  4. 4. >get_window_manager( ).CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW* EXPORTING* URL = LV_URL* MODAL = ABAP_FALSE* HAS_MENUBAR = ABAP_TRUE* IS_RESIZABLE = ABAP_TRUE* HAS_SCROLLBARS = ABAP_TRUE* HAS_STATUSBAR = ABAP_TRUE* HAS_TOOLBAR = ABAP_TRUE* HAS_LOCATION = ABAP_TRUE* RECEIVING* WINDOW = lo_window.lo_window->open( ).

×