BSP MVC Tree

Hello,
I'm building a bsp application using MVC design pattern. My home page should have a navigation tree (menu) on the left section and click on each node should fill up related content (views) on the right section. I do not want to navigate to a new page when user clicks on a menu node. Please note that this application will handle data input.
This is typically acheived using frames in html. How can we generate this feature using htmlb elements (goto, tree, controller, view etc). I understand the concept of MVC but if you could provide me some sample codes that would be great.
Your help would be appreciated.
Thanks, Partho
Partho Ghatak
IT (RQT) | Kellogg Company | Off: (630) 956 5756     | Cell: (630) 936 5810 | Fax : (630) 956 5200  | Email: [email protected]

Hi Partho,
Welcome to SDN Forums.
Go through this pdf....
It is very useful...
http://www.sap-hefte.de/download/dateien/691/040_leseprobe.pdf
Go through this link....
It will guide you how to create it...
http://www.sapdevelopment.co.uk/webapps/bsp/bsp_orgunit.htm
Hope it helps.
Regards,
Maheswaran.B
Message was edited by: Maheswaran B

Similar Messages

  • Problem with BSP MVC

    Hi all,
    I had a bsp application which is now running live in the organization. Recently, I got a problem report back from user, which is causing data loss.
    After the support team check the problem and found out the source of the problem. Let me briefly state the problem here. The application is using bsp mvc and it is stateful.
    First, when a user open the application in IE, it is a timesheet entry application, first page will display the time entry of that user for current month. let say the default selected month is September. then if the user wan to compare the entry with previous month, then he will open a new window (ctrl + N) or new tab (ctrl + T), then open the application again. Because of using SSO, the application will not prompt user to login again and will directly lead user to the time entry page. then the user change the month to August for the second new page.
    after the user change the month to august, it will refresh the model that hold the data of the month. means the model now carry August calendar. then the user go back to the first window or the first tab with september time entry, he try to add in new data into that time entry, and save. when it is saved, the september data will go into the August data not go into the September data. this causing data loss in September.
    If I tried this again with not using (ctrl + N) or (ctrl + T) but is open another new IE broswer instance, then it wont give this problem at all. because it create another new model to hold the calendar data. It work fine as long as the user not open two or more windows or tab in a same IE instances.
    Does anyone here meet this problem before or could provide any suggestion to solve this kind of problem? I cant simply changed the application to stateless because it already using worldwide and it will cause a lot of problem. Sorry if my question here was not clear enough.
    Thanks you. (reward point will be given for helpful answer.)

    Is there anyone can understand my problem?
    Thanks you.

  • BSP-MVC download to excel

    Hello experts,
    I know there are many threads on this topic in the forum. I tried using method cl_bsp_utility=>download
    but nothing happens. Here is the scenario -
    1. I have BSP
    2. From Do_handle_event in controller class I am calling model method which handles downloading to excel.
    Please help as this is real showstopper for the application, I am developing.
    Thanks, in advance.
    Trupti

    Hi Gopal,
    Thanks for your reply.
    Tried the code you sent me. As I am using BSP-MVC, I am building method in controller class and with event handling calling the method that handles download to excel. But it is not doing anything at all.
    Thank you.
    Trupti

  • Uploaded text file has a new line added at the top using BSP MVC applicatio

    I have a BSP MVC application that uploads data on to the application server. When I open the uploaded text file, the very first line on the file looks like the line below. ->
    htmlb:button:click:nullhtmlb_form_1UploadUpload0htmlbdfsdf
    But the rest of the file looks okay. This is causing other than .txt files to get corrupted.
    Here is the code from my DO_HANDLE_EVENT.
    data: entity   type ref to if_http_entity,
          name     type string,
          content  type xstring,
          content_type type string,
          idx      type i value 1,
          v_root(26) value '
    houappl131\SRM_Download\',
          v_unxfile(100),
          v_transfer type xstring,
          v_type(6),
          v_len type i,
          v_dirfile type zfileinfo,
          v_ofile(80),
          v_guid type guid_32.
      class cl_htmlb_manager definition load.
      data:        v_asn(10) type n.
      data: fu        type ref to cl_htmlb_fileupload,
                       file_id   type string value 'batchfile'.
      data: o_page_context type ref to if_bsp_page_context.
      data: parent type ref to cl_bsp_controller2,
            lo_model                       type ref to cl_sus_m_asn_detail.
      o_page_context = me->get_page_context( ).
      cl_htmlb_manager=>dispatch_event_ex( request = request
      page_context = o_page_context
      event_handler = me ).
      refresh z_batch->message.
      if htmlb_event->server_event = 'Upload'.
        fu ?= cl_htmlb_manager=>get_data( request = request id = file_id name
                                             = 'fileUpload' ).
        if fu->file_name gt space.
              z_batch->parameters-fpath = fu->file_name.
              v_len = strlen( z_batch->parameters-fpath ).
              if v_len gt 4.
                v_len = v_len - 3.
              endif.
              v_type = z_batch->parameters-fpath+v_len(3).
              search z_batch->parameters-fpath for '.'.
              if sy-fdpos gt 0 and v_len gt 0.
                v_len = v_len - sy-fdpos.
                v_type = z_batch->parameters-fpath+sy-fdpos(v_len).
              endif.
              clear v_asn.
              v_asn = z_batch->parameters-asnhdr.
              concatenate v_asn
                          z_batch->parameters-asnitem
                          z_batch->parameters-batch
                          v_type
                          into v_unxfile separated by '.'.
              concatenate v_root v_unxfile into v_unxfile.
              condense v_unxfile no-gaps.
              open dataset v_unxfile for output in binary mode.
                while idx <= request->num_multiparts( ).
                  entity = request->get_multipart( idx ).
                  name = fu->file_name .
                  if name is not initial.
                    content_type = entity->get_header_field( 'Content-Type' ).
                    clear content.
                    content      = entity->get_data( ).
                    v_transfer = content.
                    transfer content to v_unxfile.
                    append content to z_batch->filetab.
                  endif.
                  idx = idx + 1.
                endwhile.
                close dataset v_unxfile.
            endif.
      endif.
    Here is my fileupload button in the view
    <htmlb:page title="File Upload " >
        <htmlb:form method       = "post"
                    encodingType = "multipart/form-data" >
          <htmlb:label id     = "Batchnum"
                       design = "Label"
                       for    = "Batchnumber"
                       text   = "Batch" />
          <htmlb:inputField id    = "Batchinput"
                            value = "//zbatch/parameters.batch" />
          <htmlb:fileUpload id="batchfile" />
          <htmlb:button id      = "Upload"
                        text    = "Upload"
                        onClick = "Upload" />
          <htmlb:button id      = "Close"
                        text    = "Close window"
                        onClick = "Close" />
    Any of you gurus know why this is happening?

    I solved it myself

  • Reg:bsp(mvc)

    hi to all,
    i had developed a stateful BSP application using MVC .
    in the first view iam entering a material number.
    in the second view iam displaying the records from a table based on material number.again when i make the application to stateless it is displaying the second
    view.with writing a code for a stateless application.i.e server side cookies.
    could any one help me out.
    with regards.
    gangadhar.

    Hi,
    To set data using cookies,
    call method cl_bsp_server_side_cookie=>set_server_cookie
              exporting
                name                  = 'ZF0707'
                application_namespace = str_app_ns
                application_name      = str_app_na
                username              = 'shtml'
                session_id            = str_ses_id
                data_name             = 'EMP_DATA'
                data_value            = itl_delview_tab
                expiry_time_rel       = 7200.
    To get the data using cookies,
    call method cl_bsp_server_side_cookie=>get_server_cookie
        exporting
          name                  = 'ZF0707'
          application_namespace = str_app_ns
          application_name      = str_app_na
          username              = 'shtml'
          session_id            = str_ses_id
          data_name             = 'EMP_DATA'
        changing
          data_value            = itl_delview_tab.
    here itl_delview_tab is an internal table.
    Also go through the below link,
    http://help.sap.com/saphelp_nw04s/helpdata/en/bd/4cd23a09313b37e10000000a11405a/content.htm
    Please close ur earlier thread and award points if u have got the solution,
    Re: REG:BSP(MVC)
    Regards,
    Sachidanand.B

  • Call webdynpro from BSP (MVC)

    Hi, gurus!
    I have simple bsp created using MVC. I have my own component which includes MainWindow with controller class by default and a view with controller class and model class. Everything was created using Wizard.
    I need to call webdynpro app from this BSP in WEB UI. I have a code that get WD url, then I'm trying to use navigation in DO_REQUEST method whih I redefine for a view controller class:
      data: l_wd_url type string.
      call method cl_wd_utilities=>construct_wd_url
        exporting application_name = 'Z_XR_BP_COURCES'
        importing out_absolute_url = l_wd_url .
        navigation->goto_page( l_wd_url ).
    In test mode it's working fine, but when I call this BSP through WEB UI I recieve an error message:
    "Business Server Page (BSP) error
    What happened?
    Calling the BSP page was terminated due to an error."
    Sorry, if my question a little bit stupid =), but i'm new in BSP.
    Could anyone help me?

    Hi,
    Please check in SDN before posting the questions.
    Check with the following link [Webdynpro from BSP (MVC)|Call Webdynpro Application from BSP Application;
    Hope this helps you.
    Regards,
    Rajani

  • How to clear the variables before closing a BSP MVC application

    I am calling a custom stateful BSP MVC application to display additional PO information as a popup window inside SAP BSP. When I close this popup window and open it later on a different PO, it still displays the old PO information. I am clearing the variables in the DO_HANDLE_EVENT. 
    I am using the javascript
    <htmlb:button id      = "Close"
                        text    = "Close window"
                        onClientClick="javascript:window.close()"  />
    to close the window.
    Could someone tell me what do I need to do before closing so that I can clear all the variables.

    Hi Krishana,
    Other neater way could be..
    instead of calling java script.. raise a server event.. in DO_HANDLE_EVENT set a flag <b>lv_close_window</b> to 'X'.
    on the page call the script to close the window if flag <b>lv_close_window</b> is set to 'X'.
    just before setting rhe flag to 'X' you can clear all unnecessary data.
    rememebr: javascript wont take you to DO_HANDLE_EVENT.
    <htmlb:button id = "Close"
    text = "Close window"
    onClick="close_window" />
    i would to this way if i am willing to go to DO_HANDLE_EVENT.
    A.

  • BSP/MVC: Naming of Class Atributes

    Hi there
    developing BSP/MVC applications, I wonder which is a good naming standard for new class attributes of a controller or model class. saw in the examples that most attributes start with "M_" not only the inherited ones but also newly added.
    as far as I remember, attributes starting with "M_" have a special meaning, can't fracking remember which one, though
    So my questions:
    1. what kind of attributes start or shout start with "M_"
    2. what's a useful naming standard for attributes in classes
    thanks in advance
    Gerald

    you just create a constructor method for this class and pass the column definition from your application to this class while instantiating the same .
    sample.
      CALL FUNCTION 'TR_NAMETAB_GET'
        EXPORTING
          iv_tabname                 = 'SFLIGHT'
          iv_get_lengths_in_charmode = ' '
          iv_get_texts               = 'X'
        IMPORTING
          et_dfies                   = lt_dfies
        EXCEPTIONS
          not_found                  = 1
          OTHERS                     = 2.
      IF sy-subrc <> 0.
    *--- Do nothing in this particular case
      ENDIF.
      LOOP AT lt_dfies INTO ls_dfies.
        wa_pers_tab-field_name = ls_dfies-fieldname.
        wa_pers_tab-text       = ls_dfies-reptext.
        wa_pers_tab-colpos     = sy-tabix.
        wa_pers_tab-invisible  = ' ' .
        APPEND wa_pers_tab TO pers_tab.
      ENDLOOP.
    ENDIF .
    SORT pers_tab BY colpos .
    CREATE OBJECT iterator TYPE ycl_tv_iterator
      EXPORTING
        col_def = pers_tab .
    and in the column definition method you can use this to build the columns
    LOOP AT m_col_def INTO wa_col_def  .
        APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
        <def>-columnname = wa_col_def-field_name.
        <def>-title      = wa_col_def-text .
      ENDLOOP .

  • BSP MVC app -- debug issue

    Hello,
    I have an BSP MVC stateless app. It has 4 views: Initial, Start, REsult and Detail. Initial view encompasses the other 3 views. When a value is entered in the Start view and on hitting 'Get results' I want to debugger to stop. I assign an external breakpoint there -- but it still doesn't stop their on the DO_HANDLE_EVENT event. The debugger on other events like DO_INIT stops BUT not on handle event method.
    I do have other app similar to the one above but the type is of stateful and the debugger on the same event works fine.  Please advise on how to make it work in BSP MVC stateless apps on certain events.
    Thank you.
    Kshitij

    Hello,
    Yes I do have dispatch_input() in the DO_REQUEST method of view Initial. But still the debugger doesn't stop at the DO_HANDLE_EVENT method.
    method DO_REQUEST.
    *CALL METHOD SUPER->DO_REQUEST
      data start_view TYPE REF TO if_bsp_page.
      dispatch_input( ).
      start_view = create_view( view_name = 'start.htm' ).
      start_view->set_attribute( name = 'pernr_low' value = me->pernr_low ).
      start_view->set_attribute( name = 'pernr_high' value = me->pernr_high ).
      call_view( start_view ).
    endmethod.
    Thank you.
    Kshitij

  • POP UP IN BSP MVC-NO java script code

    1.when ever I click on one Button in BSP application(MVC) ,One pop up should trigger with Yes or NO options.
    2.If user selects Yes I need to proceed further.
    I can do it through javascript code in page layout,AS I am doing changes in Standard application I do not want to change page layout .
    But I am looking to trigger pop up from abap code ,because I can enhance the class and implement post exit to event handler methods.
    BSP application name: HRRCF_ACT_PROC.
    View Name: List.do
    Event handler : Ondelete ( ).
    Domain: erecruiting
    I can create a new ZBSP apllication and view as yes or no options
    But how to call that new BSP application as POP UP and sned back data to original application

    1/In your BSP application YES /NO use this function identify computer name ***************************
      data: iRFCHOST type RFCHOST,
           oRFCHOST type RFCHOST.
      CALL FUNCTION 'TH_USER_INFO'
        IMPORTING
          TERMINAL = iRFCHOST.
      CALL FUNCTION 'RFC_IP_TO_HOST'
        EXPORTING
          RFCIP                       = IRFCHOST
        IMPORTING
          RFCHOST                     = ORFCHOST
        EXCEPTIONS
          IP_TO_HOST_CONVERSION_ERROR = 1
          OTHERS                      = 2.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    2/Save computer name and decison Yes/No to custom table *************************************
    3/In you BSP aplication use function identify computer name(terminal name) and look to custom table for decision Yes/No
    Note: It will work if user will not work with multiple seesion

  • Regarding instantiation of Iterator Class BSP MVC

    Hi Friends,
    I am trying out the MVC based BSP application using tableview iterator. I read the blog by Brain and went through the forums and tried to implement in MVC pattern.  wrt to Iterator part I did the following things...
    1. I created a ZClass and implemented IF_HTMLB_TABLEVIEW_ITERATOR Interface
    2. I created a variable in Controller Attributes TV_ITERATOR type ref to Zclass (Interface implemented)
    3. In the layout I have used the iterator attribute of Tableview assiging to TV_ITERATOR.
    4. I have defined the method Column_definitions....
    and in Do Handle Event I created a object for iterator "Create object tv_iterator".( i created a separate class for interface and thought would instantiate in Controller Class)
    I am not getting the desired output. Hope I am clear with this....
    I am just a beginer in BSP so sorry if its a silly question...
    Thanks

    Hi Mark,
    Thanks for your reply. I tried that in DO_INIT and in DO_REQUEST as well. I started of this application well with the values selecting from Dropdown and then rendering the table columns. But now I have commented everything and just trying to render one column of the table....
    I have one concern.
    I have declared like this
    tv_iterator type ref to ZITERATOR.
    and in DO_INIT I have instantiated. Create Object tv_iterator.
    If you have any suggestions please let me know....
    Thanks

  • BSP MVC with multiple components approaches

    Hello,
    I have developed in BSP with follows MVC. The BSP application had multiple subcontroller and one main controller. I had one model for each controller,
    but the models were "stored" on the level of the main
    controller.
    Is this the right way? Are there are other approaches?
    Regards & Thanks,
    Guido

    Hi,
    Do you mean to say that u have instantiated the subcontroller models in the main controller using the model data and assigning them to the views in ur subcontroller do_request method?If so it will work however a better approach is to instantiate one main model class (make different method in the model class to access the records from database)in the main controller and use it to assign to the view in the do_request method of the subcontroller.
    Hope this helps.
    Reward useful answers.
    Regards,
    Shrita.

  • Bsp htmlb:tree

    Hi,
    I created a BSP application with dynamic htmlb:tree using TVIEW2. Everything works fine BUT... when I navigate to another page and I return to the page containing the tree-object, my tree is no longer displayed, although the internal table TVIEW2 is properly filled. Anyone experienced this problem also??? Possible solution?

    Layout:
        <myhtmlb:gridLayoutCell columnIndex = "1"
                                rowIndex    = "1" >
          <%-- Overview tree --%>
          <myxhtmlb:overflowContainer height = "495"
                                      width  = "350"
                                      mode   = "SCROLL" >
            <myhtmlb:tree id               = "TREE_PROP"
                          onTreeClick      = "OnInputProcessing"
                          restoreViewState = "TRUE"
                          height           = "495"
                          width            = "350"
                          table2           = "<%= i_tree %>"
                          title            = "Personnel Overview" />
          </myxhtmlb:overflowContainer>
        </myhtmlb:gridLayoutCell>
    internal table i_tree is filled in OnInitialization event. The table is proporly filled.

  • SRMSUS: Need a BSP MVC application example to upload file on to the server

    I need to modify view item_edit.inc in the BSP application SRMSUS to add a fileupload option. Also I need to change the filename before uploading on to a specific location on the server. Does anyone have an example that I can look at. Your help is greatly appreciated.
    Thanks
    Krishna
    [email protected]

    did it myself.

  • Chart in BSP(MVC)

    HI,
    Can any one tell me how to use a chart?
    i want to display chart in my application, where i am getting some values like
    one program 1 has got some averages , so i want to display the averages in the chart,
    pls help
    bhavana

    Hi,
    follow the examples in these BSP applications:
    GRAPH_BSP_TEST
    GRAPH_TUT_CHART
    GRAPH_TUT_JNET

Maybe you are looking for

  • Silent Profile key ( # ) is not working anymore

    Hello, I am using a Nokia 6300. Recently I did a phone software update (to version 5.00), backed all my data up, had afterwards some trouble to get the saved data back on the handset, but it finally worked. Though I still have one small issue. Before

  • Date-Wise KE30 Report

    Dear Experts,         As per my knowledge we can generate the KE30 Report by Period and Year leve. But my client requires to generate the COPA KE30 Report by date-wise. I had checked the all characteristics, I didn't found the Date Charactereistic. H

  • Report (uses LDB's) giving dump due to memory problem

    Hi, I have a report which is giving dump in production due to memory problem. Memory is increased from basis part,but still getting same error. the report uses Logical DataBases. Can anyone suggest solution to solve this problem. regards Mallik

  • My first PKGBUILD - Accentuate 1.0

    Hi everyone, I started to practice some ABS, and i created a simple PKGBUILD to install accentuate (it's a fork of KeyJnote, now unreachable for legal issues), a software to present pdf or png slideshows with interesting (and sometimes hidden) featur

  • Java for Mac OS 10.5 Update 9

    Cannot update Java for Mac OS 10.5 Update 9 - says source media is damaged irrespective whether from Sotware Updater or direct download any advice would be appreciated. thanks