Dynamically embed interface view in window

Hi,
I am reusing the same WD ALV component in different tabs on the same view
of my application. The WD framework does not allow to embed the same interface view of the same component usage more than once on the same view -> error message '... is already embedded in your view...'
So as I don't want to slow down the application and create 5 component usages of the ALV reuse component because of this, I would like to dynamically assign the same
instance interface view to the currently viewed tab. In each tab, there would be a view
container to embed the interface view. I tried calling the method below in both wdDoInit and on the plug handler of the default inbound plug, but no success so far
I implemented the method as far as I understood the saphelp correctly:
http://aiokeh.wdf.sap.corp:1080/SAPIKS2/contentShow.sap?_CLASS=IWB_EXTHLP&TMP_IWB_TASK=DISPLAY&_LOIO=4C60154219FCE12CE10000000A1550B0&_SLOIO=7C3545415EA6F523E10000000A155106&RELEASE=700&LANGUAGE=EN&_SEQNUM=71&_SCLASS=IWB_STRUCT
method EMBED_ALV_VIEW .
  data: L_VIEW_CONTROLLER_API type ref to IF_WD_VIEW_CONTROLLER,
  L_VIEW_CONTROLLER_API = WD_THIS->WD_GET_API( ).
L_VIEW_CONTROLLER_API->PREPARE_DYNAMIC_NAVIGATION(
              source_window_name          = 'RPM_DASHBOARD_WINDOW'  "embedding app window
              source_vusage_name          = 'RPM_DASHBOARD_VIEW_USAGE_1' "own local view containing all those tabs
              source_plug_name            = 'DEFAULT'  " inbound plug for the window above
              target_component_name       = 'SALV_WD_TABLE' "alv reuse component
              target_component_usage      = 'SALV_WD_TABLE' "usage name of this component
              target_view_name            = 'TABLE'  "interface view name of embedded component
              target_plug_name            = 'DEFAULT' "startup plug for this interface view
              target_embedding_position   = 'CNT1' ). "own view container on view.
Thank you for your help!
CHeers, Robert

Hi Robert,
Check out the following:
In the Wiki they have added a feature about inputfields/dropdownboxes.
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdabap/dynamicuseof+Dictionary&
you can also check the weblogs by Thomas:
/people/thomas.szcs/blog/2005/12/28/dynamic-programming-in-web-dynpro-abap--introduction-and-part-i-understanding-ui-elements
/people/thomas.szcs/blog/2006/01/03/dynamic-programming-in-web-dynpro-abap--part-ii-handling-viewelements
/people/thomas.szcs/blog/2006/02/22/dynamic-programming-in-web-dynpro-abap--part-iii-aggregations-and-ddic-binding-of-viewelements
You could use MultiPane or RowRepeater. WDR_TEST_EVENTS contains an example for both.
Hope this will help you.
Cheers,
Darshna.

