cancel
Showing results for 
Search instead for 
Did you mean: 

How to associate T-Code with wd-abap application

former_member205703
Participant
0 Kudos

Hi,

I want to write the change document , for which T-code is mandatory parameter .

Is there any way to associate T-code with WD application.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi Amol ,

In one of my application I have run Standard SAP trasaction in WD ABAP .

I developed one input field where you need to enter T-code and onclick on button your Transaction will be run frm WD ABAP.

Code I wrote over On_Click

************************************************************************

method ONACTIONON_CLICK .

DATA:

node_tc TYPE REF TO if_wd_context_node,

elem_tc TYPE REF TO if_wd_context_element,

stru_tc TYPE if_main_view=>element_tc ,

item_tcode LIKE stru_tc-tcode.

  • navigate from <CONTEXT> to <TC> via lead selection

node_tc = wd_context->get_child_node( name = if_main_view=>wdctx_tc ).

  • get element via lead selection

elem_tc = node_tc->get_element( ).

  • get single attribute

elem_tc->get_attribute(

EXPORTING

name = `TCODE`

IMPORTING

value = item_tcode ).

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( ).

  • l_sapgui_manager->fire(

  • exporting

  • name = 'SZ2'

  • param1 = item_tcode ).

if l_sapgui_manager is not initial.

l_sapgui_manager->fire_start_transaction( transaction = item_tcode ).

endif.

endmethod.

I hope <b> l_sapgui_manager->fire_start_transaction( transaction = item_tcode ).</b> does job of calling transaction .

This thing i got in one standard demp example. but I dont remember its name .

Hope It iwll help you .

Cheers

Parry

former_member205703
Participant
0 Kudos

Hi Parry ,

In my case it is not an standard T-Code , but this application will change the data of Z tables .

Regards,

Amol

Former Member
0 Kudos

hi amol ,

Can you elobrate your requirement so I will be in better posion to solve it .

Cheers

Parry

Former Member
0 Kudos

Hi Amol,

According to your query, What i understand is , In WD if you running the transaction at the same time the same process has to be done in R/3 transaction. Right. If this is the one then reply me with your mail id, i will tell you the process how to do that.

If it won't hlep to you please ignor this message.

Best Regards,

Vijay