bsp:call doubt

Hello All,
When we call the sub controllers using the bsp element call of the bsp extension i.e. say for example
<bsp:call url = "contorller01.do" comp_id = "subc1" />
from the main view which is called by the top controller, this must be listed in the parameter m_subcontrollers of the top controller; right ?
Or is it a must that we should redefine the DO_INIT of the top controller, and add the following lines
  DATA: subc1 TYPE REF TO z_c_10017_test08_cntrl1.
  subc1 ?= create_controller( controller_name = 'controller01.do'
controller_id   = 'subc1' ).
in aditions to the above.
In the SAP example itmvc2, the DO_INIT method of the controller CL_BSP_ITMVC2_MAIN is not redefined. But the parameter m_subcontrollers of the controller CL_BSP_ITMVC2_MAIN list the sub controllers with ids "ad" and "fl" which was called using <bsp:call> from the main view.
I tried a similar one, but the parameter m_subcontrollers of the top controller does not list the subcontrollers I call using <bsp:call> in the main view, unless and until I redefine the  DO_INIT of the top controller and use the service method create_controller in addition to <bsp:call>.
I hope the question is clear.
Could any one give me some idea on this.
Best Regards,
Loveline.

Hi Sebastian,
This is also what I expected, but this is not happening in my test BSP Application. I have included the code below
Layout of main.htm
<htmlb:content>
  <htmlb:page title="Main view " >
    <htmlb:form id     = "myform"
                method = "post" >
      <htmlb:tray id     = "T1"
                  title  = "View1"
                  design = "form" >
        <bsp:call url     = "controller01.do"
                  comp_id = "subc1" />
      </htmlb:tray>
    </htmlb:form>
  </htmlb:page>
</htmlb:content>
DO_REQUEST of main.do
method DO_REQUEST .
  DATA : view TYPE REF TO if_bsp_page.
  dispatch_input( ).
  view = create_view( view_name = 'main.htm' ).
  call_view( view ).
endmethod.
Layout of view1.htm
<table>
<tr>
<td>
<htmlb:label id   = "L1"
             for  = "IF1"
             text = "Input Field" />
</td>
<td>
<htmlb:inputField id   = "IF1"
                  size = "10" />
</td>
</tr>
<tr>
<td>
<htmlb:button id      = "B1"
              text    = "Click"
              onClick = "myClickHandler" />
</td>
</tr>
</table>
DO_REQUEST of controller01.do
method DO_REQUEST .
  DATA : view TYPE REF TO if_bsp_page.
  view = create_view( view_name = 'view1.htm' ).
  call_view( view ).
endmethod.
m_subcontrollers parameter of main.do (top controller) doesn't contain the subcontroller with id subc1.
Is there anything that I am missing ? and are you sure <bsp:call> will register the subcontroller with the top level controller ?
Thanks and Regards,
Loveline.

