SAP GRC 10 – Add Custom fields in UAR Workflow
I have recently got a requirement from the Business users to get some additional fields in UAR Workflow. For example they wanted to get Valid From and Valid To in the Review list which will be of great helpful for them to review the access items. Since I wasn’t much familiar with the data in GRC , I was going against SAP ERP to see how I can bring the Valid From and Valid To data into GRC, but Alessandro Banzer and Colleen Hebbert helped me in the right direction to fetch the data from GRC instead of the satellite tables. Alright enough of the story I guess 🙂 ..
The below Enhancement is done in GRC 10.
1) Append your custom fields into GRAC_S_UI_REVDATA
2) Go to SE80 and choose the Web Dynpro Comp. / Intf. – GRAC_UIBB_USER_ACC_REVIEW
(This is the Webdynpro component we are going to enhance it to show it on the screen)
3) Double click on V_UAR_ITEMS from Views and choose Enhance from the Menu (Ctrl + F4) and create Enhance Implementation
4) Double click on the COMPONENTCONTROLLER and choose N_UAR_ITEM_DATA from the Context.
5) Right click on N_UAR_ITEM_DATA and choose Create Using the Wizard – Attributes from Components of Structure.
6) Choose the custom fields from the pop-up to add them into the context.
7) Now double click on V_UAR_ITEMS from Views and select N_ITEM_DATA from Context.
8) Now right click on N_ITEM_DATA and choose Update Mapping and select Yes from the pop-up.
Okay , now we are moving on to place those fields on the screen.
9) Make sure you are still on the V_UAR_ITEMS view and go to the Layout
10) Right Click on the TABLE and choose Insert Columns (Repeat the same for all the custom fields you have)
11) After creating the Columns, Insert Text View and Header to those Columns. I have copied the same parameters from TC_ITEM_DESC to my new custom columns (Except ID’s which has to be unique)
12) After creating those properties, don’t forget to do the binding.
That’s it. Now the fun part (Coding) 🙂 .. Since my requirement is pretty simple, I handled the coding on the WDDOINIT Post-Exit part.
13) Now go to the Methods tab (make sure still you are in V_UAR_ITEMS view) , click to create Post-Exit on WDDOINIT.
14). Write your coding on this exit.
15). Code to populate ZZ_VALID_FROM and ZZ_VALID_TO Contexts.
DATA lo_nd_n_item_data TYPE REF TO if_wd_context_node. DATA lt_n_item_data TYPE wd_this->elements_n_item_data. DATA lo_el_n_item_data TYPE REF TO if_wd_context_element. DATA ls_n_item_data TYPE wd_this->element_n_item_data. DATA lv_validfrm TYPE GRFN_TIMESTAMP. DATA lv_validto TYPE GRFN_TIMESTAMP. DATA: lv_item_ty_desc TYPE string, lv_validfrm_s type string, lv_validto_s type string. DATA: lv_roleid type GRFN_GUID. lo_nd_n_item_data = wd_context->get_child_node( name = wd_this->wdctx_n_item_data ). lo_nd_n_item_data->get_static_attributes_table( IMPORTING table = lt_n_item_data ). LOOP AT lt_n_item_data INTO ls_n_item_data. lv_item_ty_desc = ls_n_item_data-item_type_desc. TRANSLATE lv_item_ty_desc TO UPPER CASE. if lv_item_ty_desc eq 'USER'. select single role_id into lv_roleid from gracrlconn where role_name eq ls_n_item_data-parent_key and connector = 'SAP_ERP'. select single valid_from valid_to from gracuserrole into (lv_validfrm,lv_validto) where role_id = lv_roleid and user_id = ls_n_item_data-user_name. else. "Nothing endif. lv_validfrm_s = lv_validfrm. lv_validto_s = lv_validto. CONDENSE lv_validfrm_s. CONDENSE lv_validto_s. if lv_validfrm_s eq '0'. ls_n_item_data-zz_valid_from = ''. else. ls_n_item_data-zz_valid_from = lv_validfrm_s(8). endif. if lv_validto_s eq '0'. ls_n_item_data-zz_valid_to = ''. else. ls_n_item_data-zz_valid_to = lv_validto_s(8). endif. modify lt_n_item_data from ls_n_item_data. clear: lv_validfrm, lv_validto, lv_item_ty_desc. ENDLOOP. lo_nd_n_item_data->BIND_TABLE( exporting NEW_ITEMS = lt_n_item_data ).
16). The Final Result:
That’s it . I guess one more thing on the last screenshot you might have noticed – Yes the Export button. It was also custom solution to export those values to Excel. If it’s of anyone’s interest then I’ll write it up.
Thanks everyone for taking your time to look at this.Please go easy on me 😉 ,as this is my first ever blog in SCN after my 11 years with SCN. I always wanted to post blog on my PI/PO space, but apparently GRC space seems to be where my first blog landed 🙂 .. Please feel free to add comments about if there are any mistakes in the way I have handled the design or if you find the blog is not quality enough. I’ll try to improvise.
Very useful blog with detailed steps.
Can you please add on the custom solution for exporting the values as well.
Thanks in advance.
Congrats on your first blog
I'm not a developer but the two things I noticed are:
For a better date format, just need change the char8 in step 1 to
for their respective fields component types:
I have a similar request from Business to Add Access Requests from GRC can be segregated by Locations and Functions - GRC 10.1 - How to get details of Country information and requestor name in the GRC Work inbox grid
We have added Creator & Organization in our GRC work inbox items grid view, but it doesn’t seems providing any information for approver there.
Once the Approver opens his/her work inbox, They should able to see details of Requestor, User Id, User Name, Organization, Email text update of the requestor and Country details are required to populate in the work inbox grid before opening Access request.
We have both Western hub (US) and Eastern Hub (Malaysian) Approvers. They should able to see identify their country details before opening and approving the Access request.
I need some help and assistance if any such adjustments and enhancements can be done in GRC Production 10.1
Below is the example of Workflow message received by the Approver:
Dear Approver, A new request has been submitted for your approval. Please find the details below: Request Type: Change Account Request Number: 643 User Name: XXXX User ID: XXXX
Location: This field needs to be enabled here
Assignment Requisition: Role ZC: MURP: FICO: CLR_VENDOR added to request for PE0CLNT100 for action 'Assign' with validity 27.09.2016-31.12.9999 for user xxx Role ZC: MURP: JVA: CLR_CUSTOMER added to request for PE0CLNT100 for action 'Assign' with validity 27.09.2016-31.12.9999 for user xxxx
Hi Justin/ All,
Subject : Disable Administration and Cancel Instance tab in Search Request in GRC Access Request Administration (GRC 10.1)
We have a requirement to provide Search request Under Access Request Administration to all Requestor/Manager and Role owners.
Currently GRC requestors do not have access to Search functionality to find the request status . We are able to provide access for search request, But unable to restrict and disable Administration and Cancel Instance tab in Search Request in GRC Access Request Administration.
Could you please let us know the possibilities on how to restrict and disable above options.
Appreciate your help in this regard.
Thanks and Regards,
Thanks for providing such useful blog:)
Would appreciate if you can add on the custom solution for exporting the values out to an excel file as well
I just read your blod and find this indeed very useful, thank you for sharing.
In regards to your comment : "I guess one more thing on the last screenshot you might have noticed – Yes the Export button. It was also custom solution to export those values to Excel. If it’s of anyone’s interest then I’ll write it up."
This information would indeed be very useful. If you have some time or could provide me the code, this would be highly appreciated. 🙂