cancel
Showing results for 
Search instead for 
Did you mean: 

Calling SAP Tcode on Button click

ChandraMahajan
Active Contributor
0 Kudos

Hello All,

i want to call SAP Tcode on click of button.

below is the code for the same,

data l_componentcontroller type ref to ig_componentcontroller .

data l_api_componentcontroller type ref to if_wd_component.

data l_sapgui_manager type ref to cl_wdr_sapgui_integration.

l_componentcontroller = wd_this->get_componentcontroller_ctr( ).

l_api_componentcontroller = l_componentcontroller->wd_get_api( ).

l_sapgui_manager = l_api_componentcontroller->get_sapgui_manager( ).

if l_sapgui_manager is not initial.

l_sapgui_manager->fire_start_transaction( transaction = 'SE38' ).

endif.

But the object l_sapgui_manager is not getting instantiated. please let me know if i am calling the right method or the code is wrong???

Regrads,

Chandra

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chandra,

You need to Initialise the l_sapgui_manager before you are accesing. see the folowing code i initialised my select options component.This code can be obtained from Wizard also. I hope this will help you.

Please do this in the WDDOINIT of component controller. So that it will be inistatiated before you are accessing the component.

** initialize select options component for query creation
  lr_cmp_usage = wd_this->wd_cpuse_sel_options( ).
  wd_this->usage_name = lr_cmp_usage->name.
  IF lr_cmp_usage->has_active_component( ) IS INITIAL.
    lr_cmp_usage->create_component( ).
  ENDIF.
  l_ref_interfacecontroller = wd_this->wd_cpifc_sel_options( ).
  wd_this->mr_selopt_helper   = l_ref_interfacecontroller->init_selection_screen( ).

Warm Regards,

Vijay.

Message was edited by:

Vijaya Bhaskarudu Gangisetty

Answers (0)