Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

MVC-Layout not called


in Do_Init of the main controller I´m creating the subcontrollers

sub_edit ?= create_controller( controller_name = ''
                                 controller_id   = 'editctrl' ).
  subc_user ?= create_controller( controller_name = 'overview/'
                                  controller_id   = 'userctrl' ).

in Do_Request of I call the layout Edit.htm and in this one I call the subcontroller userctrl

<%-- Code Personal Nr. --%>
      <bsp:call comp_id = "userctrl"></bsp:call>

the damned layout never shows up in the application and I don´t know why. This other option does not work:

<bsp:call comp_id = "editctrl_userctrl" />

Can somebody tell me what the problem is ??

Thanks a lot.

Former Member
Former Member replied


Does it have to be the same controller instance for both main and edit controllers? I think you should create two controller instances, one for main and another for edit.

If you need the same instance, you can create it in, then register it as a subcontroller of with if_bsp_dispatcher~register method. Still, this sounds weird to me since you will call twice the same controller within the same htmlb:form tag, which can create field ID conflicts. You will have to be careful if you use this.

Code example, in main controller:

edit_ctrl ?= create_controller( controller_name = '' controller_id = 'edit' ).
user_ctrl ?= create_controller( controller_name = '' controller_id = 'user' ).
edit_ctrl->if_bsp_dispatcher~register( comp_id = 'edit_user' comp_instance = user_ctrl ).

In main.htm:

<bsp:call comp_id = "edit"></bsp:call>
<bsp:call comp_id = "user"></bsp:call>

In edit.htm:

<bsp:call comp_id = "user"></bsp:call>

Hope it helps,


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question