domingo, 26 de dezembro de 2021

POWL Enhancement in SAP TM

 In this document you learn how to add custom fields in POWL in SAP TM –

Business Scenario -> To add a custom field i.e. Transportation Mode in any Active Query in POWL Present in the Planning Worklist component of NWBC in SAP TM.

 

Step 1 – Get the Application ID and POWL Type using Function Module POWL_QUERY_REFRESH

Here, Application ID is “SCMTMS_POWL_PLAN” and POWL TYPE is “SCMTMS_TOR_FU”.

 

Step 2 -> Go to T-Code POWL_COCKPIT

Choose POWL Type as Standard POWL and execute

Search the application ID “SCMTMS_POWL_PLAN ” and Click on Maintain Type

Now search the POWL TYPE “SCMTMS_TOR_FU” and get the corresponding Feeder class.

POWL Feeder Class -> /SCMTMS/CL_UI_POW_FD_TOR_FU

The main access point for a POWL is the POWL Feeder Class. It contains the definition of the
POWL’s selection criteria, the field catalog (i.e. the result structure) and the actions that can
be executed from the POWL Toolbar for a selected set of object instances from the POWL
result list.

In TM a POWL Feeder Class is usually based on a query of a Business Object. The
relationship between a Business Object query (a Generic Result Query) and a POWL Feeder
class is always one to one. So whenever there is no POWL Feeder Class making use of an
existing Generic Result Query of a BO you will need a new POWL Feeder Class.
You should also keep this in mind when creating BO Queries for POWL usage. If you have
two completely different requirements leading to different BO Queries, of course two different
POWL Feeder Classes are required.

Step 3 -> Keep a breakpoint at the method ‘CONSTRUCTOR’ of the POWL Feeder Class ” /SCMTMS/CL_UI_POW_FD_TOR_FU” to get the structure names for selection criteria and output Structure.

Result Structure (Output Structure) –> /SCMTMS/S_UI_POW_R_FU

The structure will represent the Result Structure for the new
POWL, i.e. it contains the list of attributes that will be available to be displayed in the
result list of the POWL.

Selection Criteria Structure –> /SCMTMS/S_UI_POW_S_FU

This structure will represent the Search Structure for the new
POWL, i.e. it contains the list of attributes that will be available as selection criteria for
the POWL queries.

According to the business requirement, we have to enhance Output structure and Insert the custom field i.e. Transportation Mode (MOT).

 

Step 4 -> To display the custom fields i.e. Transportation Mode (MOT) in POWL in NWBC, enhance the below method of POWL feeder class –

Class -> /SCMTMS/CL_UI_POW_FD_TOR_FU
Method -> IF_POWL_FEEDER~GET_FIELD_CATALOG

In the signature of the method you have the parameter C_FIELDCAT which is used for field catalog –

Let’s look at the sample code –

It will start displaying the custom field in UI as shown below –

 

Step 5 -> To get the data in the custom fields in POWL in NWBC, we can enhance the below method of POWL feeder class as per the business requirement –

Class -> /SCMTMS/CL_UI_POW_FD_TOR_FU
Method -> IF_POWL_FEEDER~GET_OBJECTS

Step 6 -> Refresh the POWL Query to get the changes reflected in UI.

 

Related Content –
https://wiki.scn.sap.com/wiki/display/WDABAP/FAQ+ABOUT+POWL?original_fqdn=wiki.sdn.sap.com

https://wiki.scn.sap.com/wiki/display/WDABAP/POWL+Reports?original_fqdn=wiki.sdn.sap.com

In a similar way, We can achieve a lot of custom requirements by enhancing the methods of the POWL Feeder Class.

Source: https://blogs.sap.com/2021/12/15/powl-enhancement-in-sap-tm/

Um comentário: