This document will help you to understand the concept of calling the Tcode from Web Dynpro ABAP and passing values to it.
In this example I will call sales order Edit Tcode VA02 by passing sales order number from web Dynpro application and will go to direct Edit page by skipping initial page of that Tcode.
METHOD onactionon_edit .
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_vbeln LIKE ls_context-vbeln.
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.
DATA lv_url TYPE string.
DATA lv_host TYPE string.
DATA lv_port TYPE string.
lo_el_context = wd_context->get_element( ).
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
lo_el_context->get_attribute(
EXPORTING
name = `VBELN`
IMPORTING
value = lv_vbeln ).
* Call below method to get host and port
CLEAR : lv_host , lv_port.
cl_http_server=>if_http_server~get_location(
IMPORTING
host = lv_host
port = lv_port ).
* Creating URL
CONCATENATE 'http'
'://'
lv_host
':'
lv_port
'/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=*VA02%20VBAK-VBELN='
lv_vbeln
';DYNP_OKCODE=/00'
INTO lv_url.
* calling the url which we created above as a popup
lo_window_manager->create_external_window(
EXPORTING
url = lv_url
RECEIVING
window = lo_window ).
lo_window->open( ).
ENDMETHOD.
- Gowtham
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
37 | |
10 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
2 | |
2 |