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

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

  • 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 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

  • 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.

  • Reg:bsp error in ICF node

    hi ,
    i had developed a BSP Application in sap 4.7 ,but when i test it iam getting the below error .
    certain ICF nodes must be released in transaction SICF for the BSP Extensions HTMLB
    SAP/BC/BSP/SAP/SYSTEM
    SAP/BC/BSP/SAP/PUBLIC/BC
    SAP/PUBLIC/BSP/SAP/PUBLIC/BC
    could any one help me out regarding this issue.
    Thanks & Regards
    Satish.

    In OSS note <b>517484</b> on https://websmp204.sap-ag.de/notes , and there we can find that for BSP following services should be activated!
    <b>Goto SICF Tcode & activate the below nodes:</b>
    /default_host/sap/bc/bsp/sap
    /default_host/sap/bc/bsp/sap/system
    /default_host/sap/bc/bsp/sap/public/bc
    /def ault_host/sap/public/bc (available for 620 with Support Package 34)
    /default_host/sap/public/bc/ur (available for 620 with Support Package 34)
    /default_host/sap/public/bsp/sap/public
    /default_host/sap/public/bsp/sap/public/bc
    /defaul t_host/sap/public/bsp/sap/system
    /default_host/sap/public/bsp/sap/htmlb (as of Release 620 Support Package SAPKB62026)
    Note: After you activate the BSP service, the corresponding application services must also be activated.
    Raja T
    Message was edited by:
            Raja Thangamani

  • Reg BSP

    hi friends..
    i m working in ECC 6...
    i m interested to BSP..
    is possible to work BSP in ECC 6 ? else we need any other installation ?
    i know in se80 we can create (according doc)..
    but it show error like follow
    Service cannot be reached
    1.The termination occurred in system DEV with error code 403 and for the reason Forbidden.
    2.The selected virtual host was 0 .
    plz gimme some help

    check out this blog for the steps.
    /people/durairaj.athavanraja/blog/2005/08/21/running-your-first-bsp-application-in-sap-netweaver-04-abap-edition--nsp
    search this forum and the BSP blog area where you will find lot of resources.
    Regards
    Raja
    PS: spend sometime to give a proper subject line for your queries.

  • Reg BSP table column title

    Hi All,
    I have problem with BSP table title display for one of the field.
    The current code of
    <%-- -
    Create table for line item----
    --%>
                                                      <htmlb:tableView id    = "tv_eban"
                                                                table = "<%= it_final %>" >
                                                      </htmlb:tableView>
                                                      </htmlb:tabStripItem>
                                                  </htmlb:tabStrip>
    The table field titles are defined and comes by default. From where does the sap table title text is coming. Here can we now update to display the new title for one of the new table field.
    Thanks in advance. Please let me know if you need any further details.
    From
    Reddy.

    Hi Readdy,
    The column title of the BSP application comes from each data-element's field label of your table columns.
    For example, let us assume that internal table contains two columns, say
    col1 type char10
    col2 type char50
    where,
    col1 and col2 are column names of the internal table and
    char10 and char50 are data elements associated with col1 and col2 respectively.
    Now when you display this structure in a table view then by default the title is got from the data element. The field label in the data element is used for this purpose.
    In our example, the char10 field label is blank and char50 filed label is 'c'. So by default the col1 title will be blank and col2 title will be 'c'. (Don't worry i have cross-checked it).
    There are three ways where you could give your own title
    1. Provide a correct data element to the columns with correct field labels.
    2. Change the BSP code by providing the title as given below,
    <%@page language="abap"%>
    <%@extension name="htmlb" prefix="htmlb"%>
    <htmlb:content design="design2003">
      <htmlb:page title = "Table view column defult title text ">
        <htmlb:form>
            <htmlb:tableView id="tv1" table="<%= itab %>">
            <htmlb:tableViewColumns>
            <htmlb:tableViewColumn columnName="col1" title="Column 1"></htmlb:tableViewColumn>
            <htmlb:tableViewColumn columnName="col2" title="Column 2"></htmlb:tableViewColumn>
            </htmlb:tableViewColumns>
            </htmlb:tableView>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    3. To implement a iterator for this table view and change the title. (This has loads of features in order to modify the table view display).
    Hope it helps! Please search in the sdn forums for more intresting ways of using the tableview tag. As suggested by SAP Mentor Graham Robinson, please look into the example BSP application for more information.
    Regards,
    Maheswaran
    Edited by: Maheswaran B on Mar 8, 2010 5:02 PM

Maybe you are looking for

  • How do I get photos out of iphone and in PC

    I have a PC. How in the world do I get my 90 photos out of the iphone and onto my pc without having to email them one at a time to myself. Can someone please help me. I am sure I am overlooking something very simple. Perry

  • Personal hotspot  is not in iOS 8 setting!!!!! Why???

    There is no personal hotspot in setting, in iOS 8

  • How to find Oracle drivers are installed in WAS

    Hi I am doing Proto type application using webdynpro.I want to create tables in Oracle database,because WAS is installed on Oracle.Now i went to Visual Admin tool and checked the "JDBC Connector" properties.I tried to create the new 'DataSource".Whil

  • What is Data Mapping

    HI Experts, Please explain abt: 1) What is Data Mapping 2) Some senarios like, SAP Data map with BW Data 3) Which case Data mapping Error while load occur & how to rectify it. Ponits  awarded. Thanks, RR.

  • Zen Micro problem... What the he

    You'll probably read this and think I'm retarded but... How do you play music on Zen Micro? Seriously... I just bought it, took it out of the box, and checked it out. According to the manual, there are some sample songs on there. The manual also impl