In previous blog posts I have described features in the new list standard. The new list standard is a gold mine of good features, don´t forget about it! All programs listed in CMS005 have the new standard, and today I am going to describe how to create your own virtual field for a date comparison. (The new list standard is available from 13.2 and onwards).
When you have a list of purchase orders (PPS220 in this case) you can create personalizations to highlight the late order lines, but if you only see the delivery date, it is hard to quickly figure out how late an order line really is.
In the example below I have created a virtual field that shows the number of days an order is late. To the field I have added a personalization that highlights the number of days late with red when the order is delayed, and adds a grey background if the order is more than 50 days late.
Virtual fields really helps the users to see data in an easier way, and they are not difficult to configure. So let’s start making a field that shows number of days late!
We will start from CMS005, and in the example we are using the program purchase order lines, PPS220.
Option 12 takes us to the virtual fields.
To be able to show number of days late I need three virtual fields. First I need to find the day number for the requested delivery date, then I need to find the day number for today’s date, and at last I need to calculate the difference.
To get the day number for requested delivery date I create a field called &DWDT. The field type should be 7 - Date, and it is a numeric field. I want the base date to be based on an object, in this case IBDWDT (delivery date) and the date output is 2 – Day number.
To get the day number for today’s date, I create a field called &TODA. This field is also of type 7 – Date, but the base date is set to current date.
The last step is to create the field that will show number of days late, &LATE. This field is of type 1-Calculation. Since you need to have the day numbers before you can do the calculation, I need to use the calculation sequence, highlighted in yellow below.
The calculation is easy in this case, we just calculate the difference between requested delivery date (&DWDT) and todays date (&TODA).
When the fields are ready, I will add the new field to the view in PPS220, and once that is done I can see the number of days late!