My Test Executions – Create Defect Dialog BAdi (/SALM/TM_TWL_DEF_DIALOG_BADI)
2024-1-11 16:24:12 Author: blogs.sap.com(查看原文) 阅读量:9 收藏

Introduction

The “Create Defect” dialog in My Test Executions can be enhanced using the BAdi /SALM/TM_TWL_DEF_DIALOG_BADI. This is a multiple use BAdi with a filter on transaction type. Based on the transaction type (S1DM, SMIN, Z/Y..), you can set default values for the standard and custom fields and also influence their display settings (editability, visibility etc) in the dialog.

The custom fields can be added for a transaction using the AET tool.

Understanding the BAdi Interface

In the implementation method, /SALM/IF_TM_TWL_DEFECT_DEFAULT~GET_DEFAULT_VALUES, there are 3 importing parameters: tester root key (iv_tsta_root_key), test plan ID (iv_tpln_id) and test package ID (iv_tpck_id) and 2 changing parameters: ch_default_values, ch_default_settings.

These importing parameters can be used to get more information related to the test case, test package or test plan. For example, you can retrieve the test case classification and use that in the defaulted description for the defect. The BAdi also has an example implementation to understand how the values can be defaulted.

Using the changing parameter ch_default_values, you can default values for the following fields:

  • System ID and Client
  • Priority
  • Component
  • Title
  • Defect Category
  • Long Text / Description
  • Processor BP ID
  • Support Team BP ID
  • Custom Fields defined for the transaction
  • Custom Fields Field Control Property

Standard Fields Defaulting

For example, to default the values for component, system and client, the following code has been added inside the BAdi implementation.

The other changing parameter ch_default_settings can be used to decide the visibility, editability and mandatory properties of the standard fields.

After the dialog is rendered, system, client and component are pre-filled from the BAdi implementation. Component is also marked as a mandatory field.

Custom Field Defaulting

You can also default the custom fields property value too.

Let’s assume, I have created custom field zzafld00000k (IT Comment) using AET for defect transaction type S1DM. Hence, it will be maintained in ch_default_values structure as well.

Using the same structure ch_default_values, you can also control the field control property of the custom fields. Field control property will have 4 options to select from for each custom field.

0 = Hidden

1 = Not Editable

3 = Optional

7 = Mandatory

If no defaulting is present in the BAdi for custom fields, the field control property values are taken from the SPRO configuration itself. Please refer to the customizing “Activate Custom Fields for Focused Build Document Types” for custom fields related customizing.

After the dialog is rendered, the custom field “IT Comment” is pre-filled and non-editable.

With this example, you can understand how the BAdi can be used to pre-fill the fields of the “Create Defect Dialog” and also control their display settings.

Please feel free to provide feedback either directly here in the comment section or in case of questions, you can submit them here. You are also encouraged to follow SAP Solution Manager tag here and Focused Build for SAP Solution Manager tag here.


文章来源: https://blogs.sap.com/2024/01/11/my-test-executions-create-defect-dialog-badi-salm-tm_twl_def_dialog_badi/
如有侵权请联系:admin#unsafe.sh