on 11-04-2014 9:01 AM
Hi Experts,
How can I call an ABAP transaction from WebDynpro Application.
I am trying call from an ALV column which is defined as LinkToAction.
BR,
Eshwar
Hi Eshwar,
On click action, write the below code , modify as per your requirement.
Sample code:
METHOD on_click .
DATA lo_nd_search_result TYPE REF TO if_wd_context_node.
DATA lo_el_search_result TYPE REF TO if_wd_context_element.
DATA ls_search_result TYPE wd_this->element_search_result.
DATA lv_host TYPE string.
DATA lv_port TYPE string.
DATA lv_protocol TYPE string.
DATA lv_url TYPE string.
DATA lv_value TYPE string.
FIELD-SYMBOLS <lv_value> TYPE any.
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( ).
lo_window_manager = lo_api_component->get_window_manager( ).
CLEAR lv_url.
CALL METHOD cl_http_server=>if_http_server~get_location
* EXPORTING
* protocol =
* application =
* for_domain =
* server =
* use_ticket_protocol = ABAP_false
IMPORTING
host = lv_host
port = lv_port
out_protocol = lv_protocol
.
CONCATENATE lv_protocol '://' lv_host ':' lv_port
'/SAP/BC/GUI/SAP/ITS/WEBGUI?~TRANSACTION=' INTO lv_url.
ASSIGN r_param->value->* TO <lv_value>.
IF <lv_value> IS ASSIGNED.
WRITE <lv_value> TO <lv_value> NO-ZERO.
lv_value = <lv_value>.
ENDIF.
* navigate from <CONTEXT> to <SEARCH_RESULT> via lead selection
lo_nd_search_result = wd_context->get_child_node( name =
wd_this->wdctx_search_result ).
* alternative access via index
lo_el_search_result = lo_nd_search_result->get_element( index =
r_param->index ).
* get all declared attributes
lo_el_search_result->get_static_attributes(
IMPORTING
static_attributes = ls_search_result ).
CASE r_param->attribute.
WHEN 'CEDENT_N' OR 'BROKER_N' OR 'INSURED_N'.
CONCATENATE lv_url 'BP &BUS_JOEL_MAIN-CHANGE_NUMBER=' lv_value
'&~OKCODE=BUS_MAIN_ENTER&SAP-CLIENT=' sy-mandt '&SAP-LANGUAGE='
sy-langu INTO lv_url.
ENDCASE.
IF lv_url IS NOT INITIAL.
CALL METHOD lo_window_manager->create_external_window
EXPORTING
url = lv_url
* title =
* 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
use_post = abap_true
RECEIVING
window = lo_window.
lo_window->open( ).
ENDIF.
* ENDIF.
ENDMETHOD.
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Using ITS you can call the GUI Transactions. in onAction of LinkToAction cell editor, call an external window and pass the ITS url
" http://<host>:portno/sap/bc/gui/sap/its/webgui?~TRANSACTION=<Tcode>"
You can check this blog for reference:
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.