You are on page 1of 3

Passing Parameters to Transaction launcher

Extending the Business Object Repository
When calling transactions using the ITS, you might run into the limitations of the Business Object
Repository. The available objects and methods of the Business Object Repository can be found in
transaction SWO1.
Often used objects to call transactions or reports using the ITS are TSTC and REPORT.
If you want to use TSTC, you will have to create a copy (like ZTSTC) of the standard TSTC
The execute method of the ZTSTC should be the same as the standard execute from TSTC, except
that the checkbox 'synchronous' should be checked.

An often heard requirement is to forward
parameters like the businesspartnernumber to the transaction. This unfortunately is not possible with
the standard TSTC object. To work around this limitation, you can add a method to the ZTSTC called
for instance ZEXECUTE_WITH_PARAM.
When defining the method, you should add 4 import parameters:

Param1 type structure CPIDLIST

Param2 type structure CPIDLIST

Param3 type structure CPIDLIST

Skipsc type BUTOOO-BP_EEW_DUMMY (or any other CHAR1 field).

The ABAP code in the method should be a copy of the TSTC-EXECUTE, but with some extra ABAP
coding between the AUTHORITY_CHECK_TCODE and the CALL TRANSACTION OBJECT-KEY-CODE.

BEGIN_METHOD ZEXECUTE_WITH_PARAM CHANGING CONTAINER.
CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
EXPORTING
tcode = OBJECT-KEY-CODE

EXCEPTIONS ok = 0 not_ok = 1 others = 2. swc_get_element swc_get_element swc_get_element swc_get_element container container container container 'param1' lv_param1. END_METHOD. 'param3' lv_param3. Because the Parameters are defined as name-value-pairs. . IF lv_param1 IS NOT INITIAL. ENDIF. IF lv_skipscreen IS INITIAL. 'param2' lv_param2. you would go ahead as follows: 1. this is fully flexible. SET PARAMETER ID: lv_param1-pid FIELD lv_param1-value. lv_param3 TYPE CPIDLIST. Define the method as described above. if you would want to call transaction BP in ERP using the ZEXECUTE_WITH_PARAM. and forwarded to the parameter-id’s. ELSE. SET PARAMETER ID: lv_param3-pid FIELD lv_param3-value. lv_param2 TYPE CPIDLIST. DATA: lv_param1 TYPE CPIDLIST. MESSAGE s059(eu) WITH OBJECT-KEY-CODE. 'skipsc' lv_skipscreen. IF lv_param3 IS NOT INITIAL. ELSE. ENDIF. As an example. CALL TRANSACTION OBJECT-KEY-CODE. ENDIF. IF lv_param2 IS NOT INITIAL. the parameters are read. SET PARAMETER ID: lv_param2-pid FIELD lv_param2-value. CALL TRANSACTION OBJECT-KEY-CODE and skip first screen. ENDIF. ENDIF. In the coding. IF sy-subrc NE 0. lv_skipscreen TYPE char1.

2. Create a transaction launch definition in SAP CRM using the transaction launcher wizard (CRMC_UI_ACTIONWZ). 3. Check the ParameterID of the field you want to add the parameter to. .