Custom BSP Extensions; Time Stamp and Range UI Elements
*Introduction* An interesting thing happened the other day; I stopped being an SAP customer. I accepted a position with SAP as an SAP Netweaver Product Manager. Right away I got questions from friends asking if I was still going to be able to write on SDN. Not only did I find a position within SAP that I find very exciting, but it is one that will give me the opportunity to write on SDN as part of my role. On the other hand, in my new role I don’t exactly have responsibility for some of the key technologies that I have enjoyed writing about in the past (for example BSP). Does this mean that I am going to stop writing about BSP? No. Although programming and technology are my career choice, they are also one of my hobbies. I just happened to be lucky enough to earn a living doing what I love. To that point, even if my daily job doesn’t take me into the BSP world as often, I can still play and explore on my own time. That is exactly what this weblog is about. This isn’t Tom the *Product Manager* writing this weblog, but Tom the *Netweaver Enthusiast*. *Time Stamps* With that out of the way, I am very excited about the content that I am sharing via this weblog. I have done several projects over the years where Date and Time and/or Local Date and Time were important selection criteria. The nature of the separate date and time fields that are traditionally used in ABAP development can create complications for applications that need to query using a combination of the two elements. If you factor in the variable of global applications where users may not be certain if they are working in their local time or in some other system time zone and this can lead to real problems. To overcome this problem, I had become accustomed to using time stamps in my database tables instead of the separate date and time fields. With a single field, your selection logic for reading data from the tables is considerably simpler. Also by using a time stamp, you always have consistent timezone processing. The main drawback that I found with using time stamps is that there is no UI element in classic ABAP or BSP for them. I found myself having to code conversions from time stamps to separate dates and back again in each application. This also lead to creating several separate UI elements for each time stamp. Truly who wants to keep coding the same logic and separate UI elements over and over again in each application? This just adds to the long term maintenance costs of the application. I thought it would be better to create a composite BSP Extension Element. The element would accept and return time stamps. However in the internal processing of the element it would convert these time stamps into separate UI elements. All the extra processing that goes along with using time stamps could be written once and then hidden away forever.