Similar Messages

  • How to use "document.getElementById()" using MVC and  bsp:call

    I follow the tutorial from saptechnical .com about F4 in BSP and it works.
    But my problem, is that is not working in my BSP I get javascript error "document.getElementById() is null" the popup appear I select the value but when I press the button to close the popup and pass the value nothing appears.
    I think that is because im Using MVC and Views that call a controller (like view inside views).
    I have in my main.htm this:
    <htmlb:form id     = "search"
                   method = "get" >
            <bsp:call url     = "search.do"
                      comp_id = "search" >
            </bsp:call>
    </htmlb:form>
    The code with the help values is in the search.htm(this the page associated with controller search.do)
    So Im thinking that my problem is because the form isnt in the SAME page than my inputField  and that is why im getting that error.  Can be this true ?
    And if it is,  how can I solve it?, I have several pieces of page with controllers and If I try to put the form tag in each "piece" I get an error that a button was left without a parent form tag, and I there isnt any button tag without form tag. So I think that another element tray, tabstrip or something require form tag also.
    I hope that I could explain my problem and someone can give me a hand.
    Can It be that this js statement
    document.getElementById("i_VKORG_low").value = fval;
    only works only if the form tag is in the same htm page, and cause I have teh form tag declared in the main.htm and the fieldtext i_VKORH_low in search.htm it doesnt works ?
    Thx
    EDIT: I cant post my javascript source code...dont know why I get an error from the forum that the post is not supported

    Hello,
    If I remember well, the MVC framework adds the comp_id of the bsp_call to all elements in the subcontroller.
    Try using:
    document.getElementById("search_i_VKORG_low");
    Regards,
    Tanguy

  • Calling another BSP from a BSP using bsp:call having a Problem.

    Hi All,
    I have a BSP (page1.bsp), within Page1.bsp I am calling another BSP (Page2.bsp)
    But I need to Call Page2.bsp from Page1.bsp 'N' number of times depending upon an internal table, code is mentioned below ( Problem is mentioned after the code ) :
    LOOP AT mr_plan_comparison->mt_selected_plans ASSIGNING <fs_selected_plan>.
         CLEAR lr_plan.
         lr_plan = zcl_zpr_s_model_pool=>load_new_plan( iv_plan_id = <fs_selected_plan>-plan_id ).
         lr_plan->mr_phases = lr_plan->get_phases( ).
         lt_phases_of_a_plan = mr_plan_comparison->mt_selected_phases.
         DELETE lt_phases_of_a_plan WHERE plan_id <> <fs_selected_plan>-plan_id.
         lr_plan->mr_phases->mt_phases = lt_phases_of_a_plan.
         lv_comp_id_str = zcl_zxa_str=>conc( iv_1 = sy-tabix
                                             iv_2 = 'xyz' ).
         CONDENSE lv_comp_id_str NO-GAPS.
      %>
      <tr>
      <td>
    <htmlb:textView text="<b><%= zcl_zrm_s_data_manager=>get_name_from_id( iv_table_name = 'ZPR_PROGRAM'
                                                                         iv_field_name = 'PRG_ID'
                                                                         iv_field_value_id = <fs_selected_plan>-prg_id  ).%></b>" />
         <bsp:call   url     = "<%= zcl_zrm_co=>sc_bsp_rpphachart %>"
                     comp_id = "<%= lv_comp_id_str %>" >
    <%-- same subcontroller n times: use different component IDs --%>
        <bsp:parameter name  = "mr_plan"                  value = "<%= lr_plan %>" />
        <bsp:parameter name  = "mr_plan->MR_PHASES"       value = "<%= lr_plan->mr_phases %>" />
        <bsp:parameter name  = "mv_show_current_version"  value = "<%= abap_true %>" />
        <bsp:parameter name  = "mv_show_version_nr"       value = "<%= SPACE %>" />
    </bsp:call>
    I am able to display the Page1.bsp with no problem having Page2.bsp as well on it,
    But I have a radio button or a dropdown on Page2.bsp and when the event triggers it goes to the DO_HANDLE_EVENT of Page2.bsp whcih is correct but after DO_HANDLE_EVENT it does not go to DO_REQUEST of Page2.bsp and rather goes to Page1.bsp at the LOOP, by this what ever selection I did I am loosing those values.
    What changes should I make so that after Do_HANDLE_EVENT of Page2.bsp it should call it's Do_Request?
    I guess it might be related to the reference or something?
    Regards,
    Abhinav

    Hi Abhinav,
    the flow of nested controllers is as follows:
    contr1->do_request (here dispatch_input triggers data and event handling)
      -->contr1->do_handle_data
      -->contr2_1->do_handle_data
      -->contr2_2->do_handle_data
      -->contr2_3->do_handle_data
    ..... for all controllers in the hierarchy
      -->contrXXX->do_handle_event (the controller instance where the event was triggered)
    contr1->do_request continued
    call view for contr1
      -->contr2_1->do_request
      -->contr2_2->do_request
      -->contr2_3->do_request
    .... for all subcontrollers called by your logic
    the dispatch_input in the subcontroller does not have any effect as within the method it is checked whether the controller is a root controller or not.
    In case you call the subcontroller with the same component ID's than you called them before, the same instances are reused. So if you reuse the instances and set an attribute within the instance that handled the event you should be able to "remember" the values.
    Another option is to write the event back either to the application class or to the parent controller (is available via attribute m_parent) and hand it back over to the controller during the calling loop.
    Hope that helps.
    Best Regards
    Michael

  • BSP call using the application name created in reserved namespace

    Hi,
    Can you please help on the following.
    How to call a bsp applicaion that is  created using reseverd name space(Ex: /eee/*****) by using the bsp call tag.
    Ex: say my application name is /eee/prodlist.If i give the application in the below format it is giving me the error.even I tried giving single / also.
    <bsp:call url="..//eee/prodlist/vhelp.do">

    Hi,
    Go through the sample codes present in the below links,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9d/1ca7f91b76ad4493d62b8ecc7c83db/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/7e/d31c3d8679e94a809d4739433c4e44/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/d7/5a693c114bf147e10000000a11402f/frameset.htm
    Regards,
    Azaz Ali.

  • bsp:call

    Hi!
    Hope someone can help.
    I have two MVC controllers. One main- and one subcontroller. The subcontroller is not in the same bsp application as the main controller.
    At the moment i call the subcontroller from init method with
      obj_mate_navigation ?= create_controller( application_name = 'Y0_TEST_APP1'
                                               controller_name = 'app1.do'
                                               controller_id = 'AP1'
    But i will call the subcontroller from main view. Now my problem is, that the <bsp:call> tag has no application parameter.
    Is it possible to call subcontroller from other bsp applications directly from the main view??
    Regards,
    Anto

    I dont think so you can call subcontroller which belongs to another application using <bsp:call> tag.
    Raja T

  • Uncatchable exception: BSP calling Function Module

    Hi all,
    currently i'm facing a very weird problem. My application class calls function module
    HR_INFOTYPE_OPERATION. Normally, in case of an error, the function module gives you back a return parameter. But if i call it from my BSP, the processing doesn't leave the function module. It directly throws an exception ERROR_MESSAGE_STATE instead of writing the message into parameter return.
    If i call the function module with the same parameters from a report, it works fine and the error message is written to return parameter without throwing an exception.
    What am i doing wrong? I don't want that exception and need to go on with filled parameter result.
    Regards
    Mark-André

    Hi MA,
    try using ERROR_MESSAGE in the exceptions list, like this.
    CALL FUNCTION 'func_name'
         EXPORTING
              string            = text
              pos               = position
         IMPORTING
              string1           = text1
              string2           = text2
         EXCEPTIONS
              string1_too_small = 1
              string2_too_small = 2
              ERROR_MESSAGE     = 3
              OTHERS            = 4.
    Cheers
    Graham Robbo

  • SAP R/3 4.7 BSP call Crystal Report on BOBJ XI 3.1.

    Hi there, I was hoping somebody could give me the high level steps to call a Crystal Report from a BSP (the data source for Crystal is from the R/3 4.7 server) and then have the Crystal Report shown in the BSP session. And, would it possible to have the Crystal Report return somehow as a PDF?
    URL / Web service / Publishing ???????????
    Many Thanks!

    Hi Ingo we're doing the same as this type of code except we using the URL Reporting of BOBJ (viewrpt.cwr) and expecting the CR exported to an xml format and returned to us in string format by http_client->response->get_cdata( ).
    ================================================================================================
    REPORT zvalidate_email.
    PARAMETERS: p_mail(100) LOWER CASE. " E-Mail id to be verified
    DATA: http_client TYPE REF TO if_http_client .
    DATA: w_string TYPE string ,
    w_result TYPE string ,
    r_str TYPE string .
    DATA: result_tab TYPE TABLE OF string.
    START-OF-SELECTION .
    CLEAR w_string .
    CONCATENATE
    'http://www.webservicex.net/ValidateEmail.asmx/IsValidEmail?Email=' p_mail
    INTO
    w_string .
    CALL METHOD cl_http_client=>create_by_url
    EXPORTING
    url = w_string
    IMPORTING
    client = http_client
    EXCEPTIONS
    argument_not_found = 1
    plugin_not_active = 2
    internal_error = 3
    OTHERS = 4.
    CALL METHOD http_client->send
    EXCEPTIONS
    http_communication_failure = 1
    http_invalid_state = 2.
    CALL METHOD http_client->receive
    EXCEPTIONS
    http_communication_failure = 1
    http_invalid_state = 2
    http_processing_failed = 3.
    CLEAR w_result .
    w_result = http_client->response->get_cdata( ).
    REFRESH result_tab .
    SPLIT w_result AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab .
    READ TABLE result_tab INTO r_str INDEX 2.
    IF r_str+44(1) = 't'.
    WRITE:/ 'Valid email address'.
    ELSE.
    WRITE:/ 'Invalid email address'.
    ENDIF.
    ================================================================================================
    Shouldn't it be possible to ask BOBJ XI to return the exported data to us via http_client->response->get_cdata( ).
    I can get the header info.
    Thanks
    Jesse.
    Edited by: JBROOK on Mar 20, 2010 2:45 PM

  • BSP call Function Module

    Dear All,
    in BSP, I want to call a Function Module.
    the question is, how to display the result of Function Module into page layout, if I called a function module in/from Event Handler (onInitialization)
    thanks

    moving on from what Brian said - check the doco,
    but in a nutshell, your function module will have probably export parameters or some results, you need to create some attributes in your BSP and then assign the values of the results from the function module to these attributes and then in the layout of the bsp you can use the <%= Attribute_Name %> syntax to display the value of your attributes whether in a textView or dropdownListBox etc.
    Here's an example:
    assuming your function module has en export parameter UName then you need to create an Attribute in the Attributes section of the BSP which you will assign the value of this export parameter UName to eg,
    fm_UName TYPE STRING parameter to assign FM UName to
    then in the event handler, after you have executed the Function Module assign the export parameter UName value to your local attribute with,
    fm_UName = UName.
    then in your layout, in the right place display the value of your parameter with the syntax,
    <%= fm_UName %>
    That's it.
    Milan.

  • Service call doubt

    Hi friends,
                       I have a small doubt regarding service call in webdynpro-abap. I had a requirement of executing a material change bapi. Firstly I followed the wizard of service call then do the necessary layout building and eventually done with the requirement. But I did the same thing by calling that bapi in a local method of a view. So my doubt is why we need to have service call(calling method of controller) when the same coding i can do in a local method of a view? what is the main significance of Service call in webdynpro-abap?
    Please guide.
    Thanks.
    Gaurav

    Unless and until you add "order by" to a query, you cannot say ANYTHING about the order of the rows returned. Well, short of 'you cannot rely on the order of the rows being returned'.
    It never has, it never did, it never will.
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • BSP call new URL page blank

    Hi,i call from my bsp application a new url with:
    navigation->USE_AUTO_SUBMIT_FORM( TARGET_FRAME = '_blank' ).
             navigation->CALL_APPLICATION( url = url_role ).
    call the new url ok, but my page turn in  blank, i want to see my page, when i call the new url, how i do that?
    thanks
    Angel G.

    Hi,
    why do you need two statements? I thought the following statement should be enough..
    navigation->goto_page( url = 'http://www.sap.com' ).
    Regards,
    Suresh Datti
    P.S. PL post BSP questions in the BSP forum for a better response

  • Call standard SAP transaction in BSP

    Hi guys,
    I am working in WAS 6.20.
    We have separate server for WAS and records fetched from R/3 server.
    Now the requirement is i have to call a standard SAP transaction and the output of the standard transaction should be displayed in the BSP output.
    Is it possible to call a SAP standard transaction in WAS 6.20.
    Is it possible to display the same output in the BSP screen.
    Above to all, displayed output should be refreshed automatically for every 20 minutes.
    I come with lot of doubts, expecting your reply.
    Hopefully waiting for yours reply.
    Saravanan. V

    Hi,
    Pls check threads like
    calling STD SAP transaction in BSP
    Calling R/3 Transaction from BSP
    Calling standard R/3 transaction from BSP
    Calling an SAP transaction from a BSP page
    Calling ITS transaction from BSP
    Can we call standard transaction from bsp
    Eddy
    Pimp up the S(D)N site and earn points. Check this <a href="/people/eddy.declercq/blog/2007/02/01/pimp-up-the-jam log</a> for details

  • Calling a BSP from a website

    Hi
    We have two standard BSP applications on one R/3 system. The R/3 system has been configured for SSO using single sign on using SAP log on Tickets.
    My question is:
    When I call one BSP application from a website, through a link on the website it displays the BSP page whereas when the other BSP application is called from the same website, through a link, it gives an error, "Single Sign On not Activated". What could be the reason for the other BSP page not being displayed?
    Thanks,
    Jayesh

    Please check the system alias you are using in the second BSP call. If you use the same system alias, It should work just fine. If it is different system alias, please check and make sure you have the user mapping set correctly.
    Also make sure to import the certificate.
    Thanks,
    Nagesh O.

  • Calling an MVC controller from a BSP

    Hello,
    I'm trying to call an MVC controller from a BSP (Page with flow logic) using bsp:call / bsp:goto and am also passing a parameter. There are two problems:
    - parameter is not available to the do_init method of the controller class but is available to the do_request method
    - do_init is being called at every event (button click, dropdown etc.)
    I've checked that my BSP application, controller and bsp page are all set to stateful (with lifetime = session where applicable).
    Please suggest what I can do in this case?
    Thanks and regards.
    Rajendra Tewani

    for the precise solution the exceprts :
    in the DO_REQUEST method of the controller class just use
    <variablename> = request->get_form_field( '<url param name>' ).
    suppose the url is init.do?node=ABC to read the value within the controller
    data: nodevar type string .
    nodevar = request->get_form_field( 'node' ).
    with due thanks to raja for this

  • Calling sub controllers in different BSP applications

    I try to call in a controller class a sub controller which belongs to another bsp-application (and another dev package)
    Here the example of the structure:
    (Package) Z_TST1
    --(Controller class) Z_CO_TST1
    --(BSP-Application) Z_TST1_BSP
    (controller) tst1.do ...
    (some additional views, model classes, ...)
    (Package) Z_TST2
    --(Controller class) Z_CO_TST2
    --(BSP-Application) Z_TST2_BSP
    (controller) tst2.do
    Now i want to call the controller tst2.do as sub controller in controller class Z_CO_TST1. help.sap.com says its possible to call controllers of other applications:
    http://help.sap.com/saphelp_erp2004/helpdata/en/21/d8463c9c9ffc3ae10000000a114084/frameset.htm
    In controller class Z_CO_TST1 i will do some code like described in help.sap.com:
    http://help.sap.com/saphelp_nw04/helpdata/en/ce/43473ccf20514ee10000000a114084/frameset.htm
    Thanks for any ideas
    Peter

    I'm sorry, but I solved it by my own (today). Solution is to let application_namespace empty and use application_name for the BSP application name you call in the create_controller method. In the view I only call <bsp:call comp_id = 'name_of_controller_id' />. Help.sap.com has more info, than I thought.
    Thanks for answering - Peter.

  • How to call a controller in a javascript

    Hi,
       I 've lot of doubts listing all of them down.
    My requirement is
    I need to create a master screen for Po and populate some data in dropdownlistbox with database table values and need to validate form and then save in database using MVC.
    I was able to create a BSP and populate it using a model and do validations using javascript .
    Now i need to save it in the databas.
    I will be calling the same controller as i used initially
    to call the BSP
    1.How do i call a controller from my BSP in a javascript?
    I tried by <bsp call url> but it doesnt seem to work.
    2.When does the do_handle_event get triggered
      Is it when i write some events and submit the form.
    3.What is this  Model Data Binding concept?

    Hi Welcome to SDN.
    1. check out this link for call options
    http://help.sap.com/saphelp_erp2005/helpdata/en/8f/3d473ccf20514ee10000000a114084/frameset.htm
    2. check out this link on process flow
    http://help.sap.com/saphelp_erp2005/helpdata/en/22/d59045f4d1174099260b71d5317908/frameset.htm
    3. check out the following weblog on Model Data Binding
    /people/sergio.ferrari2/blog/2006/08/28/bsp-in-depth-model-data-binding
    Regards
    Raja

Maybe you are looking for