Similar Messages

  • Dynamically change embedded interface view in window

    I have a Maincomponent M which embedds in its Mainwindow an interface view V_L from a component definition interface cid L. CID L handles the layout with several views and has two at runtime chosen variants (= cid_L-implementating components ) L1 and L2.
    now my wd-application starts e.g. with layout L1 and I want to switch at runtime via a button or an event to L2. how can I achieve this?
    Because M embedds in its window V_L (which can be filled by L1 or L2) I tried to delete the component in the usage of L1 and create the new component for showing L2.
    but this doesn´t work. should I change some navigation links dynamically? because I thought when I create component L2 the interfaceview V_L is filled and I it´s automatically shown in its higher-ranking Mainwindow from M which embedds V_L.

    Hi Thorsten.
    Is your scenarion as follows.
    You define an outbound plug in your main (e.g. 'OUT') at design time.
    Then you start the application and you create a dynmic navigation using OUT
    to L1 and embedd L1 in M this way.
    Then you click a button and create again a dynamic navigation using OUT as outbound to L2 and embedd L2 in M?
    If so you create 2 navigations which will be triggered when you fire OUT.
    You can test this by setting the break point on the fire method. Somehow you will come to a point where you will see a table which stores the navigations and should contain 2.
    I have a table with authorisation which contains all necessary data for the navigation to a corresponding component. I use the authoridation ID as name for the outbound which have to be created dynamically. And I use a Hashtable to store the value. This is of the type CL_C2S_SAPI_HASHTABLE. I create the object as attribute in view controller. Then each time a link is clicked I check whether the hashtable already contains a value for this authorisation. If not I call
    prepare_dynamic_navigation and use the ID as outbound. Afterwards I store it in th hashtable.
    lv_outplug = wd_this->outbound_plugs->getvalue( lv_auth ).
    *   the navigation to the specified auth is performed
    *   for the first time and have to be created.
        if lv_outplug is initial.
          lv_outplug = lv_auth.
          try.
              l_view_controller_api->PREPARE_DYNAMIC_NAVIGATION(
                  source_window_name          = 'W_MAIN'
                  source_vusage_name          = 'V_MAIN_USAGE_1'
                  source_plug_name            = lv_outplug
                  target_component_name       = lv_comp
                  target_component_usage      = 'USED_COMPONENT'
                  target_view_name            = 'W_MAIN'
                  target_plug_name            = lv_plug
                  target_embedding_position   = 'V_MAIN/UI_COMP_CONTAINER' ).
    *         save outbound_plug for later usage.
              wd_this->outbound_plugs->setvalue(
               exporting
                 name = lv_auth
                 value = lv_outplug
            catch cx_wd_runtime_repository into lr_exception.
              data s type string.
              s = lr_exception->get_text( ).
              raise exception type cx_wdr_rt_exception.
          endtry.
        endif.
        l_view_controller_api->fire_plug(
         exporting
           plug_name = lv_outplug
    Hope this helps.
    Cheers,
    Sascha

  • Add Embed Interface View of a Componenet instance

    In a WebDynpro project (not DC), we create two webDynpro components WA, WB.
    WB is is declared as Used Web Dynpro Components in WA. When we want to embed the interface view, in the pop-out window, we can see the Component Instances node with a "+" , but we can not open the node to select. This case can be reproduced on some machine, but in another machine it works properly.
    We use NW 2004 with SP11, any one know how to solve the problem?

    Hi Robert,
    Check out the following:
    In the Wiki they have added a feature about inputfields/dropdownboxes.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdabap/dynamicuseof+Dictionary&
    you can also check the weblogs by Thomas:
    /people/thomas.szcs/blog/2005/12/28/dynamic-programming-in-web-dynpro-abap--introduction-and-part-i-understanding-ui-elements
    /people/thomas.szcs/blog/2006/01/03/dynamic-programming-in-web-dynpro-abap--part-ii-handling-viewelements
    /people/thomas.szcs/blog/2006/02/22/dynamic-programming-in-web-dynpro-abap--part-iii-aggregations-and-ddic-binding-of-viewelements
    You could use MultiPane or RowRepeater. WDR_TEST_EVENTS contains an example for both.
    Hope this will help you.
    Cheers,
    Darshna.

  • Set viewset dynamically as standard view in a window

    Hello collegues,
    I want to Display a certain view ("view 1") in an overview page of another component.
    "View 1" is in "Viewset 1".
    "Window 1" has two viewsets:
    "Viewset 2", marked as Standard.
    "Viewset 1", not marked as Standard.
    "Window 1" is in the component Interface aso.
    When I add "Window 1" to the overview page of my component, then "Viewset 2" is shown, not "Viewset 1".
    How can I set "Viewset 1" dynamically as Standard view in "Window 1" so that "View 1" is shown in my overview page?
    Best regards,
    Thomas

    hi,
    In Overview page IMPL Claz you will find the method " DETACH_STATIC_OVW_VIEWS ".
    redefine that method and use the following piece of code,
    mt_detached_views of type BSP_DLC_OVW_STAT_VIEW_ATTACH_T declare as a Global variable in IMPL claz
      DATA:it_svs TYPE bsp_dlc_ovw_dyn_views_list_t,
           wa_svs TYPE bsp_dlc_ovw_dyn_views_list,
           wa_det TYPE bsp_dlc_ovw_stat_view_attach.
    */ Getting the list of Views of a OV page....
      it_svs = me->get_list_of_static_views( ).
      READ TABLE it_svs INTO wa_svs WITH KEY viewid = 'VIEWSET2'.
      wa_det-viewid = wa_svs-viewid.
      APPEND wa_det TO mt_detached_views.
      CLEAR wa_det.
      rt_viewid = mt_detached_views.
    hope this might be helpful,
    Regard's
    Vam's....

  • Fire outbound plug of interface view controller?

    Hello Experts-
        In my WD project I have two apps A and B.
        I need to navigate from app A to app B.
        In the interface view controller of app A, I have created an outbound plug called GotoB.
        I determine the URL of app B using the WDURLGenerator and store that value in a string.
        In a view of the app A I have the code:
    <code>
    wdThis.wdGetAInterfaceViewController().wdFirePlugGoToB("URLtoB");
    </code>
        For some reason nothing seems to be happening when the event triggers in the view of app A that runs the above code. The view of app A just seems to refresh. The one thing that does happen is that on the refreshed view of app A if I click on the button to trigger this event again I get an 'app A has expired' WAS error.
        What am I missing here? How can I make the navigation from app A to app B work?
    Thank you,
    - Vik.

    Hi,
    well step by step:
    1) Create component Component1 (package="com.sap.sdn", window name = "Component1CW", View name="Conponent1CV")
    2) Create component Component2 (package="com.sap.sdn", window name = "Component2CW", View name="Conponent2CV")
    3) Create application "App1" (package="com.sap.sdn", Web Dynpro component="Component2", the rest - by default)
    4) In Component1CWInterfaceView create outbound plug "GoToComp2"
    5) In Conponent1CV add Component1CWInterfaceView as required controller
    6) In Conponent1CV add button and in action handler put following:
      public void onActionGoToComp2(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionGoToComp2(ServerEvent)
        wdThis.wdGetConponent1CWInterfaceViewController().wdFirePlugGoToComp2();
        //@@end
    7) In component Component2 add Component1 as Used Web Dynpto Component (name="Component1CU")
    8) In Component2CW embed view (Component1CWInterfaceView) as Embed Interface View of a Component Interface, and set this view as default.
    9) In Component2CV add inbound plug "FromComponent1"
    10) In Component2CW link embedded View Component1CU.Conponent1CWInterfaceView.GoToComp2 with Component2CV.FromComponent1
    11) Build-deploy-run. Click on button. It should work.
    Regards, Maxim R.

  • How to create a webdynpro view dynamically and embed into view container?

    Hi all,
    Anyone knows how to create a view dynamically and embed the view into an existing view container?
    My layout looks like this:
    I have an existing view named main_view.
    Inside main_view, I create a view ui container named vcu_view.
    I embed the main_view into my window.
    I need the codes to create a view dynamically and embed the view into the view container. Anyone have any idea?
    Thanks in advance.
    Rgds,
    Siong Chao

    hi Siong Chao   ,,
    empty view insence ..( create a view without any UI element in it  ) in design time ..
    >
    Siong Chao wrote:
    > Hi Chinnaiya,
    >
    > How do you create an empty view dynamically then? Thanks in advance.
    i think we cannot create a new view dynamically because it is a webdynpro restriction ..
    NOTE: experts correct me if i am wrong in this answer
    Regards
    Chinnaiya P

  • Dynamically embed View into View Container UI Element

    Hi all,
    I'm searching for a possibility to embed a view into a dynamically created View container element.
    I want to do this out of another view, where a tabstrip is contained. So I have a button on this view for generation of a new tab with an view container element in it. Now I got to the point where I have to set the view to this container within the tab strip.
    I read several blogs and articles, where this is done via the window manager within an method of the window, but non how to do this within a view.
    Any ideas?
    Thanks
    Olli

    HI,
    that's nit what I wanted. What I want to do is a kind of table maintenance. There is a button under the tabstrip for creating a new row. If the user klicks on that button a new tab should be created for the new row. Therefore the view on the tabs are always the same.
    I have created the tabstrib. dynamically add a tab to this strip on button press is no problem. Also a ViewContainerElement is created. But now I have to set the statically created view for the row maintenance into the container.
    Thanks
    Ragards
    Olli

  • Dynamically embed  View in ViewContainerUIElement

    Hi all,
    Iam trying to create a ViewContainerUI element at runtime and want to add an existing view to the ViewContainer dynamically.
    Please let me know how can I embed a view dynamically in a view container.
    Component Controller :
    //Dynamic view container
    final IWDWindowInfo myWindow = wdComponentAPI.getComponentInfo().findInWindows("DemoWin");
    final IWDViewUsageInfo vuiMain = myWindow.getViewUsageByID("DemoView");
    final IWDViewContainerAssignmentInfo vcaiMainArea = vuiMain.createViewContainerAssignment();
    final IWDViewInfo viMain= (IWDViewInfo)vuiMain.getView();
    final IWDViewContainerInfo vciViewContainer = viMain.createViewContainer();
    /* Transfer the name to view controller to setup UI element */
    wdContext.currentContextElement().setViewId( vciViewContainer.getName() );
    vcaiMainArea.setViewContainer( vciViewContainer );
    In the DemoView :
    IWDViewContainerUIElement theViewContainer = (IWDViewContainerUIElement) view.createElement(IWDViewContainerUIElement.class, fld.getFieldID());
    theViewContainer.createLayoutData(IWDMatrixHeadData.class);
    theViewContainer.setViewContainer(wdContext.currentContextElement().getViewId());
    theGroup.addChild(theViewContainer);
    This is working fine. I am not getting exceptions.
    But a empty container is added to the view. Instead I want to add a existing view into viewcontainer dynamically.
    Please help me......Thanks in advance.

    Try this..........
    //Dynamic view container
    final IWDWindowInfo myWindow  = wdComponentAPI.getComponentInfo().findInWindows("MyWin");
    final IWDViewUsageInfo vuiMain   = myWindow.getViewUsageByID("MainView");
    final IWDViewContainerAssignmentInfo vcaiMainArea = vuiMain.createViewContainerAssignment();
                final IWDViewInfo viMain= (IWDViewInfo)vuiMain.getView();
               final IWDViewContainerInfo vciViewContainer     = viMain.createViewContainer();
               /* Transfer the name to view controller to setup UI element */
                vcaiMainArea.setViewContainer( vciViewContainer );
    //EMbed View dynamically in the View Container //
    final IWDViewUsageInfo vuiInner = vcaiMainArea.createEmbeddedViewUsage();
          final IWDViewUsageInfo   myViewMain   = myWindow.getViewUsageByID("MyView");
          final IWDViewInfo myView= (IWDViewInfo)myViewMain .getView();
          myViewMain.setView( myView);
    /* Mark view usage as default */
    vcaiMainArea.setDefaultViewUsage( vuiInner );
    Let me know if it works.........

  • Dynamically Embed View in ViewContainer

    Hi all,
    Iam trying to create a ViewContainerUI element at runtime and want to add an existing view to the ViewContainer dynamically.
    Please let me know how can I embed a view dynamically in a view container.
    Component Controller :
    //Dynamic view container
    final IWDWindowInfo         myWindow  = wdComponentAPI.getComponentInfo().findInWindows("DemoWin");
    final IWDViewUsageInfo      vuiMain   = myWindow.getViewUsageByID("DemoView");
    final IWDViewContainerAssignmentInfo vcaiMainArea = vuiMain.createViewContainerAssignment();
    final IWDViewInfo viMain= (IWDViewInfo)vuiMain.getView();
    final IWDViewContainerInfo vciViewContainer     = viMain.createViewContainer();
    /* Transfer the name to view controller to setup UI element */
    wdContext.currentContextElement().setViewId( vciViewContainer.getName() );
    vcaiMainArea.setViewContainer( vciViewContainer );
    In the DemoView :
                             IWDViewContainerUIElement theViewContainer = (IWDViewContainerUIElement) view.createElement(IWDViewContainerUIElement.class, fld.getFieldID());
                             theViewContainer.setViewContainer("TableView");
                                       theViewContainer.createLayoutData(IWDMatrixHeadData.class);
                                       theViewContainer.setViewContainer(wdContext.currentContextElement().getViewId());
                                            theGroup.addChild(theViewContainer);
    This is working fine. I am not getting exceptions.
    But a empty container is added to the view. Instead I want to add a existing view into DEMOVIew view container.
    Please help me......Thanks in advance.

    Try this..........
    //Dynamic view container
    final IWDWindowInfo myWindow  = wdComponentAPI.getComponentInfo().findInWindows("MyWin");
    final IWDViewUsageInfo vuiMain   = myWindow.getViewUsageByID("MainView");
    final IWDViewContainerAssignmentInfo vcaiMainArea = vuiMain.createViewContainerAssignment();
                final IWDViewInfo viMain= (IWDViewInfo)vuiMain.getView();
               final IWDViewContainerInfo vciViewContainer     = viMain.createViewContainer();
               /* Transfer the name to view controller to setup UI element */
                vcaiMainArea.setViewContainer( vciViewContainer );
    //EMbed View dynamically in the View Container //
    final IWDViewUsageInfo vuiInner = vcaiMainArea.createEmbeddedViewUsage();
          final IWDViewUsageInfo   myViewMain   = myWindow.getViewUsageByID("MyView");
          final IWDViewInfo myView= (IWDViewInfo)myViewMain .getView();
          myViewMain.setView( myView);
    /* Mark view usage as default */
    vcaiMainArea.setDefaultViewUsage( vuiInner );
    Let me know if it works.........

  • How to embed views dynamically in a view container ?

    Hi ,
        Can you please guide me how to embed a view dynamically in a view container ?
    Thanks & Regards
    Gaurav Jain

    Hello,
    Please read this [/people/rajagopal.vemuri/blog/2006/09/19/web-dynpro-for-abap-creating-dynamic-ui-elements-and-context-step-by-step].
    Regards.

  • C# WINDOWS APP:  EMBED PDF VIEWER WITH FULL LIBRARY

    Here are my requirements:
    1) A PDF viewer that is embedded in a window in my windows app.
    2) I must be able to reference button_click events in the PDF from my windows app. (i.e. if i click a button in the PDF, the event occurs in my windows app.
    Pertaining to the above requirements:
    Here is what I've noticed so far. The Adobe Reader ActiveX works great at simply viewing PDF's and the buttons are shown too. However, I haven't found anything in the Reader library that allows me to reference the buttons in the PDF. This leaves the following questions.
    Possible Solutions: (need your help/recommendations)
    1) Can I use the Acrobat SDK to reference the document that is open inside my Adobe Reader ActiveX control? (If I can, then i can get a hold of my buttons and events). If I can do this, does anyone have any clue about the proper syntax? All of the the samples I've seen actually reference a document that acrobat opens, not the reader....
    2) Can I embed the Adobe Acrobat (not the reader) in my windows app in order to view the files? I haven't seen this done yet. Every example I've seen opens the acrobat in it's own window!!!
    3) Is there other software out there that offers both functionalities: 1) Embedded viewing window with 2) Full access to PDF library?
    Any help in this matter would be greatly appreciated, as I have searched High, Low, and In Between for a solution.
    Thanks,
    jpc

    Patrick Leckey and Walker81,
    So, according to both of you, it is possible.  I have messed around with the buttons a little bit in acrobat enough to know that you can make a button that on click will run a javascript.  The problem is that I do not know any javascript, which is why i was trying to access it only with C#.  However, I am now receptive of the idea of learning at least a little java to get around in adobe (it seems unavoidable).  Any examples or pointers as to how to do this would be greatly appreciated.
    So for clarification:  Is the following statement correct?  If I have an Adobe Reader Active X control which opens the PDF, it is impossible for me to also reference that opened PDF as an acrobat object, thereby getting access to all of it's objects.
    From what I understand:
    -  I can put in the button field of my "template button" to call a certian javascript that is stored in the PDF, and this javascript can send information to my C# windows application.
    - I can embed acrobat (not reader) into my C# application with the MenuItem that Walker81 mentioned. (btw, i'm not concerned about the extra cost.  I really just need something that works)
    This brings about a question though:  If I can embed acrobat in my Windows App, then what keeps me from accessing the button fields through that avenue?  (I think the adobe SDK has an example of fields being accessed - things like text boxes being filled in and junk).  So would it be possible to create a buttonclick_event of all of the buttons in the PDF at runtime through adobe's library by looping through all of the fields and declaring a buttonclick event???  I'll look into it, because being able to access a field and being able to make an event from one can be two different animals I guess...
    Thanks for the responses, and I will look up and mess around with the methods you described and try to make them work from my limited knowledge.  If anyone has any example code they'd like to share to get me started on this, it would be helpful.  I understand there's something called a document level function or something like that in adobe.  I'm assuming you're saying that the button would call this function, and that this function would reference my windows app.  I will look at this some more and try to follow up on here.  I can't imagine that i'm the only person trying to do this..

  • Regarding navigation from Interface View

    Hi All,
    i am trying to pass data from one component to other component via exposing the interface view controller of second component to 1st component via Used Webdynpro Component concept.
    I am able to navigate from one component view to 2nd component view with the action of fireplug from 1st to 2nd. but i am not able to do
    vise versa.
    What i got, after embedding the 2nd view in the 1st component window, inbound plug is created automatically. If in the same view(embedded interface view) i try to place out bound plug i m not able to do. how to get this navigation from 2nd view to 1st view.
    Please help me out.
    Regards,
    Deepak

    Hi deepak,
    I didnt work on it but giving just an idea....
    till now you did....
    i am trying to pass data from one component to other component via exposing the interface view controller of second component to 1st component via Used Webdynpro Component concept.
    I am able to navigate from one component view to 2nd component view with the action of fireplug from 1st to 2nd. but i am not able to do
    vise versa.
    What i got, after embedding the 2nd view in the 1st component window, inbound plug is created automatically. If in the same view(embedded interface view) i try to place out bound plug i m not able to do. how to get this navigation from 2nd view to 1st view.
    now to do vis versa you have to do all this things for other component. I mean expose 2nd component via Used WD component concept. now embed 1st view in 2nd component window. just reverse of what you did till now.
    and take a view set where in first view area show the first navigation, and in the second view area of view set show the second navigation.
    Am I clear?
    PraDeep

  • Issues in persisting dynamic entity and view objects using MDS

    Hi All,
    I'm trying to create dynamic entity and view objects per user session and to persist these objects throughout the session, I'm trying to use MDS configurations(either file or Database) in adf-config.xml.
    I'm facing following two errors while trying to run the app module:
    1. MDS error (MetadataNotFoundException): MDS-00013: no metadata found for metadata object "/model/DynamicEntityGenModuleOperations.xml"
    2. oracle.mds.exception.ReadOnlyStoreException: MDS-01273: The operation on the resource /sessiondef/dynamic/DynamicDeptEntityDef.xml failed because source metadata store mapped to the namespace / DEFAULT is read only.
    I've gone through the following links which talks about the cause of the issue, but still can't figure out the issue in the code or the config file. Please help if, someone has faced a similar issue.
    [http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG |http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG ]
    [http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm|http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm]
    Attached is the code for dynamic entity/view object generation and corresponding adf-config.xml used.
    ///////////App Module Implementation Class/////////////////////////
    public class DynamicEntityGenModuleImpl extends ApplicationModuleImpl implements DynamicEntityGenModule {
    private static final String DYNAMIC_DETP_VO_INSTANCE = "DynamicDeptVO";
    * This is the default constructor (do not remove).
    public DynamicEntityGenModuleImpl() {
    public ViewObjectImpl getDepartmentsView1() {
    return (ViewObjectImpl) findViewObject("DynamicDeptVO");
    public void buildDynamicDeptComp() {
    ViewObject internalDynamicVO = findViewObject(DYNAMIC_DETP_VO_INSTANCE);
    if (internalDynamicVO != null) {
    System.out.println("OK VO exists, return Defn- " + internalDynamicVO.getDefFullName());
    return;
    EntityDefImpl deptEntDef = buildDeptEntitySessionDef();
    ViewDefImpl viewDef = buildDeptViewSessionDef(deptEntDef);
    addViewToPdefApplicationModule(viewDef);
    private EntityDefImpl buildDeptEntitySessionDef() {
    try {
    EntityDefImpl entDef = new EntityDefImpl(oracle.jbo.server.EntityDefImpl.DEF_SCOPE_SESSION, "DynamicDeptEntityDef");
    entDef.setFullName(entDef.getBasePackage() + ".dynamic." + entDef.getName());
    entDef.setName(entDef.getName());
    System.out.println("Application Module Path name: " + getDefFullName());
    System.out.println("EntDef :" + entDef.getFileName() + " : " + entDef.getBasePackage() + ".dynamic." + entDef.getName());
    entDef.setAliasName(entDef.getName());
    entDef.setSource("DEPT");
    entDef.setSourceType("table");
    entDef.addAttribute("ID", "ID", Integer.class, true, false, true);
    entDef.addAttribute("Name", "NAME", String.class, false, false, true);
    entDef.addAttribute("Location", "LOCATION", Integer.class, false, false, true);
    entDef.resolveDefObject();
    entDef.registerSessionDefObject();
    entDef.writeXMLContents();
    entDef.saveXMLContents();
    return entDef;
    } catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    return null;
    private ViewDefImpl buildDeptViewSessionDef(EntityDefImpl entityDef) {
    try {
    ViewDefImpl viewDef = new oracle.jbo.server.ViewDefImpl(oracle.jbo.server.ViewDefImpl.DEF_SCOPE_SESSION, "DynamicDeptViewDef");
    viewDef.setFullName(viewDef.getBasePackage() + ".dynamic." + viewDef.getName());
    System.out.println("ViewDef :" + viewDef.getFileName());
    viewDef.setUseGlueCode(false);
    viewDef.setIterMode(RowIterator.ITER_MODE_LAST_PAGE_FULL);
    viewDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
    viewDef.setSelectClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
    viewDef.setFromClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
    viewDef.addEntityUsage("DynamicDeptUsage", entityDef.getFullName(), false, false);
    viewDef.addAllEntityAttributes("DynamicDeptUsage");
    viewDef.resolveDefObject();
    viewDef.registerSessionDefObject();
    viewDef.writeXMLContents();
    viewDef.saveXMLContents();
    return viewDef;
    } catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    return null;
    private void addViewToPdefApplicationModule(ViewDefImpl viewDef) {
    oracle.jbo.server.PDefApplicationModule pDefAM = oracle.jbo.server.PDefApplicationModule.findDefObject(getDefFullName());
    if (pDefAM == null) {
    pDefAM = new oracle.jbo.server.PDefApplicationModule();
    pDefAM.setFullName(getDefFullName());
    pDefAM.setEditable(true);
    pDefAM.createViewObject(DYNAMIC_DETP_VO_INSTANCE, viewDef.getFullName());
    pDefAM.applyPersonalization(this);
    pDefAM.writeXMLContents();
    pDefAM.saveXMLContents();
    ////////adf-config.xml//////////////////////
    <?xml version="1.0" encoding="windows-1252" ?>
    <adf-config xmlns="http://xmlns.oracle.com/adf/config" xmlns:config="http://xmlns.oracle.com/bc4j/configuration" xmlns:adf="http://xmlns.oracle.com/adf/config/properties"
    xmlns:sec="http://xmlns.oracle.com/adf/security/config">
    <adf-adfm-config xmlns="http://xmlns.oracle.com/adfm/config">
    <defaults useBindVarsForViewCriteriaLiterals="true"/>
    <startup>
    <amconfig-overrides>
    <config:Database jbo.locking.mode="optimistic"/>
    </amconfig-overrides>
    </startup>
    </adf-adfm-config>
    <adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
    <adf-property name="adfAppUID" value="TestDynamicEC-8827"/>
    </adf:adf-properties-child>
    <sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
    <CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore" credentialStoreLocation="../../src/META-INF/jps-config.xml"/>
    </sec:adf-security-child>
    <persistence-config>
    <metadata-namespaces>
    <namespace metadata-store-usage="mdsRepos" path="/sessiondef/"/>
    <namespace path="/model/" metadata-store-usage="mdsRepos"/>
    </metadata-namespaces>
    <metadata-store-usages>
    <metadata-store-usage default-cust-store="true" deploy-target="true" id="mdsRepos">
    <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
    <property name="metadata-path" value="/tmp"/>
    <!-- <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
    <property name="jndi-datasource" value="jdbc/TestDynamicEC"/>
    <property name="repository-name" value="TestDynamicEC"/>
    <property name="jdbc-userid" value="adfmay28"/>
    <property name="jdbc-password" value="adfmay28"/>
    <property name="jdbc-url" value="jdbc:oracle:thin:@localhost:1521:XE"/>-->
    </metadata-store>
    </metadata-store-usage>
    </metadata-store-usages>
    </persistence-config>
    </adf-config>
    //////////////////////////////////////////////////////////////////////////////////////////////////////////

    Hi Frank,
    I m trying to save entity and view object xml by calling writeXMLContents() and saveXMLContents() so that these objects can be retrieved using the xmls later on.
    These methods internally use MDS configuration in adf-config.xml, which is creating the issue.
    Please share your thoughts on resolving this or if, there is any other way of creating dynamic entity/view objects for db tables created at runtime.
    Nik

  • Dynamic embedding of view in used component

    Hi All,
    I have a scenario were i have to provide print functionality to all the views of an existing web dynpro component. This component has around 20 views. I have developed a new component for the print functionality were i am using BSP to fire the CTRL+P function.
    But the problem is how do i get the view at runtime in my print component.....?
    I tried passing the view controller reference to the print component through context binding, but i am unable to embed the view through the reference in to the print component view container element.
    Is there any way i can acheive this....???
    Any help will be appreciated..!
    Regards,
    Runal

    hi Runal ,
    have a look at this video presntation for dynamic embedding of views :
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/5cb731e7-0b01-0010-1792-fbe5f55e39d2
    or
    I wud suggest u to procced like this :
    1 In design time , insert all ur views inside ur tansparent container
    2 * initially set all ur view to invisible* , for this :
    Re: Making UI elements visible at runtime based on events.
    a) make a context attribute of type WDUI_VISIBILITY
    b) bind this attribute wid ur view
    c) set the view to invisible by setting the context attribute to '01' using set_attribute method
       DATA lo_nd_cn_visiblesuper TYPE REF TO if_wd_context_node.
        DATA lo_el_cn_visiblesuper TYPE REF TO if_wd_context_element.
        DATA ls_cn_visiblesuper TYPE wd_this->element_cn_visiblesuper.
        DATA lv_ca_visible LIKE ls_cn_visiblesuper-ca_visible.
    *   navigate from <CONTEXT> to <CN_VISIBLESUPER> via lead selection
        lo_nd_cn_visiblesuper = wd_context->get_child_node( name = wd_this->wdctx_cn_visiblesuper ).
    *   get element via lead selection
        lo_el_cn_visiblesuper = lo_nd_cn_visiblesuper->get_element(  ).
    *   get single attribute
        lo_el_cn_visiblesuper->set_attribute(
          EXPORTING
            name =  `CA_VISIBLE`
            value = '01').
    // context attribute CA_VISIBLE under node cn_visible set to invisible
    3 nw based pn ur condition , whn u wanted to do dynamic embedding , at tht time make ur view visible inside ur appropriate method
    this wud do
    rgds,
    amit

  • Dynamic user interfaces

    Hello,
    here's a little teaser for user interface experts out there:
    I wonder what kind of techniques ABAP offers for creating dynamic user interfaces.
    When talking of 'dynamic' I imagine something like an arbitrary number of 'containers' where other programs (classes f.ex.) can draw their own user interface into.
    In Java this could be realized with the container concept in swing.
    I have done some research on this topic and the results are so far:
    a plain dynpro: seems to have no dynamic at all -> not an option
    a plain dynpro with a tabstrip: in case the number of tabs CAN be set at runtime AND the subscreens CAN be drawn from inside separate classes -> a definite option otherwise not an option
    any kind of web-frontend (BSP, JSP etc.): web-frontends are not allowed by company restrictions -> not an option
    dynamic documents: I could not find many information on these yet (also not on sdn). In case that an arbitrary number of parts of the dynamic document can be created from inside separate classes -> an option otherwise not an option
    I will be happy about any further information on this topic.
    Best regards,
    Patrick Baer

    I spent some time today doing research on BSP's and built a "BSP-Viewer" embedded into the SAP-GUI. Though I like the concept of BSP's a lot (like I did already with JSP's) but company restricitions are too strict. So BSP's are out of the play.
    After the discussion I started to play around with the different containers and basically I'm quite pleased with them and the "cl_gui_container_bar" allows an arbirtary number of "subscreens" which matches my requirements.
    But as usual there's still a downside:
    I found no option to built text labels and text fields into a container. Unless this is possible I can't give this approach a chance. I already found some postings which seemed to confirm that this is in fact not possible but I can't really believe it. At least from what it looks like it seems to me that the object navigator utilizes both: splitters, containers and all the stuff AS WELL AS the "classical" elements like text boxes, labels and so on.
    Any ideas on how to combine the container concept with text fields, labels maybe whole dynpros or subscreens ?
    Best regards,
    Patrick Baer

Maybe you are looking for