Dynamic Implicit Structure Creation Question

Hello,
I was curious if it was possible to dynamically create an implicit structure where you might occasionally want to omit some keys from being added to the structure?
I played around with using ternary operators in the structure creation with no luck.
<cfset temp = {
     name = "Dave",
     (1 IS 1 ? "" : Job  =  "Superhero")
  } />
The only way I can see doing this now would be to create the structure and then use StructKeyDelete on the keys I want to remove OR build structures the traditional way and cfif my way around the keys I don't want to add."
Ex: <cfset structKeyDelete(temp,"Job") />
or
<cfset temp = structNew() />
<cfset temp.name = "Dave" />
<cfif 1 NEQ 1>
      <cfset temp.job = "Superhero" />
</cfif>
Does anyone know how to create dynamic keys in a structure while defining it implicitly?
Thanks!

I can think of at least one reason why this fails. If there is just one key-value pair, there will be a comma stranded at the end.
You can of course tinker dynamically with the content of the keys of a struct and their respective values. However, a struct is an object, with set characteristics such as number of key-value pairs. So, it would be difficult to dynamically change the number of key-value pairs 'from within' the struct. Even if what you are trying to do were possible, it would be more complex, and would certainly involve more code, than the ordinary alternative you mention.
In any case, here is a version of your original idea that works:
<cfset temp = (1 IS 2 ? {name="Dave"} : {name="Dave",Job="Superhero"})>
<cfdump var="#temp#">

