BSP Element Expressions

Hi,
   I am practicing on BSP Element Expressions and i have gone through the weblog by Brain McKellar. I am trying the same example given in the weblog but i am getting an exception at the statement 
<bsp:bee bee = "<%= bee%>" /> in the layout.
    I have not instantiated but i have declared it as an page attribute as given in the weblog.
    Why am i getting an error? any help is highly appriciated.
Regards,
Azaz.

You have to instantiate the bee before you use it. otherwise the bee is not bound or is null so u'll get exception. The right way is to check the bee before you use it i.e.
change the html layout code this way.
<% if bee is bound. %>
<bsp:bee bee = "<%= bee%>" />
<% endif. %>
This is the first step. This way even if you don't instantiate the bee, u'll not get any exception or crash.
Second point is using the bee if instantiated properly.
Instantiation of bee is compulsory if you want to use it.
Do the instantiation anywhere where u think its correct. you can do it in OnInitialization handler or in inputProcessing etc. In the blog it is done in the OnInputProcessing.
As I said earlier, the fixes to make that code work properly are mentioned at the bottom of the blog.
Regards,
Kumar

Similar Messages

  • BSP Element Expressions XML Parameters : ABAP Question

    Hi, can anyone please give me a tip or a small example of a use of parameters in XML BEE? They are defined in a BSP and then set there in the bee SET method of CL_BSP_BEE_XML. Brian McKellar gives an example in his Weblog /people/brian.mckellar/blog/2003/10/30/bsp-programming-bsp-element-expressions-bees but I have a different situation and dont understand what they might mean for me. Thanks for any information. Best regards David Lawn

    This post has now been answered in the BSP forum.
    Best regards
    David Lawn

  • BSP Programming: BSP Element Expressions (BEEs)

    Hi,
    Alex reported a difficulty with
    BSP Programming: BSP Element Expressions (BEEs)
    /people/brian.mckellar/blog/2003/10/30/bsp-programming-bsp-element-expressions-bees
    back in March.
    Since I also set up the example contained in that paper recently, and since I permitted myself to add in some lines of code with which it works well, I give those lines here:
    1) the bee call:
    <%
    if bee is bound.
    %>
    <bsp:bee bee="<%= bee %>" />
    <%
    endif.
    %>
    2) in the xml part of onInputProcessing:
    2.1)
    data: xml_errors type TIXMLTERR.
    2.2)
    append <xml_parm> to xml_parms.
    also seemed a good idea.
    I hope this is useful.
    Best regards
    David Lawn

    Oops ... I dont need the append statement of course (because I have insert .. assigning). Sorry about that.

  • BEE(BSP Element Expression)

    Hi Forums,
        What is the use of BEE and where do we use it ? can any body explain with the help of example.
         Documents with example will really helpful.
    Thanks in advance.
    Regards,
    Ravi.

    Hi,
    Did you check /people/brian.mckellar/blog/2003/10/30/bsp-programming-bsp-element-expressions-bees
    Eddy

  • BSP Element Expressions XML Parameters

    Hi, can anyone please give me a tip or a small example of a use of parameters in XML BEE? They are defined in a BSP and then set there in the bee SET method of CL_BSP_BEE_XML. Brian McKellar gives an example in his Weblog /people/brian.mckellar/blog/2003/10/30/bsp-programming-bsp-element-expressions-bees but I have a different situation and dont understand what they might mean for me. Thanks for any information. Best regards David Lawn

    Hi Brian, thank you very much.
    In fact I have success with the tutorials you have given. I still have some difficulties but believe they can be overcome:
    1. I am in a method of the bsp application class. I have dumped the code into this method from a bsp page include fragment.
    2. Thus, in this method, I now have business logic abap determining which <htmlb elements are created and what values the variables of these elements have. Thus at runtime I pass to the bee a concatenated string like '<htmlb:textView id  ="' l_id_element_name ' text      = "' l_text 'design    = "' l_design '"' ... '/>'. I had figured I had, at runtime, no variables and so needed no parameters. In fact, I have had to find that if I do not code parameters then adding in a second piece of <htmlb code crashes the bee and I loose the browser display of the first one. If I parameterise the first and the second, then I have both. So thats clear. I have also found that bee string syntax is totally strict. I also looked at bee->m_dom dom_table in the debugger, together with the parameters, which helped me understand.
    I am adding in bits of the huge amount of business logic at a time to keep the bee string consistent.
    3. After setting the bee I pass it back to the view include that called my method (I have a nice ddic structure for that) and display the result as you do in your tutorial.
    4. The total result thus is that I no longer need business logic in my view includes and can create html from htmlb in the application class method, which is what I need. Thanks!
    4. My need: I firstly just need to get a form onto the browser as quickly as possible so that other project members can see it and plan. Performance is secondary at the moment. I am happy to use the xml bee.
    5. The bsp I work with has a strange structure, with a page with flow logic <bsp:goto-ing a controller which calls a view with many includes, one of which is mine (which also has includes). So your other suggestion, using views, will also be followed up as soon as I get my page up and visible.
    Kind regards David

  • How to display string which has BSP elements correctly?

    Hi,
       I have a string variable lv_text which content is:
    <htmlb:group height = "100%"
                         width  = "100%" >
              <htmlb:groupHeader>
                <xhtmlb:toolbar id="toolbar1" >
                  <xhtmlb:toolbarItem placement="LEFT" >
                    <htmlb:textView design = "HEADER3"
                                    text   = "AAAA"/>
                  </xhtmlb:toolbarItem>
                </xhtmlb:toolbar>
              </htmlb:groupHeader>
              <htmlb:groupBody>
                <%
      if gv_if_dis_message = 'X'.
                %>
                <%@include file="message.htm" %>
                <%
      Endif.
                %>
              </htmlb:groupBody>
            </htmlb:group>
        I want to use it in my BSP page and display the content correctly. Because it has some BSP elements, so now it can not be displayed correctly. How to solve this problem?
        Thanks a lot!

    you cannot do this way. what you can do is call the factory method of the htmlb:<tab> to get the element and render the element to a string and you can now use this string in your bsp page.
    Regards
    Raja

  • Bindable attribute for BSP elements in BSP extensions

    Hey all
      Can anyone explain what the 'Bindable' attribute in BSP elements, in BSP extensions, is for? It has no F1 help documentation and is not documented in the SAP library with the rest of the BSP element attributes.
    Many thanks
    Mark

    Which field is? Has translate value content to spanish for this field?.
    In SAP CRM UI, press F2 and tell me which is the field

  • FixedHeaders atribute in configTable bsp-element

    Hi!
    The task is make column headers of bp search results table fixed when scrolling.
    E.g.
    Component BP_HEAD_SEARCH displays BP search results in view MainSearchResult.
    In view-layot html-page of this view i find bsp-element configTable calling.
    This bsp-element have an attribute fixedHeaders with default value "False".
    Description for this attribute says "Whether headers should be fixed when scrolling".
    I try to pass "True" in to fixedHeaders attribute, but it doesn't changed anything in UI logic -
    scroll work as ussual.
    Anyboy know how to use this attribute?
    Regards,
    Marat.

    Hello, Marat.
    I think that this parameter works only if you have vertical scrollbar in the table. Because it cann't handle the vertical scrolling in "parent" frame.

  • Prevent rendering of inner BSP elements

    Hi all,
    does anyone know a possibility to prevent the rendering of the inner elements of a custom BSP element? I want to do something like this:
    <mat:elem hideInner="true">
      <htmlb:inputfield ... />
    </mat:elem>
    I would like to control from the <mat:elem/> whether or not the  <htmlb:inputfield/> is rendered....
    I know that I could use a simple <% if ... %>, but an element would be nicer
    Any help is appreciated,
    Matthias

    I would look at the BSP Element BSP:findAndReplace.  I looks like you could grab the inner content during the DO_AT_END using:
      data: content type string.
      content = m_out->get_content( ).
    I haven't tried it, but instead of changing a small part of the content, you could just wipe it out.

  • Making htmlb:listbox bindable by new BSP-Element

    Hi,
    I tried to built a new bsp element which renders a listbox and where the table attribute is bindable.
    So far I declared the element listBoxBindable in my own BSP-Extension with the same atrributes as htmlb:listBox.
    For Element content I marked 'empty'.
    For More Options I marked 'User defined Validation' and 'No return of PAGE DONE...'.
    In element-handler-class I copied the methods IF_BSP_ELEMENT~COMPILE_TIME_IS_VALID
    IF_BSP_ELEMENT~RUNTIME_IS_VALID
    from HTMLB:ListBox.
    method if_bsp_element~do_at_beginning.
      resolve_model_binding( ).
      data: listbox type ref to cl_htmlb_listbox.
      listbox ?= cl_htmlb_listbox=>factory(
                id                          = me->id
                backgroundcolor             = me->backgroundcolor
                disabled                    = me->disabled
                encode                      = me->encode
                multiple                    = me->multiple
                nameofbackgroundcolorcolumn = me->nameofbackgroundcolorcolumn
                nameofkeycolumn             = me->nameofkeycolumn
                nameoftextcolorcolumn       = me->nameoftextcolorcolumn
                nameofvaluecolumn           = me->nameofvaluecolumn
                selection                   = me->selection
                selections                  = me->selections
                size                        = me->size
                table                       = me->table
                textcolor                   = me->textcolor
                width                       = me->width ).
      rc = co_element_done.
    endmethod.
    method resolve_model_binding.
      data: model_name type string.
    * table
      if _table is not initial.
        call method cl_bsp_model=>if_bsp_model_util~split_binding_expression
          exporting
            binding_expression = _table
          importing
            attribute_path     = m_table_path
            model_name         = model_name.
        m_table_model  = m_page_context->get_model( model_name ).
        table = m_table_model->get_attribute_data_ref( attribute_path = m_table_path ).
      endif.
    endmethod.
    <b>Unfortunately nothing is rendered - anybody an idea where I forgot something?</b>
    Thx in advance!

    Just off the top of my head, I would say you are missing the rendering loop for the listbox.
    Add the following after the method call to cl_htmlb_listbox=>factory.
        while m_page_context->element_process( element = listbox ) = co_element_continue.
        endwhile. "End Listbox Render

  • BSP Element inputHelp

    I have implemented below code for implemting Thomas Jung's "InputHelpV2" on my BSP Application. Everything works fine as expected.
    But, I can't read the value selected from this help in field [user_id].
    Please find the below code for your reference:
                  <zdialog:dialogHeader id="dialogHeader" />
                  <zf4help:inputHelpV2 id            = "SubstituteUser"
                                       dataRef       = "V_USERNAME-BNAME"
                                       design        = "STANDARD"
                                       disabled      = "FALSE"
                                       invalid       = "FALSE"
                                       maxRows       = "500"
                                       required      = "FALSE"
                                       encode        = "TRUE"
                                       size          = "12"
                                       selections    = "<%= selections %>"
                                       visible       = "TRUE"
                                       alignment     = "LEFT"
                                       multiple      = "FALSE"
                                       submitOnEnter = "FALSE" />
    [Page Attributes]
    user_id     TYPE     XUBNAME
    [Event Handler: OnInputProcessing]
      DATA: ihelp         TYPE REF TO zcl_es_bsp_elmnt_input_help_v2.
      ihelp ?= cl_htmlb_manager=>get_data(
                            request      = runtime->server->request
                            name         = 'zf4help:inputHelpV2'
                            id           = 'SubstituteUser' ).
      user_id       = ihelp->value.
    Please find the values at the time of debugging:<b>
    <i>IHELP =
    ihelp->value = [blank]
    user_id = [blank]</i></b>
    Please advice how to fix this.
    Regards,
    Piyush

    Well normally there would be nothing wrong with what you are doing.  I'm afraid that hte inputHelpV2 isn't as sophisticated as it could be because of the old code path to use either input fields or multiple value selections.  I didn't implement the IF_HTMLB_DATA interface so you can't cast the htmlb manager get_data directly into it.  Instead you have to use the underlying inputField.  Also you have to add the postfix to the id of the outer inputHelpV2:
    data: ihelp         type ref to cl_htmlb_inputfield.
    data fields type tihttpnvp.
    runtime->server->request->get_form_fields(
      changing
        fields = fields ).
    ihelp ?= cl_htmlb_manager=>get_data(
                          request      = runtime->server->request
                          name         = 'inputfield'
                          id           = 'substituteuser__inputfield' ).
    user_id       = ihelp->value.
    I guess I never took the effort to go back and implement the interface that would allow direct casting from inputHelpV2 because I almost always used this element in MVC with Data Binding - and then the input processing simply wasn't an issue because I didn't have to code it. 
    If you wanted to implement the IF_HTMLB_DATA interface in the value help example it wouldn't be that difficult.  You would have to do something like the following to implement the interface:
    method if_htmlb_data~event_initialize.
      if p_event_id_expected is not initial
          and p_event_id <> p_event_id_expected.
        p_event_is_not_event = 'X'.
        return.
      endif.
    * Copy those parameters which we keep verbatim
      me->if_htmlb_data~event_id              = p_event_id.
      me->if_htmlb_data~event_type            = p_event_type.
      me->if_htmlb_data~event_class           = p_event_class.
      me->if_htmlb_data~event_name            = p_event_name.
      me->if_htmlb_data~event_server_name     = p_event_server_name.
      me->if_htmlb_data~event_defined         = p_event_defined.
      me->if_htmlb_data~event_intercept_depth = p_event_intercept_depth.
    * Call our "GET_DATA" method to restore all stuff from the request
      me->if_htmlb_data~restore_from_request( request = p_request
        id = me->if_htmlb_data~event_id ).
    endmethod.
    method if_htmlb_data~restore_from_request.
    * Normally the GET_EVENT will call this guy to restore data. If the user
    * calls GET_DATA, and we have an event, then we want to restore both
    * so that we can apply the event to our data.
      if me->if_htmlb_data~event_id is initial and
         cl_htmlb_manager=>check_and_initialise_event(
                         instance          = me
                         request           = request
                         event_id_expected = id
                         class_name        = me->m_class_name
                    ) is not initial.
        return.
      endif.
      me->id    = id.
      data: field_id type string.
      data: fields type tihttpnvp.
      request->get_form_fields( changing fields = fields ).
      concatenate me->id '__inputfield' into field_id.
      value = request->get_form_field( field_id ).
    endmethod.

  • BSP Element

    Hello All,
          what is the exact difference between Element handler class and generated basis Class ?
    what is their use ?
    Regards,
    Deepu.K

    Deepu,
    Please check the below link,
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/a0/10193ca1f5e713e10000000a114084/frameset.htm">Link to difference between Element handler class and generated basis Class</a>
    Thanks!
    Lakshmikandh

  • Tree Structure Expansion - BSP Element "TREE"

    When I expand a node of a tree in one of my views viz Organization View, then the scroller comes in case there are more nodes than the view can accept at a time.
    Now if I scroll down and again click on one of the nodes in the tree then that node expands which is alright, but the scroller goes to the top. This causes the inconvenience to again scroll down then see the entries in the last expanded node.
    So is there anyway that I can remain over the same node which is expanded even though there is a scroller.
    For some information, I am using the CRMIC tag "tree" with the following attributes -
    id
    iterator
    keyColumn
    multiSelect
    nodeTable
    nodeTextColumn
    nodeTextColumnDescription
    onCollapseNode
    onExpandNode
    onNodeClick
    onRowSelection
    selectedRowIndex
    selectedRowIndexTable
    selectedRowKey
    table
    visibleFirstRow
    visibleRowCount
    Regards.

    Hi Bharat ,
    Thanks for the reply.
    Yes you are right, we don't have button on each level. I will try to take the example which you have taken with one extra level.
    Main level 1
    Header Level 1.
    Level 1.
    Level 2.
    Header Level 2.
    Level 1.
    Level 2.
    Level 3.
    Main level 2
    Header Level 1.
    Level 1.
    Level 2.
    Level 3.
    Main level 3
    Header Level 1.
    Level 1.
    Level 2.
    So in above example, we have three levels.
    1st Level: Main level
    2nd Level: Header Level
    3rd Level: Level
    Now my requirement is,  Let's say user will select Header Level 1 of Main Level 2. And user wants to add  Level 4 just below the level 3 of this level.
    Then generally we have the supply method, where we collect the data for each and every level. bu in this case I am not able to get, how can I modify this level?
    Thanks!
    Regards
    PG

  • Any good material on BSP and specially for MVC

    Hi,
    I am new to BSP extension and MVC and i just want to do some knowledge building on MVC and BSP extension. If any one have good material on it other than http://help.sap.com/[/url] then please let me know.
    Thanks in advance,
    Sunil Bhavsar.

    Here are a couple of other weblogs on the subject of MVC and BSP Extensions:
    /people/brian.mckellar/blog/2004/08/19/bsp-programming-writing-a-pattern-engine
    /people/brian.mckellar/blog/2004/08/09/bsp-programming-event-handling-in-composite-elements
    /people/brian.mckellar/blog/2004/07/28/bsp-programming-handling-htmlb-events
    /people/brian.mckellar/blog/2004/07/28/bsp-programming-writing-composite-elements
    /people/brian.mckellar/blog/2004/07/18/bsp-in-depth-using-the-htmlb-event-system
    /people/brian.mckellar/blog/2003/10/30/bsp-programming-bsp-element-expressions-bees
    /people/sergio.ferrari2/blog/2006/08/28/bsp-in-depth-model-data-binding
    /people/brian.mckellar/blog/2005/04/25/bsp-programming-gen-branchoffset-limit-reached
    /people/thomas.jung3/blog/2005/04/21/webservice-navigator-page-for-abap-and-java
    /people/thomasalexander.ritter/blog/2005/03/16/bsp-how-to-emulate-frames-using-mvc
    /people/thomasalexander.ritter/blog/2005/03/07/bsp-stateless-modelbinding--proof-of-concept
    /people/sebastian.kamp/blog/2004/10/20/doinit-and-the-initialization-of-controllers-in-mvc
    /people/thomas.jung3/blog/2004/09/24/important-lessons-involving-bsp-model-view-binding-and-a-frozen-burrito
    /people/thomas.jung3/blog/2004/09/02/creating-a-bsp-extension-for-downloading-a-table

  • Data Grid in BSP Application

    Can somebody direct me with an example of displaying data in the form of a grid, and allowing users to update that grid, then saving those changes in a table?

    A great place to start is by looking at the SAP Sample Application SBSPEXT_TABLE. 
    The BSP Extension you want is <htmlb:tableView>, probably the most powerful extension elment there is.  You might search on documentation and weblogs that cover the table view as well as Table View Iterators.  Here are couple of Weblogs that I found right off the bat.
    /people/brian.mckellar/blog/2003/10/30/bsp-programming-bsp-element-expressions-bees
    /people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator
    /people/thomas.jung3/blog/2004/09/15/bsp-150-a-developer146s-journal-part-xi--table-view-iterators
    /people/ulli.hoffmann2/blog/2004/10/28/personalize-my-bsp-tableview

Maybe you are looking for