MSS POWL Make it Cleaner and User Friendly
After a rather long hiatus I finally found sometime to logon to SCN, and to my chagrin, I still see my points stuck at 399 😛 , just like Sachin’s score on 99. There are times when nobody rewards for the knowledge you post, but that should never deter one from posting new ones 😉 . SCN is the backbone for so many developers and consultants, and many cannot imagine a SAP career without it ..haha 😀 .
Once in a while you feel some change in the wind and think good times are back, life is getting easy, but then happiness is always short lived unless you achieve nirvana. Resting on the laurels and being complacent that atlast we have met every requrement and hit the nail on the head is just a delusion of all developers. As a SAP developer you might ponder why end users are so insistent on things which you might think is trivial and silly, may be, because we are never the end user and fail see it from their perspectives, how simple things can change their mundane work and make life easier for them.
Just as I was feeling that the end user training was going as planned, one of users gets a brainwave after seeing the POWL inbox and suggests why should I see all the queries when there are no tasks in those, this makes it difficult to identify and it looks cluttered, he wanted all queries with no task to be removed from his view. By the time I recover from the shot I have another sniper shot from another user with the bullet reading “I want different colors for different kinds of request for the same process”, I gather my senses and balance thinking of the golden words “nothing is impossible”, some times you need hang on to your hopes. In POWL configuration we do have an option to assign POWL queries to particular users or based on roles. With no stone left unturned I could not see how this particular requirement can be met from powl cockpit.
In one of my earlier blogs I have explained how you can categorize the POWL queries based on the text when you have the same taskid, here in this short blog we will see how we can make the powl link matrix neater and the powl rows colorful. To meet these requirements we need to get out of the cockpit and work on the engine, to nail the first one, find out the POWL component for the MSS inbox, get into the actual component, the POWL_UI_COMP. The hyperlinks are rendered dynamically in the view MASTER_MATRIX in the active queries section.
Create an enhancement in the form of post exit on the WDMODIFYVIEW method, Before you goahead with the coding find out the UI structure from the web dynpro technical help. As you can see below, the links are rendered encapsulated in Groups and Transparent containers, so we need to drill down the UI element to get a handle to that link. Once you know the structure, it just takes a few lines of code to achieve your requirement.
Sample code as below. Just read the text view text to detect any string with “(0)”, and hide it.
POWL before the changes looks cluttered with too many links appearing with Zero tasks.
POWL after modifcation, looks neater and easier to work with lesser and relevant links on which user has to work on.
For the second requirment of colouring the POWL rows based on request type for the same process we need to initially have the text of request as a part of the work item text, which can be easily accomplished by having the request type as part of the workflow container and then mapping the same on to the work item text. Once we have done this, there is a bit of enhacement which needs to be done on the feeder. the easiest way to find the feeder is to get it from the powl cockpit for the application ID MANAGER_MSS_INBOX_2 or go through the technical help, the feeder for MSS inbox is CL_IBO_INBOX_FEEDER_WI.
As you most of you will be aware that POWL is basically an ALV with all the added functionality, so to manipulate it we need to alter its field catalog. So in the method READ_CUST_FIELDCAT of this class add another column named COLOR to the fieldcatalog, and make this COLOR as the color reference field by passing the column name to color_ref field of the field catalog.
In the method IF_POWL_FEEDER~GET_OBJECTS it gets all the work items related to the query this could be the ideal place to check the work item text and then manipulate the color. Here you can validate the string for particular value and assign required color by passing an integer value to the COLOR column, you can pass up to value 19 to get different colour variations. The color variations can really be helpful for the user to identify the priority tasks based on the request type for the same process.
Row colors based on request type text.
Hope this stuff is useful to someone, somewhere, in some project 🙂 , and thanks for reading. And yes my points has passed the 399 jinx 😉 after this blog.