cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a transaction in webdynpro

Former Member
0 Kudos

Hi,

As per my requirement when a button click happens I need to call the transaction CAT2 by skipping initial screen. How to achieve this in webdynpro.

Thanks

Raghavendra

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member515618
Active Participant
0 Kudos

Hi Raghavendra,

If you are using portal as a triggerring point of your web dynpro applications, then the below requirement is achieved by doing the following.

1. Create a BDC report program to call transaction CAT2 skipping the first screen.

2. The report has the same input parameters as that of the transaction CAT2.

3. Associate a transaction to the report program sat 'ZCAT2'.

In the event handler of the button in your web dynpro do that following

  • Data declarations

----


  • Local Internal tables(lt_)

----


lt_bus_parameter_list TYPE wdy_key_value_table,

lt_launcher_parameter_list TYPE wdy_key_value_table,

----


  • Local Work area's(ls_)

----


ls_keyvalue_pair TYPE wdy_key_value,

----


  • Local Variables(l_)

----


l_pcdpageurl TYPE string,

l_componentcontroller TYPE REF TO if_wd_component,

l_port_manager TYPE REF TO if_wd_portal_integration.

----


  • Constants(c_)

----


CONSTANTS:

c_transaction_code TYPE string VALUE 'ZCAT2',

c_okcode TYPE string VALUE 'F8',

c_param1 TYPE string VALUE 'P_Data_Entry_Profile',

c_param2 TYPE string VALUE 'P_person_number'.

l_componentcontroller = wd_this->wd_get_api( ).

l_port_manager = l_componentcontroller->get_portal_manager( ).

  • Fill all the business parameters

CLEAR ls_keyvalue_pair.

ls_keyvalue_pair-key = c_param1.

ls_keyvalue_pair-value = 'Data Entry Profile'.

APPEND ls_keyvalue_pair TO lt_bus_parameter_list .

CLEAR ls_keyvalue_pair.

ls_keyvalue_pair-key = c_param2.

ls_keyvalue_pair-value = 'Person Number'.

APPEND ls_keyvalue_pair TO lt_bus_parameter_list .

  • Fill the launcher parameters for the transaction

CLEAR ls_keyvalue_pair.

ls_keyvalue_pair-key = 'AutoStart'.

ls_keyvalue_pair-value = 'Yes'.

APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.

CLEAR ls_keyvalue_pair.

ls_keyvalue_pair-key = 'GuiType'.

ls_keyvalue_pair-value = 'WinGui'.

APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.

CLEAR ls_keyvalue_pair.

ls_keyvalue_pair-key = 'OkCode'.

ls_keyvalue_pair-value = c_okcode.

APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.

CLEAR ls_keyvalue_pair.

ls_keyvalue_pair-key = 'System'.

ls_keyvalue_pair-value = 'SAP_R3_HumanResources'.

APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.

CLEAR ls_keyvalue_pair.

ls_keyvalue_pair-key = 'TCode'.

ls_keyvalue_pair-value = c_transaction_code.

APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.

CLEAR ls_keyvalue_pair.

ls_keyvalue_pair-key = 'Technique'.

ls_keyvalue_pair-value = 'SSF'.

APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.

CLEAR ls_keyvalue_pair.

ls_keyvalue_pair-key = 'WinGui_Type'.

ls_keyvalue_pair-value = 'Shortcut'.

APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.

SAP has provided us with customizing table to maintain the path for the iView.Here Resource_key is the key field to get the path.

We create a new entry in this table using which we uniquely identify the path of the iVew that needs to be launched.

  • get the url of the pcd page for the common transaction iView

SELECT SINGLE b~text

INTO l_pcdpageurl

FROM t7xssserstring AS b

INNER JOIN t7xssserres AS a

ON arespcdpage = bguid

WHERE a~ressource = /rio/zcl_hse_constants=>c_common_resource.

  • Navigate to the Injury Illness details

CALL METHOD l_port_manager->navigate_absolute

EXPORTING

navigation_target = l_pcdpageurl

navigation_mode = l_port_manager->co_show_external

use_sap_launcher = abap_true

business_parameters = lt_bus_parameter_list

launcher_parameters = lt_launcher_parameter_list.

The folowing is the flow of the program:

When user clicks a button to launch transaction CAT2, the event handler associated to it called.

Here we populate an internal table with the parameters to call transaction ZCAT2 and the iView is launched by calling navigate_absolute method with the right path.

I am not very much sure as to how the iViews are set up but there is a provision to read the key valure pair there. The values are read and the tranzation ZCAT2 is called which will inturn launch CAT2 transaction.

By adding Skip First screen statement we can get in the details directly.

Hope this helps.

Regards,

Sravan Varagani

Former Member
0 Kudos

Hi Kumar Raghavendra Alwala,

Bad luck! We cant call any Transaction from a webdynpro screen. We have to re create those screen and need to use bapi to make the logic work

Regards

Sarath