SAP CRM & SAP Solution Manager: Business Transaction Search Enhancement
SAP CRM & SAP Solution Manager: Business Transaction Search Enhancement
de
04.09.2015
Peter Weigel
Hyazinthenstr. 6
D-06122 Halle / Saale
Content
1 Introduction _________________________________________________________3
1.1 Goal of this guide 3
1.2 Context 3
1.3 Example Requirements 3
1.4 Versions History 6
1.5 Literature, Disclaimer, Contact and Download 6
2 Preparations _________________________________________________________7
2.1 Package 7
2.2 Structure for field enhancements 7
2.3 Append to search and result list structure 7
2.4 Maintenance Views 8
2.5 Dynamic Result List Data Retrieval 9
1 Introduction
1.2 Context
There exist several guides in SCN. These guides always explain how to do big
developments in context of search enhancement. These big development activities are
needed if we need special value helps or if we need to adjust existing selection criteria
or result list or if we want to enhance other searches than business transaction search.
In most cases we simply want to add some additional search criteria and result list
fields. In these cases, we are able to implement this low effort solution with minimum
development.
CRMD_SRV_REQ_H:
a. RISK
b. CHANGE_CATEGORY
ICT_INCIDENTGUID:
a. ICT_GUID
This document is based on information from SAP Online Library, Implementation Guide
of SAP Solution Manager 7.1, several SAP Notes and several SCN articles. These
piece of information were enriched by the authors knowledge and experience.
Disclaimer
http://www.hybrid-eichhörnchen.de/rechtliche-hinweise/
Contact
Peter Weigel
Hyazinthenstr. 6
D-06122 Halle / Saale
Phone: +49 170 5337567
E-Mail: [email protected]
Web: www.hybrid-eichhoernchen.de
Download
You are allowed to download the latest version of this document for free: www.hybrid-
eichhoernchen.de.
2 Preparations
This guide describes a solution to enhance the Business Transaction Search without
development activities. The first time you enhance the search you have to do some
development activities. These developments need to implement once. They are used
for all further enhancements which can then be done without further developments.
2.1 Package
We need a development package ZSEARCH or similar. Please create it via SE80.
Caution: If we want to enhance another search component, we will need to find out the
right structures and to append these structures instead.
However if the added fields are regarded as created via Application Enhancement Tool
(AET), we will get the value help for free without any development.
To open this way we need to create maintenance dialogs for following tables. Please
create maintenance views including maintenance dialogs (function group
ZSEARCH_TMD) for following customizing tables:
CRMC_Q1O_FIELDS (ZSEARCH_Q1O_FLDS)
AXT_RUN_FIELDDEF (ZSEARCH_FIELDDEF)
AXT_RUN_FIELDUSE (ZSEARCH_FIELDUSE)
AXT_RUN_BP_PARTT (ZEARCH_BP_PARTT)
AXT_RUN_BO_PART (ZSEARCH_BO_PART)
AXT_RUN_SEARCH (ZSEARCH_SEARCH)
AXT_RUN_FLAG (ZSEARCH_FLAG)
Therefore we needed to enhance the standard. Please implement the following source
code at the end of method GET_EXTENSION of class
CL_CRM_REPORT_EXT_LOCATORLIST.
************************************************************************************
* PROGRAM ID : ZSEARCH *
* PROGRAM TITLE : Dynamic Search Enhancement *
* AUTHOR : Peter Weigel *
* SUPPLIER : SAP *
* DATE : 01/07/2015 *
* DEVELOPMENT ID : *
* CHANGE REQUEST (CTS) : *
* DESCRIPTION : Dynamic data read for unsupported fields *
*==================================================================================*
* CHANGE HISTORY LOG *
*----------------------------------------------------------------------------------*
* MOD. NO.| DATE | NAME | CORRECTION NUMBER | CHANGE REFERENCE # *
*----------------------------------------------------------------------------------*
* MOD-001 |01/07/2015| PETER WEIGEL | 1 | *
* *
* DESCRIPTION: First Version *
************************************************************************************
DATA:
zls_repdy TYPE crmc_repdy,
zls_repdy_db TYPE crmc_repdy_db,
zlv_select TYPE string,
zlv_from TYPE string,
zlv_where TYPE string.
FIELD-SYMBOLS:
<zfs_requested_column> LIKE LINE of gt_requested_columns,
<zfs_extension> TYPE any,
<zfv_value> TYPE any.
CHECK sy-subrc = 0.
CHECK sy-subrc = 0.
CHECK sy-subrc = 0.
INTO <zfv_value>
FROM (zlv_from)
* WHERE crmd_orderadm_h~guid = <zfs_extension>-guid.
WHERE (zlv_where).
ENDLOOP.
ENDLOOP.
3 Field enhancements
Please ensure that you added check tables and search helps here, otherwise the value
help determination could not work.
However the added fields can only be used if you enabled the fields as search criteria
and result list field via UI configuration. Therefore please perform the UI configuration.
Caution: If you extend search and/or result list by sap standard fields, it might happen,
that SAP adds this fields in future. In this case your structure enhancement will cause
syntax error because the field will then be defined twice. This error will come up on
SPDD. If this happens, you will need to remove your field definition and to check the
customizing mentioned before and after this section. To avoid this conflict issue you
could use customer namespace in all cases even if you want to enable sap standard
fields. However if you do that, you avoid the conflict issue but you will never have the
chance to go back to standard.
Caution: If you extend search and/or result list by sap standard fields, it might happen,
that your extension can not be activated because the added fields are already included
in structure CRMT_REPORT_LOCATORLIST. In this case you have to split the content
of structure ZSEARCH_FIELDS into fields already supported by reporting and fields
which are not supported yet.
The search help for PREDCESSOR_ID was build by our own, because Application
Enhancement Toolset (AET) is very rigorous when using search helps. No existing
search help for CRMT_OBJECT_ID or CRMT_OBJECT_ID_DB can be used because
they always return more that one parameter, but AET alows only searchhelps with exact
one return parameter.
For predecessor relationship, we expected to create and use a database view for
database tables (TSOCM_CR_CONTEXT,) SRRELROLES, CRMD_BINREL and
ORBRELTYP.
*SQL Statement to get/validate Change Request for a given Change Document
SELECT SINGLE crmd_orderadm_h~object_id
INTO CORRESPONDING FIELDS OF ls_orderadm_h
FROM crmd_orderadm_h
JOIN tsocm_cr_context AS nachfolger_context ON nachfolger_context~guid = crmd_orderadm_h~guid
JOIN srrelroles AS nachfolger_role ON nachfolger_role~objkey = nachfolger_context~item_guid
However this is not needed since there exists table CRMD_BRELVONAE and a
matching entry for it. (Note: For all other relationships we have to go the long way!)
But unfortunately we need GUID (for result list) and ID (as search criteria) of the
predecessor. But CRMD_BRELVONAE gives us only the GUID. Therefore we need our
own version of CRMD_BRELVONAE as database view:
We registered field ICT_GUID here and linked it to the previous mentioned configuration
via “Dynamic Access Name”.
Caution: It might happen that the content will be overwritten by SAP during upgrade
because table is released for SAP internal use only.
(Note: The search help needs to be mentioned here even it is already mentioned in
definition of structure ZSEARCH_FIELDS.)
4 Development notes
http://wiki.scn.sap.com/wiki/display/CRM/How+to+add+an+existing+field+to+a+search+
page+of+a+different+component
http://scn.sap.com/thread/2084702
CRM_BSP_OIC_1O_SEARCH_FROM_RF
Standard routine for selection. Used by standard or BADI implementation.
CRM_BSP_OIC_1O_READ_FROM_RF
Standard routine for result list data reading. Used by standard or BADI
implementation.
crm_badi_rf_q1o_search
crm_badi_rf_q1o_read
crm_badi_rf_q1o_calculate
crm_badi_rf_q1o_filter
CRM_RF_SEARCH_EEW
4.4 Testing
You can test your solution without SAP Web Client UI by using Browser for Business
Object Layer (GENIL_BOL_BROWSER) with component set “ONEORDER”.
Because of a configuration error, the generation of a customer table with result list
support will abort. Please be sure that you correct the following configuration in
transaction AXTREG before starting generation. (in standard the leading “I” is
missing)
The result list fields will always be empty because in sap standard there is no
dynamic data retreival solution. If our solution 2.5 is implemented it should work.