Similar Messages

  • Regarding creation of dynamic deep structure

    Hi all,
    I have to construct the dynamic deep structure.
    for example,
    With the help of information about address and t_table, i have to create the deep structure on runtime.
    In one case i need to create the deep strcuture with address alone and in another case i need to create the deep structure with address and t_table.
    DATA : begin of address ,
        address type string ,
        end of address.
    data : begin of t_tab  ,
      name(10) type c,
      age type i,
      address like address,
      end of t_tab,
      t_table like Table of t_tab.
    data: BEGIN OF wa_vig,
       details1 like address,
       details2 like t_table,
       END OF wa_vig.
    data: BEGIN OF wa_vig,
       details1 like address,
       END OF wa_vig.
    Please guide me, how should i acheive this with the help of dynamic declarion .
    regards
    Vignesh

    Hi All,
    I will be happy if i can acheive this using RTTS concept.
    Regards
    Vignesh

  • Dynamic Internal Table creation and population

    Hi gurus !
    my issue refers to the slide 10 provided in this slideshow : https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96fe0ae
    My example is gonna sound dumb, but anyway: I want to dynamically select from a table into a dynamically created itab.
    Letu2019s use only EKPO, and only field MENGE.
    For this, I use Classes cl_abap_elemdescr, cl_sql_result_set and the Data Ref for table creation. But while fetching the resultset, program dumps when fields like MENGE, WRBTR are accessed. Obviously their type are not correctly taken into account by my program.
    Here it comes:
    DATA: element_ref             TYPE REF TO cl_abap_elemdescr,
          vl_fieldname               TYPE string,
                 tl_components         TYPE abap_component_tab,
                 sl_components         LIKE LINE OF tl_components_alv,
    linetype_lcl               TYPE REF TO cl_abap_structdescr,
    ty_table_type            TYPE REF TO cl_abap_tabledescr,
    g_resultset             TYPE REF TO cl_sql_result_set
    u2026
    CONCATENATE sg_columns-table_name '-' sg_columns-column_name INTO vl_fieldname.
    * sg_columns-table_name contains 'EKPO'
    * sg_columns-column_name contains 'MENGE'
    * getting the element as a component
    element_ref ?= cl_abap_elemdescr=>describe_by_name( vl_fieldname ).
    sl_components-name  = sg_columns-column_name.
    sl_components-type ?= element_ref.
    APPEND sl_components TO tl_components.
    * dynamic creation of internal table
    linetype_lcl = cl_abap_structdescr=>create( tl_components ).
    ty_table_type = cl_abap_tabledescr=>create(
                      p_line_type = linetype_lcl ).
    u2026
    * Then I will create my field symbol table and line. Code has been cut here.
    CREATE DATA dy_line LIKE LINE OF <dyn_table>.
    u2026
    * Then I will execute my query. Here itu2019s: Select MENGE From EKPO Where Rownum = 1.
      g_resultset = g_stmt_ref->execute_query( stmt_str ).
    * Then structure for the Resultset is set
      CALL METHOD g_resultset->set_param_struct
        EXPORTING
          struct_ref = dy_line.
    * Fetching the lines of the resultset  => Dumpu2026
      WHILE g_resultset->next( ) > 0.
        ASSIGN dy_line->* TO <dyn_wa>.
        APPEND <dyn_wa> TO <dyn_table>.
      ENDWHILE.
    Anyone has any clue to how prevent my Dump ??
    The component for MENGE seems to be described as a P7 with 2 decimals. And the resultset wanna use a QUAN type... or something like that !

    Hello
    I have expanded your sample coding for selecting three fields out of EKPO:
    *& Report  ZUS_SDN_SQL_RESULT_SET
    *& Thread: Dynamic Internal Table creation and population
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1375510"></a>
    *& NOTE: Coding for dynamic structure / itab creation taken from:
    *& Creating Flat and Complex Internal Tables Dynamically using RTTI
    *& https://wiki.sdn.sap.com/wiki/display/Snippets/Creating+Flat+and+
    *& Complex+Internal+Tables+Dynamically+using+RTTI
    REPORT  zus_sdn_sql_result_set.
    TYPE-POOLS: abap.
    DATA:
    go_sql_stmt       TYPE REF TO cl_sql_statement,
    go_resultset      TYPE REF TO cl_sql_result_set,
    gd_sql_clause     TYPE string.
    DATA:
      gd_tabfield      TYPE string,
      go_table         TYPE REF TO cl_salv_table,
      go_sdescr_new    TYPE REF TO cl_abap_structdescr,
      go_tdescr        TYPE REF TO cl_abap_tabledescr,
      gdo_handle       TYPE REF TO data,
      gdo_record       TYPE REF TO data,
      gs_comp          TYPE abap_componentdescr,
      gt_components    TYPE abap_component_tab.
    FIELD-SYMBOLS:
      <gs_record>   TYPE ANY,
      <gt_itab>     TYPE STANDARD TABLE.
    START-OF-SELECTION.
    continued.

  • Performance will go down in case of Dynamic UI element Creation.

    Performance will go down in case of Dynamic UI element Creation

    suryar wrote:
    Performance will go down in case of Dynamic UI element Creation
    hi,
    is this an information or a question?
    Please be more specific so that your queries can be answered quickly
    Regards,
    Sahai.S

  • Organizational structure creation

    [Organizational Structure creation using HRMD_ABA;
    Appologies if you saw this message on Friday, because I did originally post it under the general area. I was hoping that if I re-posted it under this area I might get a few more responses. I have included the one response I  got, plus my reponse, which does contain more detail about how I ran PFAL - program RHALEINI, and re poses the question about what needs to be created in SRM re an organisational structure, prior to doing an initial load using transaction PFAL.
    Many Thanks
    Claire
    I am trying to set up the organizational structure in our SRM 7.0 system using our ECC 6 organizational structure. I have created all the required distribution models for SRM and ECC 6, and have set up the switch settings in SRM. The number range settings have been set to external.
    As per OSS Note 36317, which concentrates on the initial distribution, and I am working through, I have run PFAL in ECC 6 only for object type O. The HRMD_ABA idocs have been successfully transferred to our SRM system, but all are at status 52.
    The message for all the idoc segments is:
    'You tried to create a relationship from object 01O 50000333 to object 01S 50000846. However, object 01S 50000846 does not exist or is not active in the period from 19000101 to 99991231'.
    One thing I haven't done, which might be incorrect, is create an Organizational Plan in SRM. I specifically haven't done this because I am wanting to use external numbering, and therefore thought the organizational plan would get automatically created as part of the initial distribution.
    Does any one have any idea how to resolve my problem?
    Many Thanks
    Claire
    Re: Organizational Structure creation using HRMD_ABA  
    Posted: Aug 21, 2009 6:03 PM    in response to: Claire Crosby-C...           Reply 
    Hello Claire,
    It looks like you are replicating "S". After the "O" replication you should run the "S".
    Please refer to the OSS note 934372 u201CSRM/CRM: HR integration for business partner u2013 new featuresu201D & SAP Note # 550055 EBP/SRM: New integration for business partner as well.
    Hope this is helpful.
    Thanks
    Ashutosh
    Claire Crosby-C...  
    Posts: 45
    Registered: 3/22/04
    Forum Points: 0 
       Re: Organizational Structure creation using HRMD_ABA  
    Posted: Aug 21, 2009 6:53 PM    in response to: ASHUTOSH TRIPATHI     Edit          Reply 
    Hi Ashutosh
    I intend to replicate 'S', as described in the note, but nothing has been created with my initial replication of 'O'. As per the note 363187 you are supposed to distribute type 'O' first before moving on to 'S'. Is there anything really fundamental I have missed that you are supposed to do in SRM either before or after the initial set of idocs for type 'O' are brought in?
    I have also read the other 2 notes you mention.
    Note 363187 stated:
    'Perform the following steps in the sequence given if the target system is a
    mySAP.com system (SEM, CRM, BBP/EBP):
    1. If you want to use the change pointers for later changes, activate
    them at once. During initial transport, you should not maintain the
    data in parallel in HR because the distribution takes the blocking
    mechanism into account, which can cause an incomplete initial
    transport.
    2. All objects of object type O are distributed with program RHALEINI. As
    a transfer mode, the update mode with infotype 1000 selection should
    be used.
    This way you make sure that all objects of object type O are created
    in the target system for existence checks.
    3. As previous step but for object type C.
    4. As previous step but for object type S.
    So far all I have tried to do is up to step 2.
    When running RHALEINI I have entered the following:
    Objects - Object Type = 'O'
    Reporting Period - Today is selected
    Transfer Mode - Insert is selected, with the Update Mode infotype set to 1000
    I did think making a setting under the Update Mode Infotype seemed a little odd, as I was doing an insert, but is this not what point 2 from the OSS Note is telling me to do?
    Any thoughts would be really helpful.
    Am I supposed to create a skeleton Org structure before pulling in the ECC 6 structure when I am using external numbering?
    Thanks
    Claire

    Hi Ashutosh
    I intend to replicate 'S', as described in the note, but nothing has been created with my initial replication of 'O'. As per the note 363187 you are supposed to distribute type 'O' first before moving on to 'S'. Is there anything really fundamental I have missed that you are supposed to do in SRM either before or after the initial set of idocs for type 'O' are brought in?
    I have also read the other 2 notes you mention.
    Note 363187 stated:
    'Perform the following steps in the sequence given if the target system is a
    mySAP.com system (SEM, CRM, BBP/EBP):
    1. If you want to use the change pointers for later changes, activate
    them at once. During initial transport, you should not maintain the
    data in parallel in HR because the distribution takes the blocking
    mechanism into account, which can cause an incomplete initial
    transport.
    2. All objects of object type O are distributed with program RHALEINI. As
    a transfer mode, the update mode with infotype 1000 selection should
    be used.
    This way you make sure that all objects of object type O are created
    in the target system for existence checks.
    3. As previous step but for object type C.
    4. As previous step but for object type S.
    So far all I have tried to do is up to step 2.
    When running RHALEINI I have entered the following:
    Objects - Object Type = 'O'
    Reporting Period - Today is selected
    Transfer Mode - Insert is selected, with the Update Mode infotype set to 1000
    I did think making a setting under the Update Mode Infotype seemed a little odd, as I was doing an insert, but is this not what point 2 from the OSS Note is telling me to do?
    Any thoughts would be really helpful.
    Am I supposed to create a skeleton Org structure before pulling in the ECC 6 structure when I am using external numbering?
    Thanks
    Claire

  • Dynamic Connection Pool Creation Failing in a cluster

    Hi,
    I am trying to create a connection pool in a clustered environment. This connection
    pool is created lazily behind a Stateless Session Bean. We first attempt to determine
    whether, the connection pool exists using JdbcServices.poolExists(someName), and
    create it if it does not exist. A failure occurs on creation because it looks
    like the connection pool might have been created by a bean on a different weblogic
    VM instance. Is there any way to dynamically create a connection pool and make
    it visible to the whole cluster? Thanks in advance for any help. Michael Dolbear
    Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Checking existence of connection pool
    Content
    ConnectionPool requested by user guest>
    <Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Creating connection pool ContentConnectionPoo
    l requested by user guest>
    weblogic.common.ResourceException: weblogic.management.MBeanCreationException:
    Start server side stack trace:
    javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=JD
    BCConnectionPool
    at com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:134)
    at com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.java:
    2352)
    at com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:874)
    at weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBeanSer
    verImpl.java:181)
    at weblogic.management.internal.Helper.createMBean(Helper.java:376)
    at weblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
    at weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(RemoteMBean
    ServerImpl.java:278)
    at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
    635)
    at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
    621)
    at weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBeanHome
    Impl.java:397)
    at weblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
    Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    --------------- nested within: ------------------
    weblogic.management.MBeanCreationException: - with nested exception:
    [javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=J
    DBCConnectionPool]
    at weblogic.management.internal.Helper.createMBean(Helper.java:383)
    at weblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
    at weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(RemoteMBean
    ServerImpl.java:278)
    at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
    635)
    at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
    621)
    at weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBeanHome
    Impl.java:397)
    at weblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
    Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    End server side stack trace
    - with nested exception:
    [javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=J
    DBCConnectionPool
    Start server side stack trace:
    javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=JD
    BCConnectionPool
            at com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:134)
            at com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.java:
    2352)
            at com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:874)
            at weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBeanSer
    verImpl.java:181)
            at weblogic.management.internal.Helper.createMBean(Helper.java:376)
            at weblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
            at weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(RemoteMBean
    ServerImpl.java:278)
            at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
    635)
            at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
    621)
            at weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBeanHome
    Impl.java:397)
            at weblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
    Source)
            at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
            at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
            at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    End  server side stack trace
    at weblogic.jdbc.common.internal.ConnectionPool.dynaStartup(ConnectionPool.java:47
    2)
    at weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.java:727
    at weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.java:709
    at com.thc.ids.inf.framework.opf.rdbms.datastore.ConnectionPoolCreator.createConne
    ctionPool(ConnectionPoolCreator.java:82)
    at com.thc.ids.inf.framework.opf.datastore.DataStoreRepository.createConnectionPoo
    lIfNonExistent(DataStoreRepository.java:211)
    at com.thc.ids.inf.util.persistence.content.ConnectionPoolInitializer.createConnec
    tionPoolIfNeeded(ConnectionPoolInitializer.java:48)
    at com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.create
    ConnectionPoolIfNeeded(Unknown Source)
    at com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.getIma
    ge(Unknown Source)
    at com.thc.ids.inf.services.business.crs.ContentRetrievalService.getImage(Unknown
    Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.thc.ids.inf.util.reflection.MethodDescription.invokeMethod(MethodDescriptio
    n.java:181)
    at com.thc.ids.inf.util.reflection.MethodInvocation.invoke(MethodInvocation.java:7
    9)
    at com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean.invoke(ServiceBean.java:
    186)
    at com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl.invoke(Ser
    viceBean_bjedmi_EOImpl.java:37)
    at com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl_WLSkel.inv
    oke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    <Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Checking existence of connection
    pool Content
    ConnectionPool requested by user guest>
    <Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Creating connection pool ContentConnectionPoo
    l requested by user guest>
    weblogic.common.ResourceException: weblogic.management.MBeanCreationException:
    Start server side stack trace:
    javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=JD
    BCConnectionPool
    at com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:134)
    at com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.java:
    2352)
    at com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:874)
    at weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBeanSer
    verImpl.java:181)
    at weblogic.management.internal.Helper.createMBean(Helper.java:376)
    at weblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
    at weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(RemoteMBean
    ServerImpl.java:278)
    at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
    635)
    at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
    621)
    at weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBeanHome
    Impl.java:397)
    at weblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
    Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    --------------- nested within: ------------------
    weblogic.management.MBeanCreationException: - with nested exception:
    [javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=J
    DBCConnectionPool]
    at weblogic.management.internal.Helper.createMBean(Helper.java:383)
    at weblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
    at weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(RemoteMBean
    ServerImpl.java:278)
    at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
    635)
    at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
    621)
    at weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBeanHome
    Impl.java:397)
    at weblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
    Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    End server side stack trace
    - with nested exception:
    [javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=J
    DBCConnectionPool
    Start server side stack trace:
    javax.management.InstanceAlreadyExistsException: domain:Name=ContentConnectionPool,Type=JD
    BCConnectionPool
            at com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:134)
            at com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.java:
    2352)
            at com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:874)
            at weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBeanSer
    verImpl.java:181)
            at weblogic.management.internal.Helper.createMBean(Helper.java:376)
            at weblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
            at weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(RemoteMBean
    ServerImpl.java:278)
            at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
    635)
            at weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.java:
    621)
            at weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBeanHome
    Impl.java:397)
            at weblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
    Source)
            at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
            at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
            at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    End  server side stack trace
    at weblogic.jdbc.common.internal.ConnectionPool.dynaStartup(ConnectionPool.java:47
    2)
    at weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.java:727
    at weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.java:709
    at com.thc.ids.inf.framework.opf.rdbms.datastore.ConnectionPoolCreator.createConne
    ctionPool(ConnectionPoolCreator.java:82)
    at com.thc.ids.inf.framework.opf.datastore.DataStoreRepository.createConnectionPoo
    lIfNonExistent(DataStoreRepository.java:211)
    at com.thc.ids.inf.util.persistence.content.ConnectionPoolInitializer.createConnec
    tionPoolIfNeeded(ConnectionPoolInitializer.java:48)
    at com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.create
    ConnectionPoolIfNeeded(Unknown Source)
    at com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.getIma
    ge(Unknown Source)
    at com.thc.ids.inf.services.business.crs.ContentRetrievalService.getImage(Unknown
    Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.thc.ids.inf.util.reflection.MethodDescription.invokeMethod(MethodDescriptio
    n.java:181)
    at com.thc.ids.inf.util.reflection.MethodInvocation.invoke(MethodInvocation.java:7
    9)
    at com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean.invoke(ServiceBean.java:
    186)
    at com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl.invoke(Ser
    viceBean_bjedmi_EOImpl.java:37)
    at com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl_WLSkel.inv
    oke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

    The only way to do it is using MBeans. You could search this newsgroup
    for "JDBCConnectionPoolMBean" to get an idea of how it could be done.
    Slava
    P.S. http://search.bea.com/weblogic/gonews
    "Mark Mortensen" <[email protected]> wrote in message
    news:[email protected]...
    >
    Slava,
    I am working with Mike on this issue and wanted to add some moreclarifications.
    We have a two server cluster where one of the EJB's on one of the Managedservers
    creates the connection pool. The problem comes in when a request comes tothe
    second server in the cluster. The connection pool is created by the firstserver
    but it is only assigned to the first server in the targets section on theconsole.
    It isn't assigned to the cluster. Is there a way to programmaticallyassign the
    pool to the cluster instead of just the server that created the pool?
    -Mark
    "Michael Dolear" <[email protected]> wrote:
    Hi Slava,
    Here is what I am doing. The code is spread across a couple of classes.
    I am using
    what was described in BEA's doc on dynamic connection pool creation.
    I didn't
    see anything about MBean apis required:
    * Dynamically create a connection pool using
    aConnectionPoolProperties.
    Please
    see ConnectionPoolCreator
    * for the required properties that must be sent in.
    * @param aConnectionPoolProperties
    public synchronized void createConnectionPoolIfNonExistent(Properties
    aConnectionPoolProperties)
    throwsPersistenceFrameworkInitializationException
    ConnectionPoolCreator tempPoolCreator;
    Pool tempPool;
    tempPoolCreator = new ConnectionPoolCreator();
    tempPool =tempPoolCreator.getConnectionPool(aConnectionPoolProperties);
    if (tempPool == null)
    tempPoolCreator.createConnectionPool(aConnectionPoolProperties);
    >>
    * Create Connection pool given the properties that I have beenconfigured
    with
    * @return Pool
    public Pool createConnectionPool(Properties aConnectionProperties)
    throwsPersistenceFrameworkInitializationException
    JdbcServices tempServices;
    try
    tempServices = this.lookupJdbcServices();
    tempServices.createPool(aConnectionProperties);
    returntempServices.getPool(aConnectionProperties.getProperty(CONNECTION_POOL_NAME)
    catch (Exception e)
    PersistenceFrameworkUtils.logException(e);
    throw newPersistenceFrameworkInitializationException(e.getMessage());
    * Answer a connectionPool or null.
    * @return Pool
    public Pool getConnectionPool(Properties aConnectionProperties)
    throwsPersistenceFrameworkInitializationException
    JdbcServices tempServices;
    try
    tempServices = this.lookupJdbcServices();
    if (tempServices.poolExists(
    aConnectionProperties.getProperty(CONNECTION_POOL_NAME)))
    return tempServices.getPool(
    aConnectionProperties.getProperty(CONNECTION_POOL_NAME));
    else
    return null;
    catch (Exception e)
    PersistenceFrameworkUtils.logException(e);
    throw
    newPersistenceFrameworkInitializationException(e.getMessage());
    "Slava Imeshev" <[email protected]> wrote:
    Hi Michael,
    Could you show us the code? Without looking at the code
    I can only say that JdbcServices.poolExists(someName)
    returns true only in case the pool is up and running.
    If the connection pool MBean was created but not assigned
    a target, subsequent tries to create it would fail.
    Regards,
    Slava Imeshev
    "Michael Dolbear" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I am trying to create a connection pool in a clustered environment.This
    connection
    pool is created lazily behind a Stateless Session Bean. We first
    attempt
    to determine
    whether, the connection pool exists usingJdbcServices.poolExists(someName), and
    create it if it does not exist. A failure occurs on creation becauseit
    looks
    like the connection pool might have been created by a bean on a
    different
    weblogic
    VM instance. Is there any way to dynamically create a connection pooland
    make
    it visible to the whole cluster? Thanks in advance for any help.
    Michael
    Dolbear
    Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Checking existence ofconnection pool
    Content
    ConnectionPool requested by user guest>
    <Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Creating connection poolContentConnectionPoo
    l requested by user guest>
    weblogic.common.ResourceException:weblogic.management.MBeanCreationException:
    Start server side stack trace:
    javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=JD
    BCConnectionPool
    at
    com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:1
    34
    at
    com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.
    ja
    va:
    2352)
    at
    com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:
    87
    4)
    at
    weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBe
    an
    Ser
    verImpl.java:181)
    atweblogic.management.internal.Helper.createMBean(Helper.java:376)
    atweblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
    at
    weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(Remote
    MB
    ean
    ServerImpl.java:278)
    at
    weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
    ja
    va:
    635)
    at
    weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
    ja
    va:
    621)
    at
    weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBea
    nH
    ome
    Impl.java:397)
    atweblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
    Source)
    atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
    :2
    2)
    at
    weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    --------------- nested within: ------------------
    weblogic.management.MBeanCreationException: - with nested exception:
    [javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=J
    DBCConnectionPool]
    atweblogic.management.internal.Helper.createMBean(Helper.java:383)
    atweblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
    at
    weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(Remote
    MB
    ean
    ServerImpl.java:278)
    at
    weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
    ja
    va:
    635)
    at
    weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
    ja
    va:
    621)
    at
    weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBea
    nH
    ome
    Impl.java:397)
    atweblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
    Source)
    atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
    :2
    2)
    at
    weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    End server side stack trace
    - with nested exception:
    [javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=J
    DBCConnectionPool
    Start server side stack trace:
    javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=JD
    BCConnectionPool
    at
    com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:1
    34
    at
    com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.
    ja
    va:
    2352)
    at
    com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:
    87
    4)
    at
    weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBe
    an
    Ser
    verImpl.java:181)
    atweblogic.management.internal.Helper.createMBean(Helper.java:376)
    atweblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
    at
    weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(Remote
    MB
    ean
    ServerImpl.java:278)
    at
    weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
    ja
    va:
    635)
    at
    weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
    ja
    va:
    621)
    at
    weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBea
    nH
    ome
    Impl.java:397)
    atweblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
    Source)
    atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
    :2
    2)
    at
    weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    End server side stack trace
    at
    weblogic.jdbc.common.internal.ConnectionPool.dynaStartup(ConnectionPool.ja
    va
    :47
    2)
    at
    weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.jav
    a:
    727
    at
    weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.jav
    a:
    709
    at
    com.thc.ids.inf.framework.opf.rdbms.datastore.ConnectionPoolCreator.create
    Co
    nne
    ctionPool(ConnectionPoolCreator.java:82)
    at
    com.thc.ids.inf.framework.opf.datastore.DataStoreRepository.createConnecti
    on
    Poo
    lIfNonExistent(DataStoreRepository.java:211)
    at
    com.thc.ids.inf.util.persistence.content.ConnectionPoolInitializer.createC
    on
    nec
    tionPoolIfNeeded(ConnectionPoolInitializer.java:48)
    at
    com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.c
    re
    ate
    ConnectionPoolIfNeeded(Unknown Source)
    at
    com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.g
    et
    Ima
    ge(Unknown Source)
    at
    com.thc.ids.inf.services.business.crs.ContentRetrievalService.getImage(Unk
    no
    wn
    Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    com.thc.ids.inf.util.reflection.MethodDescription.invokeMethod(MethodDescr
    ip
    tio
    n.java:181)
    at
    com.thc.ids.inf.util.reflection.MethodInvocation.invoke(MethodInvocation.j
    av
    a:7
    9)
    at
    com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean.invoke(ServiceBean.
    ja
    va:
    186)
    at
    com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl.invok
    e(
    Ser
    viceBean_bjedmi_EOImpl.java:37)
    at
    com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl_WLSke
    l.
    inv
    oke(Unknown Source)
    atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.ja
    va
    :93
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
    :2
    2)
    at
    weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    <Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Checking existence ofconnection
    pool Content
    ConnectionPool requested by user guest>
    <Mar 28, 2002 5:35:08 PM MST> <Info> <JDBC> <Creating connection poolContentConnectionPoo
    l requested by user guest>
    weblogic.common.ResourceException:weblogic.management.MBeanCreationException:
    Start server side stack trace:
    javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=JD
    BCConnectionPool
    at
    com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:1
    34
    at
    com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.
    ja
    va:
    2352)
    at
    com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:
    87
    4)
    at
    weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBe
    an
    Ser
    verImpl.java:181)
    atweblogic.management.internal.Helper.createMBean(Helper.java:376)
    atweblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
    at
    weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(Remote
    MB
    ean
    ServerImpl.java:278)
    at
    weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
    ja
    va:
    635)
    at
    weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
    ja
    va:
    621)
    at
    weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBea
    nH
    ome
    Impl.java:397)
    atweblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
    Source)
    atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
    :2
    2)
    at
    weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    --------------- nested within: ------------------
    weblogic.management.MBeanCreationException: - with nested exception:
    [javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=J
    DBCConnectionPool]
    atweblogic.management.internal.Helper.createMBean(Helper.java:383)
    atweblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
    at
    weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(Remote
    MB
    ean
    ServerImpl.java:278)
    at
    weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
    ja
    va:
    635)
    at
    weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
    ja
    va:
    621)
    at
    weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBea
    nH
    ome
    Impl.java:397)
    atweblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
    Source)
    atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
    :2
    2)
    at
    weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    End server side stack trace
    - with nested exception:
    [javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=J
    DBCConnectionPool
    Start server side stack trace:
    javax.management.InstanceAlreadyExistsException:domain:Name=ContentConnectionPool,Type=JD
    BCConnectionPool
    at
    com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:1
    34
    at
    com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.
    ja
    va:
    2352)
    at
    com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:
    87
    4)
    at
    weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBe
    an
    Ser
    verImpl.java:181)
    atweblogic.management.internal.Helper.createMBean(Helper.java:376)
    atweblogic.management.internal.Helper.createAdminMBean(Helper.java:291)
    at
    weblogic.management.internal.RemoteMBeanServerImpl.createAdminMBean(Remote
    MB
    ean
    ServerImpl.java:278)
    at
    weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
    ja
    va:
    635)
    at
    weblogic.management.internal.MBeanHomeImpl.createAdminMBean(MBeanHomeImpl.
    ja
    va:
    621)
    at
    weblogic.management.internal.AdminMBeanHomeImpl.createAdminMBean(AdminMBea
    nH
    ome
    Impl.java:397)
    atweblogic.management.internal.AdminMBeanHomeImpl_WLSkel.invoke(Unknown
    Source)
    atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
    :2
    2)
    at
    weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    End server side stack trace
    at
    weblogic.jdbc.common.internal.ConnectionPool.dynaStartup(ConnectionPool.ja
    va
    :47
    2)
    at
    weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.jav
    a:
    727
    at
    weblogic.jdbc.common.internal.ConnectionPool.createPool(ConnectionPool.jav
    a:
    709
    at
    com.thc.ids.inf.framework.opf.rdbms.datastore.ConnectionPoolCreator.create
    Co
    nne
    ctionPool(ConnectionPoolCreator.java:82)
    at
    com.thc.ids.inf.framework.opf.datastore.DataStoreRepository.createConnecti
    on
    Poo
    lIfNonExistent(DataStoreRepository.java:211)
    at
    com.thc.ids.inf.util.persistence.content.ConnectionPoolInitializer.createC
    on
    nec
    tionPoolIfNeeded(ConnectionPoolInitializer.java:48)
    at
    com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.c
    re
    ate
    ConnectionPoolIfNeeded(Unknown Source)
    at
    com.thc.ids.inf.services.business.crs.spi.oracle.OracleRetrievalProvider.g
    et
    Ima
    ge(Unknown Source)
    at
    com.thc.ids.inf.services.business.crs.ContentRetrievalService.getImage(Unk
    no
    wn
    Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    com.thc.ids.inf.util.reflection.MethodDescription.invokeMethod(MethodDescr
    ip
    tio
    n.java:181)
    at
    com.thc.ids.inf.util.reflection.MethodInvocation.invoke(MethodInvocation.j
    av
    a:7
    9)
    at
    com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean.invoke(ServiceBean.
    ja
    va:
    186)
    at
    com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl.invok
    e(
    Ser
    viceBean_bjedmi_EOImpl.java:37)
    at
    com.thc.ids.inf.framework.service.J2EE.ejb.ServiceBean_bjedmi_EOImpl_WLSke
    l.
    inv
    oke(Unknown Source)
    atweblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.ja
    va
    :93
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
    :2
    2)
    at
    weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

  • Dynamic navigation structure

    Hi all,
    I want to implement a dynamic navigation structure that displays navigation nodes depending on the status of the user in the backend system.
    The scenario is as follows:
    - user gets access rights via roles and profiles in backend system
    - each user is assigned to a business partner in the backend system
    - each business partner is in a specified phase (the phase of a business partner can change over time)
    - a table in the backend system contains the mapping: phase - visible navigation structure
    -> in the portal the user should see only these navigation nodes, that are set to visible in the mapping table, all other navigation nodes are hidden
    Is it possible to implement such a behaviour?
    I'm running EP 6.0 and CRM 5.0 as backend system.
    Thanks in advance.
    Kind Regards,
    Martina

    Hi Martina,
    Filtering out roles and worksets can be done by implementing a role filter, for details see https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/code-samples/filtering%20role%20and%20workset%20content.htm and https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5021a57d-0601-0010-6097-ec94a09c626d for example.
    > in the portal the user should see only these navigation nodes,
    > that are set to visible in the mapping table, all other navigation nodes are hidden
    Of course, these nodes must be a subset of the navigation nodes the user has per role assignment.
    Hope it helps
    Detlev

  • Unary operators and implicit struct creation

    The increment operator is not working correctly when I am
    attempting to assign an implicit structure to an array element. In
    the first section of the attached code, the variable "x" is never
    incremented when assigning an implicit structure to the array.
    However, in the second section of the attached code, the variable
    "x" increments correctly. The only difference between the two is
    that the first is trying to assign an implicitly created structure
    to an array element, and the second is assigning a scalar value to
    the array element. Is this a known defect and/or is there a way
    around this issue?
    Thanks in advance.
    Jon

    I'm seeing the same thing.
    I've raised it as an issue with the Adobe bods.
    Adam

  • Dynamic structure creation failure for only some structures.

    I have some code to dynamically create a structure and table based on some sap how to... documentation. It works perfectly for a number of structures but fails on the structure I wish to create.
    'l_c_cube_write' in the code is the variable that defines which structure. This code is in BW, if I have an InfoCube YINFOCUBE then the code should create a structure and table based on structure /BIC/VYINFOCUBE2.
    This code works fine when based on structure /BIC/VYINFOCUBEI but fails when based on structure /BIC/VYINFOCUBE2. These structures are generated for each InfoCube created in BW.
    Looking at the two structure definitions in SE11 there are a few differences but it is not clear to me if these differences are causing the error.
    Does anyone know why the error occurs and whether there is a way to avoid it.
    The code is as follows.
    data:
      l_c_cubestruct   type string,
      l_r_cubestrudesc type ref to cl_abap_structdescr,
      l_r_cubedatadesc type ref to cl_abap_tabledescr,
      l_v_cubedatastru type ref to data,
      l_v_cubedatatabl type ref to data,
      l_v_cubecomp     type cl_abap_structdescr=>component_table,
      l_c_comp         type string.
    field-symbols:
      <l_fs_anytabl>  type standard table,
      <l_fs_anystru>  type any.
    no need to dynamically create data object as the program is created dynamically
    concatenate '/BIC/V' l_c_cube_write 'I' into l_c_cubestruct. "this works
      concatenate '/BIC/V' l_c_cube_write '2' into l_c_cubestruct. "this does not
      l_r_cubestrudesc  ?= cl_abap_structdescr=>describe_by_name( l_c_cubestruct ).
      l_v_cubecomp       = l_r_cubestrudesc->get_components( ).
      l_r_cubestrudesc   = cl_abap_structdescr=>create( l_v_cubecomp ).
      l_r_cubedatadesc   = cl_abap_tabledescr=>create( l_r_cubestrudesc ).
      create data l_v_cubedatastru type handle l_r_cubestrudesc.
      create data l_v_cubedatatabl type handle l_r_cubedatadesc.
    create a data object for the datapackage and the dataackage structure
      assign l_v_cubedatastru->* to <l_fs_anystru>.
      assign l_v_cubedatatabl->* to <l_fs_anytabl>.
    Differences between structures:
    The structure that fails also includes components 0INFOPROV and 1ROWCOUNT.
    The structure that fails has components in the format 0MATERIAL, 0CALMONTH, etc. The structure that does not fail has components in the format MATERIAL, CALMONTH, etc.

    I encountered the above problem recently. It is a pain because it means you can't use MOVE-CORRESPONDING.
    It's also not possible to define a structure statically with components beginning with numbers - though it is ok in the data dictionary.
    e.g.
    TYPES: BEGIN OF my_struc,
             0COMPONENT TYPE...
           END OF MY_struc.
    Seems to me to be rather inconsistent!
    matt

  • Dynamic Structure creation and assigning data.

    Hi,
    I have a structure and a work area,
    DATA: begin of sample_struct,
          elem1 type xxx,
          elem2 type yyy,
          elem3 type zzz,
          end of sample_struct.
    DATA: wa_sample_struct type sample_struct.
    DATA: lr_rtti_struc TYPE REF TO cl_abap_structdescr.
    DATA: lt_comp       TYPE cl_abap_structdescr=>component_table.
    DATA: ls_comp       LIKE LINE OF lt_comp.
    DATA: l_index       TYPE string.
    DATA: lr_data       TYPE REF TO data.
    DATA: lr_table      TYPE REF TO
    I create a new structure at run time extending the sample_struct to add few more components at run time like this.
    lr_rtti_struc ?= cl_abap_structdescr=>describe_by_data(wa_sample_struct).
        lt_comp = lr_rtti_struc->get_components( ).
    do 10 times.
          l_index = sy-index
          concatename 'element' l_index into ls_comp-name
          ls_comp-type = cl_abap_elemdescr=>get_string( ).
          APPEND ls_comp TO lt_comp.
    enddo.
    Then i create a work area of this new structure like this.
    lr_rtti_struc = cl_abap_structdescr=>create( p_components = lt_comp ).
        CREATE DATA lr_data TYPE HANDLE lr_rtti_struc.
        ASSIGN lr_data->* TO <fs_data>.
    Now <fs_data> is a work area for the structure.
    I can move the data in wa_sample_struct into <fs_data> like this.
    move-corresponding wa_sample_struct to <fs_data>.
    My problem is how do i access the dynamic components of this work area so that i can assign data to those components.
    If anybody knows how to access the dynamically added components of <fs_data> so that I can assgin data to those.
    Thanks in advance
    Sesh
    Message was edited by: Seshatalpasai Madala

    Hi,
          Looks like the problem is not well stated as I am getting answers which are not relevent.
    My existing structure.
    DATA: begin of sample_struct,
    elem1 type xxx,
    elem2 type yyy,
    elem3 type zzz,
    end of sample_struct.
    I create a new structure using this structure at runtime by adding new fields which are in a internal table. I add the new fields as follows.
    loop at it_tab into wa_tab.
    ls_comp-name = wa_tab.
    ls_comp-type = cl_abap_elemdescr=>get_string( ).
    APPEND ls_comp TO lt_comp.
    endloop.
    This internal table is built using the user input. So I dont know how many and what are the values in the internal table.
    LT_COMP has the existing structure field's as well as the newly added fields for my new structure.
    I create a new structure using this component list LT_COMP.
    DATA: lr_rtti_struc TYPE REF TO cl_abap_structdescr.
    lr_rtti_struc = cl_abap_structdescr=>create( p_components = lt_comp ).
    Now I have an object of cl_abap_structdescr. Which I can use as a data type for defining Workarea and internal table of this structure like this.
    CREATE DATA lr_data TYPE HANDLE lr_rtti_struc.
    ASSIGN lr_data->* TO <fs_data>.
    I can access all the existing fields of the strucutre like this.
    <fs_data>-elem1
    <fs_data>-elem2
    My problem is how do i access the newly added fields of the strucutre as I dont know the names of the fileds(I know them only at runtime).
    I hope I have explained it well enough, hope to see a relevent answer for the above problem.
    Thanks in advance.
    Sesh

  • Dynamic Component Creation Question

    I have a process that looks up fields names from a database. I then loop through and create HtmlInputText components dynamically. The question I have is how do I create a value binding to these components? I have been trying to think of a way to create a separate class that can be applied to each field name I retrieve from the database. But I just can't think of a good solution for this. I assume people have had to do this before.
    Thanks

    Let it bind to a List<String> or Map<String, String>. To get/set elements in a List you can use the brace notation, e.g. #{list[0]} for the 1st element (list.get(0)). For map you can use the key name as propertyname, e.g. #{map.key} for the entry associated with key "key" (map.get("key")).

  • Question on Dynamic Internal Table creation

    Good day everyone.
    I would like to ask if it is possible to just add several fields to an existing internal table to make it dynamic? if possible, does anyone have a sample program? thanks a lot!

    Hi Christian,
    Refer the following code. It may help you.
    Reward points if it helps.
    REPORT ZDSAP .
    DATA: d_ref TYPE REF TO data,
    d_ref2 TYPE REF TO data ,
    i_alv_cat TYPE TABLE OF lvc_s_fcat,
    ls_alv_cat LIKE LINE OF i_alv_cat.
    TYPES tabname LIKE dcobjdef-name .
    parameter: p_tablen type tabname.
    data: begin of itab occurs 0.
    INCLUDE STRUCTURE dntab.
    data: end of itab.
    FIELD-SYMBOLS : <F_FS> TYPE table,
    <F_FS1> TYPE TABLE,
    <F_FS2> TYPE ANY,
    <F_FS3> TYPE TABLE.
    REFRESH itab.
    CALL FUNCTION 'NAMETAB_GET'
    EXPORTING
    langu = sy-langu
    tabname = p_tablen
    TABLES
    nametab = itab
    EXCEPTIONS
    no_texts_found = 1.
    LOOP AT itab .
    ls_alv_cat-fieldname = itab-fieldname.
    ls_alv_cat-ref_table = p_tablen.
    ls_alv_cat-ref_field = itab-fieldname.
    APPEND ls_alv_cat TO i_alv_cat.
    ENDLOOP.
    * internal table build
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING it_fieldcatalog = i_alv_cat
    IMPORTING ep_table = d_ref .
    ASSIGN d_ref->* TO <F_FS>.
    SELECT * FROM (p_tablen) INTO CORRESPONDING FIELDS OF TABLE <F_FS>.
    LOOP AT <F_FS> ASSIGNING <F_FS2>.
    *your code goes here.
    ENDLOOP.

  • Dynamic Table Creation Question

    Can you dynamically add a column to a data table at run time using JSC and JSF? I have a case where I want to add a column to a table based on a selection by the user.

    Hi
    I have been trying to this when I saw your question first time two days back. I tried changing the rowset's query but nothing seems to work. I will try again and I am sure that I can give you something on this if there is any straight solution to this.
    Thanks
    Srinivas

  • Dynamic View Object Creation and Scope Question

    I'm trying to come up with a way to load up an SQL statement into a view object, execute it, process the results, then keep looping, populating the view object with a new statement, etc. I also need to handle any bad SQL statement and just keep going. I'm running into a problem that is split between the way java scopes objects and the available methods of a view object. Here's some psuedo code:
    while (more queries)
    ViewObject myView = am.createViewObjectFromQueryStmt("myView",query); //fails if previous query was bad
    myView.executeQuery();
    Row myRow = myView.first();
    int rc = myView.getRowCount();
    int x = 1;
    myView.first();
    outStr = "";
    int cc = 0;
    while (x <= rc) //get query output
    Object[] result = myRow.getAttributeValues();
    while (cc < result.length)
    outStr = outStr+result[cc].toString();
    cc = cc+1;
    x = x+1;
    myView.remove();
    catch (Exception sql)
    sql.printStackTrace(); myView.remove(); //won't compile, out of scope
    finally
    myView.remove(); //won't compile, out of scope
    //do something with query output
    Basically, if the queries are all perfect, everything works fine, but if a query fails, I can't execute a myView.remove in an exception handler. Nor can I clean it up in a finally block. The only other way I can think of to handle this would be to re-use the same view object and just change the SQL being passed to it, but there's no methods to set the SQL directly on the view object, only at creation time as a method call from the application module.
    Can anyone offer any suggestions as to how to deal with this?

    I figured this out. You can pass a null name to the createViewObjectFromQueryStmt method, which apparently creates a unqiue name for you. I got around my variable scoping issue by re-thinking my loop logic.

  • Dynamic Structure Creation

    Hello Expert,
    My requirement is like i have a selection screen where user can put any database table name and once he execute then all the records whatever stored in the table can download in a .TXT file.
    I am trying this by using field symbol but i stuck in between , i can fetch the data and put into a WA but how can i pass those data to a internal table . For your reference here is my code.
    types:ty_record type string.
    data: my_table type REF TO data.
    data: rt_date type REF TO data.
    data: rt_date1 type REF TO data.
    data: w_record type string.
    data: t_file type TABLE OF ty_record.
    FIELD-SYMBOLS: <WA> type ANY,
                   <WA2> type ANY TABLE,
                   <WA1> type any,
                   <WA3> type any
    selection-screen begin of block b1.
    PARAMETERS:
      s_table(10).
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      CREATE DATA my_table type (s_table) .
      ASSIGN my_table->* to <WA>.
      CREATE DATA rt_date type (s_table).
      ASSIGN rt_date->* to <WA1>.
      SELECT * from (s_table) into <WA>.
        move <WA> to <WA1>.
      ENDSELECT.
    Thanks,
    Satya

    Hello,
    I think this is the way you should proceed:
    DATA: s_table TYPE tabname VALUE 'T001'.
    DATA: lt_tmp TYPE REF TO data.
    FIELD-SYMBOLS: <lt_tmp> TYPE STANDARD TABLE.
    CREATE DATA lt_tmp TYPE STANDARD TABLE OF (s_table).
    ASSIGN lt_tmp->* TO <lt_tmp> .
    SELECT * FROM (s_table) INTO TABLE <lt_tmp>.
    IF sy-subrc = 0.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'C:\Documents and Settings\ssaha\Desktop\dyntab.txt'
        TABLES
          data_tab                = <lt_tmp>
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDIF.
    Now you have data in the dyn table <lt_tmp>.
    BR,
    Suhas

Maybe you are looking for