Quantcast
Channel: SCN : Document List - Governance, Risk and Compliance (SAP GRC)
Viewing all articles
Browse latest Browse all 459

How to implement Enhancement for Custom defined field(s) in GRC Process Control 10.0 and 10.1.

$
0
0

Applies to: GRC Process Control 10.0 / Process Control 10.1.

 

Summary

This document provides information “How to implement Enhancement for Custom defined field(s) in GRC Process Control 10.0 and 10.1.

 

Author: Amit  Saini

 

Created on: April 2015

 

Prerequisite(s) Custom Defined Field(s) are already defined.

 

 

Audience

 

GRC Process Control consultants, partners.

 

 

Introduction 

 

With SAP GRC Process Control 10.0/10.1, there is added flexibility in defining the customer-specific fields. You can define them as: ‘Single value’ or multiple values’ for either a HR entity, for example, “Organization” or a non-HR entity, for example, “Issue” In order to control the visibility of CDF fields on UI, for example to mark CDF fields as ‘Required’, ‘Hidden’, or ‘Read Only’,  we need to implement the enhancement spot.

 

 

Implementing ‘Enhancement’ spot

 

 

Firstly, we need to define a class
[Transaction ‘Se24’] which implements the interface: ‘IF_GRFN_API_CUSTOMFIELD_BADI’.

 

 

2.png1.png

3.png

 

 

There are changing attributes CT_CUSTOMFIELD_MDATA and CT_CUSTOMFIELD_DATA available in method AFTER_RETRIEVE that can be modified.

 

4.png

 

 

Table CT_CUSTOMFIELD_MDATA is used adjust the following fields:

 

  • HIDDEN can be used to hide the field on UI
  • READONLY can be used to set the field “Display only”.
  • REQUIRED can be used to make the field required.
  • VALUESET can be used to define text for dropdown.
  • FIELDLABEL can be used to adjust label of the field.

 

5.png

 

 

 

Table CT_CUSTOMFIELD_DATA is used to adjust following field: "VALUE" and  can be used for value defaulting .

 

By the method BEFORE_UPDATE, we can modify the value entered by user or can implement the “input check” and raise the exception; in
case the user entry does not pass the check.

 

Secondly, we need to implement the new BADI using enhancement spot ‘GRFN_API_CUSTOMFIELD ‘.

 

This enhancement spot is called during the ‘Retrieve’ and ‘Update’ of Custom Defined fields for both HR and non-HR entities.

 

The transaction used is SE19.

 

Choose enhancement as ‘GRFN_API_CUSTOMFIELD’ and click on button ‘Create Implementation’.

 

6.png

 

 

 

Enter the name and text for ‘Implementation’, we want to create and do not select the option‘Composite Enhancement
Implementation’.

 

7.png

 

 

An "Enhancement Implementation" can only contain one type of "Enhancement Implementation Element". Therefore, for a project where
you must implement enhancements to both an Enhancement Point, and a Function Module Interface, you cannot group them in the same Enhancement Implementation. Instead, you must create two separate Enhancement Implementations, and in turn group those in a "Composite Enhancement Implementation". For our example, we require to implement BADI and hence did not select the option ‘Composite Enhancement Implementation’.

 

 

 

Enter the implementation class ‘ZBADI_USER_DEFINED” defined in first step and continue.

 

8.png

 

 

Save and activate the ‘Enhancement Implementation’.

 

9.png

 

 

 

Now we could define the IF_GRFN_API_CUSTOMFIELD_BADI~AFTER_RETRIEVE and IF_GRFN_API_CUSTOMFIELD_BADI~BEFORE_UPDATE in implemented class ZBADI_USER_DEFINED to control the CDF on UI.

 

 

Let us understood this, with an example .Execute program ‘GRFN_CHECK_CDF’ to know the metadata created.

 

10.png

 

 

I want to set field ‘ZTEST_VALUE’ defined for ‘Issue’ as mandatory using my enhancement point.

11.png

 

 

So I have implemented the methods IF_GRFN_API_CUSTOMFIELD_BADI~AFTER_RETRIEVE and IF_GRFN_API_CUSTOMFIELD_BADI~BEFORE_UPDATE in class ZBADI_USER_DEFINED.

1.png

 

2.png

 

 

 

Now I perform ‘Manual Test of effectiveness’ task for a manual control.

 

3.png

 

 

 

And create issue for the control.

 

 

4.png

5.png

 

 

 

Method ‘API_RETRIEVE_CUSTOMFIELD’ of class ‘CL_GRFN_UTIL_CDF’
is used to modify the CDF metadata. It further calls the enhancement point ‘GRFN_API_CUSTOMFIELD’.

 

 

If method  IF_GRFN_API_CUSTOMFIELD_BADI~AFTER_RETRIEVE is implemented, it will modify the CDF metadata.

 

7.png6.png

8.png

 

 

 

Once the source code highlighted, is executed, the metadata is changed.

9.png

10.png

 

 

CDF is enabled as mandatory with “Enhancement point’ implementation.

11.png

 

 

Now user submits data without entering mandatory custom defined fields.

 

12.png

 

 

 

A check has been implemented in IF_GRFN_API_CUSTOMFIELD_BADI~BEFORE_UPDATE  of class

 

 

‘ZBADI_USER_DEFINED’ to check the input values for CDF. This has been called via ‘API_UPDATE_CUSTOMFIELD’ of class ‘CL_GRFN_UTIL_CDF’.

 

 

 

15.png

 

16.png

 

 

 

User is not able to submit data without entering the Custom Defined Field(s).

17.png

 

 

 


Viewing all articles
Browse latest Browse all 459

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>