Extension of Standard Task Summary View with Custom fields


Hello All,

I Hope everyone doing well! 🙂

Introduction:

Recently, we got a requirement to enhance standard Fiori application with custom fields for one of the tile, when the tile is clicked we will have access to My inbox application. In this application the window is divided into main & detail window. Please refer to the below screenshot.

From above screenshot we have a option for Multi selection(Multi select button). When approver clicks on multi-select for bulk approval, the following is displayed with standard fields (Title, Created by and Due on).

In this blog, I am going to explain you how to extend the Task Summary View with custom fields in My inbox application.

When multi-select check box is selected and requests are checked/selected either via Select All or individually selecting the requests, Task Summary section should display the details of the selected requests with below custom fields.

  1. Name
  2. Period
  3. Requested
  4. Type
  5. Comments

In order to achieve the above requirement I have followed below steps.

OData extension in Gateway System:

Step 1:  Created a new project in SEGW transaction code and redefine the standard OData service (/IWPGW/TASKPROCESSING) as shown in below.

Click on next button then following screen will be displayed. Just select all the properties and click on finish button. Step 2: Now, we need to extend the “TASK” Entity type with custom field as per requirement (NAME, PERIOD, REQUESTED, TYPE, COMMENTS).

Note:  Here we need to add one more property “SAP__Origin” as KEY along with above new custom fields.

This “SAP_Origin” field would play important role while extending the TASK entity this field will capture the system alias.

Step 3:   Extension of Entity Type- TASKDEFINITION as shown in below.

Step 4: Once project is generated, Redefined the ENTITYSET_TASK method in DPC_EXT and added new custom code to fill new fields.

  • Here, I have created a new RFC function module in ECC system as there is no data in Gateway system and calling that RFC in ENTITYSET_TASK method and filling the Custom fields data.
  • Passing “Workitem” (LT_TASKS) information to RFC FM and get the data From ECC System.
  • Getting “SAP__Origin” information from table /iwfnd/c_mgdeam by passing Service_ID.

Step 5: Redefined the ENTITYSET_TASK_DEFINITION method in DPC_EXT and getting data to “SAP_Origin” from table /iwfnd/c_mgdeam.Step 6: Go to transaction code: /iwfnd/maint_Service and add the service and System alias.

Note: Here system alias should be ECC system alias.

 

Frontend application UI5 Extension:

View Design:

To add new columns in Task Summary, extension point is not available so replaced the Multiselectsummary View as Multiselectsummarycustom and added new columns as below.

Controller Extension:

To retrieve the data of new properties added new properties to select in the hook method extHookGetPropertiesToSelect by extending S2 controller as below.

  • To refresh the Master data modified sendMultiSelectActionSuccess function in S2Custom Controller, and sendAction function in S3Custom controller.

Added the code (this.oDataManager.refreshListOnAddInboxDone()) as below.

          S2Custom Controller:

S3Custom controller:

Result:

Summary:

By following the above steps, we can enhance the standard Fiori application with custom fields.

Hope this blog will be helpful 🙂

Thanks for reading .

Please provide your valuable feedback on comment section.

 

-Please follow Puligilli Mahesh for future posts.

-Ask or follow questions about SAP NetWeaver .

-Read other SAP NetWeaver and follow blog posts.

 

Thanks & Regards

Mahesh

 



Source link

Be the first to comment

Leave a Reply

Your email address will not be published.


*