By Peter Langner on Friday, 14 April 2023
Category: Tips and Tricks

Extending the TEW Selection Tool in SAP GTM

Hello and welcome back to our "Tips & Tricks" area here at the ADventas Blog!

Today we want to share with you how to extend the TEW Selection Tool in SAP GTM.


So let's get started!

Introduction

In the Trading Execution Workbench (Transaction WTEW) the selection intervals for the documents to be selected can be adapted. Also, customer individual fields can be integrated.

In Figure 1 the intervals 9000 and 9001 are such customer individual fields.



Extending the Selection Views

In our example we want to extend the selection intervals with two customer individual fields which were integrated in the trading contract item (table WBHI).

The customizing for the selection view can be found here: Global Trade Management > Trading Execution Workbench (TEW) > Selection Tool.

For our example two customizing tables are relevant:



1) Trading Contract: Listbox

In the customizing table Trading Contract: Listbox Set of Lists (see Fig. 3) you set up which selection criteria are to be available to users when selecting documents of this type. You do this by choosing the number for the selection criteria from a list of all possible criteria (fields). 


In Fig. 4 you can already see the customer individual fields. The field number actually refers to a dynpro used in the selection tool to display the field name and enter the selection criteria itself.

The field ZZTOURID is already in the table WBHI and needs to be integrated in to the database view WB2_V_WBHK_WBHI. To do so you go to transaction SE11, enter the view name and display the view. In the menu choose Goto > Append View and create the append and add the customer individual fields. Repeat this for the view WB2_V_WBHK_WBHIB.

Other GTM views are:

​View Name ​Description
WB2_V_EKKO_EKPO Data Selection from PO
WB2_V_EKKO_EKPO2Data Selection from PO (without WBGT)
WB2_V_LIKP_LIPSData Selection from Deliveries
WB2_V_LIKP_LIPS2Data Selection from Deliveries (without WBGT)
WB2_V_MKPF_MSEGData Selection from Material Documents
WB2_V_MKPF_MSEG2Data Selection from material Documents (without WBGT)
WB2_V_VBAK_VBAPData Selection from SO
WB2_V_VBAK_VBAP2Data Selection from SO (without WBGT)
WB2_V_VBRK_VBRPData Selection from Customer Billing 
WB2_V_VBRK_VBRP2Data Selection from Customer Billing (without WBGT)
WB2_V_WBHK_WBHIData Selection from TC
WB2_V_WBHK_WBHI​B(New, business data head)
WB2_V_WBHK_WBHI2Data Selection from TC (without WBGT, business data item)
WB2_V_WBHKWBHI2BData Selection from TC (without WBGT, business data head)
WB2_V_WBRK_WBRPData Selection from Agency Documents
WB2_V_WBRK_WBRP2Data Selection from Agency Documents (without WBGT)


2) Customizing Table IMA_SELOPT

The new fields must be added to table IMA_SELOPT. Use transaction SM30 to add the new entries. Screen number is the number of the new screen that is displaying the new field. Valid customer entries are 9000-9999.



The application key depends on the document type of the new field:


3) Generate the new Dynpros in SAP Function Group

Run report RAIAWEBTOOL_CREATE_INCLUDE_NEW with transaction SE38 to generate the function group WB2_TC_SEL. The function group to be updated is retrieved by the report from table TAPPLIC based on the application key.


The report is secured with an EXIT command in line 58. To execute the report set a break point in this line and use the debugger to jump over this command.


4) Trading Contract: Default Listbox Content


If needed, you can set the default selection intervals in customizing table Global Trade Management > Trading Execution Workbench (TEW) > Selection Tool > Trading Contract: Default Listbox Content.


5) Reset User Defaults

Lastly, the new field will only be available for the user if the user defaults are reset. This can be done by running the report RAIAWEBTOOL_DELETE_STORAGEDATA.


So that's it from our side!

We hope this blog post was helpful for you. 

If so and also if you have any questions, please let us know by leaving us a message in the comments!

Leave Comments