Skip to Content

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. image
You must be Logged on to comment or reply to a post.
  • Hi Tom the Netweaver Enthusiast,

    >I accepted a position with SAP as an SAP Netweaver Product Manager.
    Congratulation to your new position, I hope you will enjoy it.

    >it is one that will give me the opportunity to write on SDN as part of my role
    It's a really great news!
    I'm looking forward to read your new weblogs about Netweaver.
    Thanks also for this one.

    Best regards,

  • Hello Thomas,
    congratulations on your new job with SAP. I am looking forward to talk to you at one of the next SAP conferences. I am also curious what products you are responsible for.



    • I am going to focus on Custom Development aspects of EIM.  In general that means topics like JAVA BI SDK, KM API, and the MDM COM API; but who knows what new things might be coming down the line. 😉
  • I was wondering over the last couple of weeks as to what happened to the Kimball's name in the top contributing companies and why Thomas Jung is using gmail account in his business card. Now I know.

    Congrats Thomas and I really would like to see you here with more such good tools and tricks. I hope you can make ABAP a more richer language, now that you are part of the team SAP.


  • Hi Tom, since you are already an SAP employee and I know you are an advocate of the new ABAP editor, can you push them to make the new ABAP editor work with at least WAS 6.20?

    By the way, Congratulations, 6 months ago I know you will eventually become an SAP employee since you are well fitted there.

  • Hi Jung,

           I find it very difficult to undestand your blogs. I have tried to read your blog on BSP select-option and I am totally lost. You explaination is not clear. Most of the time you will link chain of blog docs without proper reference. Also, I have seen you have included some objects in the code without explaining about them. I get object not defined errors.
    I hope you will take my feedback positively.

    Actually I want to create a select-option in BSP. Let us say CARRID select-option. Can you provide me simple step by step instructions on how to do that?


    • I have written 115 weblogs for SDN (the majority of which are on the topic of BSP) as well as having co-authored a book on the subject.  So you will have to excuse me if I don't feel like spoon feeding basic information in each and every one of the weblogs.

      This isn't a beginner weblog.  It isn't intended to teach the reader ABAP OO or even the techniques for building BSP Extension Elements.  There have already been other weblogs on those topics.  Why repeat these basic lessons for each subsequent weblog?  I make no appologes for the fact that there are other weblogs and SAP supplied help documents that you should read and master the information in before you attempt this one.  This is a weblog, not a professional journal or a book.  Therefore the structure of the information is more freeform and evolves over time.

      >Can you provide me simple step by step instructions on how to do that...
      Give a man a fish and feed him for a day; teach a man to fish and feed him for a lifetime.  All the pieces of the puzzle that you need to assemble what you are looking for already exist on SDN.  Yes some effort must be put forth on your part to learn the information that will lead you to your final objective.  No I won't provide you with simple step by step instructions because this isn't a simple step by step process.  Without the underlying knowledge of how you got to the final product - what good would it ultimately be to you. 

      Now to your "Positive Feedback":
      >I have tried to read your blog on BSP select-option and I am totally lost...
      As I said before, perhaps you should run a few warmup laps before you attempt a maraton.

      >Most of the time you will link chain of blog docs without proper reference...
      Most of the time?  How many of my blogs actual have a chain of docs?  A few I admit - but they are there to help the reader determine the prerequisites.  "without proper reference" - what kind of reference would you like to see?

      >Also, I have seen you have included some objects in the code without explaining about them...
      That is probably because they have been explained before somewhere else or they aren't directly related to the topic at hand.  Can you provide some specific instances of where you feel more explaination is critical?

      >I get object not defined errors.
      If you supply more details about the error you received I am willing to bet we can figure them out.  Too bad that you gave up before you even asked a question. 

      If you read this and get the feeling that I was a little bit put off by your comments then your are correct.  I welcome true positive feedback.  However in real feedback you supply specific instances of problems and attempt to make a suggestion of how an offering could be made better.  I don't see any of that in your comment.  What exactly wasn't clear about the explaination?  Where did you get lost and what part didn't you understand.  That would have been helpful feedback.  It seem more to me that you are looking for something that this weblog wasn't intended to be.

      • Hi Jung,

               I am sorry for my comments. My intentions were not to hurt you. But it was more because of my frustration on not getting any solution for my scenario with select-option.
        I agree with you that probably I need to learn the BSP basics and not to hurry in getting the solution.

        Regarding getting errors in the code copied from your weblogs I would like to refer to "Using Ranges: BSP Extensions for a Input Help Range UI".
        In this document I am getting error for
        DATA: linput TYPE REF TO zcl_es_bsp_elmnt_input_help_v2,
        hinput TYPE REF TO zcl_es_bsp_elmnt_input_help_v2,

        Where have you explained this object? How to create it?

        I am also getting errors in

        IF _parameter IS NOT INITIAL. parameter = m_validator->bindable_to_boolean( name = 'parameter' value = me->parameter binding_path = _parameter page_context = m_page_context ).

        It says _parameter not declared. Similar errors are coming in many places where you are using '_variablename'.

        Regarding your references/explainations are not clear refer to the same document. In page 8 you said: "Our validation coding will reside in two different methods of the element handler class ZCL_ES_BSP_ELMNT_RANGES_DDLB." But you did not say where is this class? Also the screenshot just above this you are refering to ZCL_ES_BSP_ELMNT_RANGES_IHELP. What is the relation between these 2 objects. Do you mean all the methods you have explained in the doc are for ZCL_ES_BSP_ELMNT_RANGES_DDLB?

        I apologize if I have overlooked something.

        Finally I do accept that I feel reading your book will be the best option. On second thought I feel BSP is not the right choice for my scenario. I feel webdynpro may be better. What do you suggest?


        • >Where have you explained this object? How to create it?

          This was explained at the beginning of the document.  The following is right from the tutorial:
          "This example does build upon the input help solution already available on SDN (BSP Value Input Help Popups Version 3.0) or in the SAP Press Book: Advanced BSP Programming."

          If you don't have the class in question, it is because you have implemented the prerequisite BSP Extenstion Element.

          >Similar errors are coming in many places where you are using '_variablename'.

          If you are missing the _variablenames then you didn't implement the attributes of the element correctly.  The _variablenames are generated automatically to support data binding in MVC. They will contain the data binding strings. 

          Take a careful look at Figure 3 - Element Attributes.  The fourth checkbox in the element attribute screen determines if the attribute will support data binding.  It is this simple checkbox that controls the generation o fhte _varaiblenames.

          >Do you mean all the methods you have explained in the doc are for ZCL_ES_BSP_ELMNT_RANGES_DDLB
          That is a cut and paste mistake.  That one line that refers to ZCL_ES_BSP_ELMNT_RANGES_DDLB should read ZCL_ES_BSP_ELEMENT_RANGES_IHELP.  All of the methods are contained within the Element Handler class.

          >I feel webdynpro may be better. What do you suggest?
          Well I don't know anything about your application.  However if you are on Netweaver04S and your application is internal facing and will be stateful; then Web Dynpro ABAP may well be a better choice.  ALV, Select-Options, and Field Value Help are already built into the development environment unlike in BSP.

  • Hi,

    I think this is really great. It was something I've been looking for at BSP.

    But, I'm getting an error on method "add_to_check_table", as this is not defined in my system (620).

    Could you tell me more about this method: what it does, how, which SAP version goes with it...

    Thanks in advance,

    • ADD_TO_CHECK_TABLE is a method that should be exposed via IF_BSP_MODEL (check that interface to see if the method exists). I check in a 6.20 correction system (which has the latest support package) and the method does exist.  However it may not exist in older support packages - as I believe I have gotten this question before.  It allows the model to keep track of what form fields it needs to process.  If you don't have the method, then you can probably just drop off this section of coding.  To make sure, check the RESOLVE_MODEL_BINDING for handler class of htmlb:inputField (CL_HTMLB_INPUTFIELD).  In my system around line 100 there is a section of coding:
      if disabled is initial.
          data bspmodel type ref to if_bsp_model.
          bspmodel ?= model.
          bspmodel->add_to_check_table( control_id = name ).

      If there was some different method for doing the same thing in older 6.20 systems, then the correct coding would be in inputField.  However I don't believe that there is an alternative coding in older 6.20.

      I checked version management in the 6.20 correction system and it does look like in htmlb:inputField that this block of coding was added (in a late 2005 SP package) and there was not alternative coding before this SP level since there was only additions and no modifications shown in the version management.