Service Due Indicator for Managers
2023-11-19 22:13:20 Author: blogs.sap.com(查看原文) 阅读量:6 收藏

Background:

In Many Tables there might be a need to provide a quick high-level view of the Pending status of every record for a quick view by Managers.

For example, a Service Team Manager might want to see the list of Service Orders whose Service Due date is in the past (or) Service Due date which is today (or) Service Due date which is in future.

In these scenarios, we can provide an Indicator in the first column so that the Manager will be able to see the status immediately.

In this blog, I have explained a scenario where we can add a Status column to the Table which in turn will give immediate view to the Service Manager on the status of the Service records.

Fig 1: Sample Output

In the above screenshot, in the status column the Status Symbol is different for Different transactions based on the Service Due Date.

Scenarios

Fig 2: Scenarios

Steps:

  1. In TCode bsp_wd_cmpwb , go the Component / View. Go to the Context node for the Table view and add the Attribute for the Status.
  2. Generate the relevant methods.
  3. Add the coding in the GET_P method.
  4. Add the coding in the GET method.
  5. Add the attribute to the GET_TABLE_LINE_SAMPLE method.
  6. Do the configuration in the configuration tab and keep this attribute as the first column.

Detailed Steps:

Step 1:

In TCode bsp_wd_cmpwb , go the Component / View. Go to the Context node for the Table view and add the Attribute for the Status.

TCode%20%3A%20bsp_wd_cmpwb

Fig 3: TCode : bsp_wd_cmpwb

Complete%20the%20Wizard

Fig 4: Complete the Wizard

Step 2:

Generate the relevant methods:

Generate%20the%20GET_P%20Method

Generate the GET_P Method

Click%20on%20Yes%20in%20the%20above%20Popup.

Fig 5: Click on Yes in the above Popup.

Step 3:

Add the coding in the GET_P method:

Code%20in%20GET_P%20Method

Fig 6: Code in GET_P Method

METHOD GET_P_SERVICE_STATUS.
****************************************************************************************************
* Here we define the Property of the field.
****************************************************************************************************
CASE iv_property.
WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
rv_value = cl_bsp_dlc_view_descriptor=>field_type_image.
ENDCASE.

ENDMETHOD.

Step 4:

Add the coding in the GET method:

Get the Date of Service Due date (into a variable lv_serv_due_date ) and do the Comparison and add the Status accordingly as per below code:

Code%20in%20GET%20Method%20of%20the%20Attribute

Fig 7: Code in GET Method of the Attribute

Step 5:

Add the attribute to the GET_TABLE_LINE_SAMPLE method:

CODE%20in%20GET_TABLE_LINE_SAMPLE%20method

Fig 8: CODE in GET_TABLE_LINE_SAMPLE method

Step 6:

Do the configuration in the configuration tab and keep this attribute as the first column.

Configuration%20of%20the%20Table%20View

Fig 9: Configuration of the Table View

Now let is test.

Output%20Screenshot

Fig 10: Output Screenshot

Conclusion:

By looking at the above table in the first column, the Service Manager will be able to get an immediate view of the Orders that need immediate attention and plan accordingly and this in turn will lead to increased Customer satisfaction.


文章来源: https://blogs.sap.com/2023/11/19/status-indicator-for-managers/
如有侵权请联系:admin#unsafe.sh