How to create an attribute

Hi,
I can create xml elements in designer, e.g. John Brinkman's example
  // Add a question datagroup with the right question type
  // then add a question subform to bind against it.
                                                  var vNewQ = xfa.datasets.createNode("dataGroup", "Question");
                                                  vNewType = xfa.datasets.createNode("dataValue", "QuestionType");
                                                  vNewType.value = vQDef.QuestionType.value;
                                                  vNewQ.nodes.append(vNewType);
                                                  vSection.dataNode.nodes.append(vNewQ);
However, I would like to create an attribute (I'm working with an existing predefined schema) but I can't seem to find a simple way, e.g.
I would like something like
<Question QuestionType=""/>
How can I do this? I tried loading the XML in like
                                                  var vNewType          =
                                                                                                      <Question QuestionType="">
                                                                                                      </Question>;
                                                  xfa.data.mForm.loadXML(vNewType.toString(), false, false);
but unless I give it a child node, it bombs out. It will work with
  var vNewType =
    <Question QuestionType="">
       <dummyRow/>
    </Question>;
Any help would be worth 5 gold medals.

Hi,
You need to set the contains property of the dataValue to 'metaData" to turn it into an attribute, but you can only do this once the dataValue has a parent, so your code should look like;
var vNewQ = xfa.datasets.createNode("dataGroup", "Question");
vNewType = xfa.datasets.createNode("dataValue", "QuestionType");
vNewType.value = vQDef.QuestionType.value;
vNewQ.nodes.append(vNewType);
vNewType.contains = "metaData";
vSection.dataNode.nodes.append(vNewQ);
Regards
Bruce

Similar Messages

  • How to create an attribute dimension in Essbase Studio?

    I cannot figure out how to create an attribute dimension using Essbase Studio. The online help states that I need to "Find the Attribute settings grouping in the center" of the member properties dialog box. I suspect that I'm having a problem figuring this out because I don't have the attribute dimension properly defined in the relational data source or in the mini-schema. I've tried creating a table with no key relationship to the other tables and with no logical joins defined, but that doesn't seem to help. Any ideas?

    so in the 11.1.1 version you would click on the member name in the hierarchy you added to the Essbase model and in the center pane of the general tab should be the attributes settings section.
    If I had a dimension called stores wth two groupings unser it region and store_type, I would click on store_type and add the attribute info

  • How to create a attribute for a table

    I am created a table with four columns.
    How to create a attribute for each column.........

    Hi Cranjith Kumar,
    First Create a node for ur table.In that give your table name in the dictionary structure then select option add attributes from the structure that will display the fields there u can select the fields then automatically attributes for ur table will be created in the context.
    Reward points if useful.
    Edited by: srilalitha yerramsetti on Jun 18, 2008 3:23 PM

  • How to create an Attribute set

    Hi Everyone,
    i am learning OAF....right now going through PPR.I was referring the sample tutorials where i came across attribute sets in the PPR Example, which i believe were created as per requirement.So not able to proceed further till i get some clue abt how to create an attribute set as per my requirement.Tried to refer dev guide but not able to grab the concept
    Can anyone tell me where exactly do i need attribute sets(i am only aware that it is used to provide the look n feel to the browser) and how to go abt creating one.
    Thanks
    Amrita

    Thanks for replying
    i'd like u to see the PartialPageExample in sampleLibrary project..There is a function being called in the CO from SampleBrowserAM which is
    public void handleSupplierSelectionEvent()
    OADBTransaction txn = getOADBTransaction();
    String detailTableText = null;
    // Find the selected radio button so we can mark the current row.
    OAViewObject vo = (OAViewObject)findViewObject("SuppliersVO1");
    // Get the first filtered row.
    Row masterRow = vo.getFirstFilteredRow ("SelectFlag", "Y");
    if (masterRow != null)
    vo.setCurrentRow(masterRow);
    String supplierName = (String)masterRow.getAttribute("Name");
    MessageToken[] tokens = { new MessageToken("SUPPLIER_NAME", supplierName)};
    detailTableText =
    txn.getMessage("AK", "FWK_TBX_SITES_FOR_SUPPLIER", tokens); }
    else
    // If there are no selected rows, display a default generic message.
    detailTableText =
    txn.getMessage("AK", "FWK_TBX_SUPPLIER_SITES", null);
    // Now set the text message on the DETAIL_TABLE_TEXT attribute in
    // the application properties VO.
    SampleBrowserPVOImpl appPropsVo = getSampleBrowserPVO1();
    Row appPropsRow = appPropsVo.getCurrentRow();
    if (appPropsRow != null)
    appPropsRow.setAttribute("DetailTableText", detailTableText);
    } // end handleSupplierSelectionEvent()
    i am not able to understand the text in bold in the code above.how do i refer to it, where is it stored, what is it doing , and it is maybe specific to the supplier table coz i cannot use it for my custom table...can u pls explain

  • How to create/add attributes in element list in Screen (example 100)

    HI,
    how to create/add attributes in element list in Screen (example 100)
    I mean after creating screen ..it has "OK CODE " attribute in element list tab in 100 screen.
    I want to create "container" in Element list tab in my screen 100 program
    I want to create new layout " container" in the element tab (i know if i click on layout button where i can create manually)
    Thanks
    Edited by: Raja on Apr 29, 2009 4:19 PM

    Hi Raja,
    Do you remember how you resolved this problem? I am facing the same. Appreciate your response.
    Thanks,
    Shailaja

  • How to create numeric attribute using ABAP API

    Hi experts
    I'm trying to create a numeric attribute for a taxonomy table. In the how-to-examples there are only ways to create text attributes.
    Those who have tried, please let me know the steps.
    I have given below the code snippet which i tried to create numeric attribute. Please let me knw the missing link.
    ls_num_attr_val-rating = 500.
        APPEND ls_num_attr_val TO ls_ext_attr_info-characteristics.
      ls_ext_attr_info-attr_info-attr_id-id = lv_attribute_id.
           APPEND ls_ext_attr_info TO lt_ext_attr_info.
        GET REFERENCE OF lt_ext_attr_info INTO lv_data.
        ls_namevalue-value = lv_data.
        ls_namevalue-code = 'ACCT'.
        APPEND ls_namevalue TO ls_parameter-name_value_pairs.
        lv_string = 'Customer 12'.
        GET REFERENCE OF lv_string INTO lv_data.
        ls_namevalue-value = lv_data.
        ls_namevalue-code = 'CUST_NAME'.
        APPEND ls_namevalue TO ls_parameter-name_value_pairs.
        CALL METHOD lr_api->mo_core_service->create
          EXPORTING
            iv_object_type_code = 'ACCT_TYPE'
            is_parameter        = ls_parameter
            iv_parent_id        = 0
          IMPORTING
            ev_new_internal_id  = lv_key.
    Thanks
    SwarnaDeepika
    Edited by: SwarnaDeepika on Dec 19, 2009 4:38 PM

    Hello Ashok,
    [here|https://help.sap.com/javadocs/MDM/current/com/sap/mdm/examples/CreateField.html] is the Java API of the needed command.
    There is also an example of how to create a field. You can use the class by replacing the strings for the server, repository, table, etc. to your needs.
    If you want to create more than one field, simply use a loop, like the for-loop, while-loop, etc.
    Hope this helps.
    Best regards
    Dominik

  • How to create a Attribute "Type standard table OF" to a OSS NOTE

    Dear experts,
    I need to add new attributes in a standard class as per one OSS note. I took access key to add new attributes. I have a question.
    class name: CL_J_1BEFD
    Attribute: MT_GROUP_C350
    Level: Instance
    Visibility: Private
    Type STANDARD TABLE OF mty_result
    How do i add the instance attribute because i do not want to give the typing and associated type, instead i have to declare data: MT_GROUP_C350 type standard table of mty_result in class builder private section code.
    if you look at the pushbutton between Associated type and Description, for all instance attributes there's a green color lining below the arrow. I want my attribute also to be exactly same.
    Though i have access key, in private section the display<->Change button is disabled.
    Please suggest me how do i add code in private section of a standard class. i have required access key to change the class.
    Thanks,
    Alysson

    Hi Friend...
    Thanks, but the question is...
    When I went to transaction se24 or se80, I chose the class CL_J_1BEFD and second I swap to "CHANGE MODE".. after that the pushbutton is blocked... I can create the Attribute  mt_group_c800 in the Class (using TYPE or LIKE option), but i can't change the code in the private session even using the assistant to modify it.
    When I acess the Button "Detail View" the option "Direct Type Entry" is just unavaliable too, no matter what i do!
    I coudn't find a way to create the Attibute like the note Describes (SAPNOTE NUMBER 1575772 - in the attachment of the note)
    The changes are contained in the attachment
    Follows the instructions retrieved from the file:
    Add the following Attributes on the Class CL_J_1BEFD Private section
    data:
    mt_group_c800 TYPE STANDARD TABLE OF mty_result .
    data:
    mt_group_c850 TYPE STANDARD TABLE OF mty_result .
    data:
    mt_group_c860 TYPE STANDARD TABLE OF mty_result .
    data:
    mt_group_c890 TYPE STANDARD TABLE OF mty_result .
    How can i make a way to creat this attributes using  "TYPE STANDARD TABLE OF " Option?

  • How to create Node, Attributes and Table Dynamically?

    Hi All,
    How to create node and attributes dynamically, and with this node i want to create table dynamically?? Any related code please?
    Thanks
    Venkat.

    HI
    I guess you are asking the same thing in some other post also .
    use the code as mentioned there also.
    data: wd_node_info type ref to if_wd_context_node_info,
    wd_node type ref to if_wd_context_node,
    lr_container type ref to cl_wd_uielement_container,
    lv_tablename type string,
    lt_db_data type ref to data,
    lr_table type ref to cl_wd_table,
    ls_attribute type wdr_context_attribute_info.
    field-symbols: <lt_data> type any table.
    wd_node_info = wd_context->get_node_info( ).
    CALL METHOD WD_NODE_INFO->ADD_NEW_CHILD_NODE
    EXPORTING
    *STATIC_ELEMENT_TYPE = 'ZDEALER'
    NAME = 'NODE'
    IS_MULTIPLE = ABAP_TRUE
    IS_INITIALIZE_LEAD_SELECTION = ABAP_FALSE
    RECEIVING
    CHILD_NODE_INFO = wd_node_info.
    wd_node = wd_context->get_child_node( name = 'NODE' ).
    wd_node_info = WD_node->GET_NODE_INFO( ).
    data dyn_attr_info type wdr_context_attribute_info.
    DYN_ATTR_INFO-NAME = 'X1'. "Attribute Name
    DYN_ATTR_INFO-TYPE_NAME = 'STRING' ." Data Element(CHAR20) ( Type Of Attribute )
    DYN_ATTR_INFO-NODE_INFO = wd_node_info.
    CALL METHOD wd_node_info->ADD_ATTRIBUTE
    EXPORTING
    ATTRIBUTE_INFO = DYN_ATTR_INFO.
    DYN_ATTR_INFO-NAME = 'X2'. "Attribute Name
    DYN_ATTR_INFO-TYPE_NAME = 'STRING' ." Data Element(CHAR20) ( Type Of Attribute )
    DYN_ATTR_INFO-NODE_INFO = wd_node_info.
    CALL METHOD wd_node_info->ADD_ATTRIBUTE
    EXPORTING
    ATTRIBUTE_INFO = DYN_ATTR_INFO.
    lr_container ?= view->get_root_element( ).
    cl_wd_matrix_layout=>new_matrix_layout( container = lr_container ).
    " Creating internal table with the same structure as our dynamic context node
    CALL METHOD CL_WD_table=>new_table
    EXPORTING
    bind_data_source = 'NODE'
    ID = 'TABLE'
    RECEIVING
    control = lr_table.
    cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_table ).
    *lr_table->bind_data_source( path = 'NODE' ).
    data lr_table_col type ref to cl_wd_table_column.
    data lr_table_col1 type ref to cl_wd_table_column.
    data lr_text_view type ref to cl_wd_text_view.
    data lr_input_field type ref to cl_wd_input_field.
    DATA lr_column_name_header TYPE REF TO cl_wd_caption.
    lr_input_field = cl_wd_input_field=>new_input_field(
    bind_value = 'NODE.X1' ID = 'INP' ).
    LR_TABLE_COL = cl_wd_table_column=>new_table_column( id = 'COL1' ).
    lr_table->add_column( the_column = lr_table_col ).
    lr_column_name_header ?= cl_wd_caption=>new_caption( text = 'X1').
    lr_table_col->set_table_cell_editor(
    THE_TABLE_CELL_EDITOR = lr_input_field ).
    lr_table_col->set_header( lr_column_name_header ).
    lr_text_view = cl_wd_text_view=>new_text_view(
    bind_text = 'NODE.X2' ID = 'TXT' ).
    LR_TABLE_COL1 = cl_wd_table_column=>new_table_column( id = 'COL2' ).
    lr_table->add_column( lr_table_col1 ).
    lr_column_name_header ?= cl_wd_caption=>new_caption( text = 'X2').
    lr_table_col1->set_table_cell_editor(
    THE_TABLE_CELL_EDITOR = lr_text_view ).
    lr_table_col1->set_header( lr_column_name_header ).
    lr_container->add_child( lr_table ).
    cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_table ).
    thanks
    sarbjeet singh

  • How to create OID attributes from command line in unix system

    Hi,
    I have to create OID attributes through ldif files in unix system. I dont know how to run it in unix system under which folder. I already have ldif files for creating OID attributes. Please help.

    Hi,
    unser the /your_ODI_HOME/agent/bin folder.
    Excute this
    sh startscen.sh REFRESH_ID 001 GLOBAL 5 -NAME=agent_ODI
    REFRESH_ID=Your Scenario name
    001:Version
    GLOBAL:Context name
    5=Log Level
    agent_ODI=Your agent name
    Regards

  • How to create tagging attributes

    Hello,
    this are two questions in one...
    1. how do I create "empty" attributes like this: <tt>&lt;Element Attribute></tt>?
    2. How do I trigger the creation of the attribute by a value from DB? SQL> WITH my_data AS
      2         (SELECT 'test1' AS element_name
      3               , 0 AS tag_attrib
      4            FROM DUAL
      5          UNION ALL
      6          SELECT 'test2' AS element_name
      7               , 1 AS tag_attrib
      8            FROM DUAL)
      9  SELECT XMLELEMENT( element_name )
    10       , XMLELEMENT( element_name
    11                   , case when tag_attrib = 1 then xmlattributes( 1 as "tag_attrib" ) else null end
    12                    )
    13    FROM my_data;
                     , case when tag_attrib = 1 then xmlattributes( 1 as "tag_attrib" ) else null end
    FEHLER in Zeile 11:
    ORA-00907: missing right parenthesis
    SQL>

    1. how do I create "empty" attributes like this: <tt>&lt;Element Attribute></tt>?That's not valid.
    Did you mean :
    <Elem Attr=""> ?
    2. How do I trigger the creation of the attribute by a value from DB? By moving the CASE statement into XMLAttributes.
    XMLAttributes doesn't generate attribute for NULL values :
    SQL> WITH my_data(element_name, tag_attrib) AS (
      2    SELECT 'test1', 0 FROM DUAL UNION ALL
      3    SELECT 'test2', 1 FROM DUAL
      4  )
      5  SELECT XMLSerialize(content
      6           XMLElement( element_name
      7           , XMLAttributes(
      8               case when tag_attrib = 1
      9                    then tag_attrib
    10               end as "tag_attrib"
    11             )
    12           )
    13           as varchar2(2000)
    14           indent
    15         )
    16  FROM my_data;
    XMLSERIALIZE(CONTENTXMLELEMENT
    <ELEMENT_NAME/>
    <ELEMENT_NAME tag_attrib="1"/>

  • How to create index attributes in CAF Entity Service

    When one creates an entity service with external persistency (local persistency on the persistency tab is unchecked) you have to create at least one "key" attribute. However, how do you create "index" attributes to improve performance. Currently, if you add custom key you must select "key" checkbox in attribute wizard when creating an attribute and this key field must be unique. This is not what I am looking for. I'd like to create a few custom keys that the contents allow duplicate.

    Hi Tom,
    This is a very valuable question. Yes, you can add an index for specific fields to the generated database table. You can do in the NWDS, navigate to the dictionnary view and open the corresponding database table. Now you can add an index and assign database field(s) to this index.
    However: you must be aware that, if the entity is changed (i.e. new parameters are added), the database table is re-generated and the indices are lost.
    Regards,
      Jan

  • How to create custom attributes & object classes through ldif files in OID

    Hi,
    I have to create 4 attributes and one object class(custom) in OID. I want to creae these attributes and object class through LDIF file.
    I tried creating an attribute through this command
    ldapadd -p 389 -h localhost -D cn=orcladmin -w password -f D:/newattr.ldif
    this ldif file contains inf. for creating a new attributes:
    dn: cn=subschemasubentry
    changetype: add
    add: attributetypes
    attributetypes: ( 1.2.3.4.5.6.10 NAME "xsUserType_new" DESC "User Type Definition" EQUALITY caseIgnoreMatch
    SYNTAX "1.3.6.1.4.1.1466.115.121.1.15" )
    I am getting error: Object class violation
    Failed to find add in mandatory or optional attribute list.
    Please help to find where I am going wrong...
    Thanks.

    Hi Ajay,
    Thank you for the help. Now i am able to create both attributes and object classes in OID through Ldif files.
    I was getting constraint violation error because (I think) I was not giving proper naming convection for attributes and object classes. For OID, there are certain Ldap naming conventions. They are as follows:
    # X below is the enterprise number assigned by IANA
    1.3.6.1.4.1.X.1 - assign to SNMP objects
    1.3.6.1.4.1.X.2 - assign to LDAP objects
    1.3.6.1.4.1.X.2.1 - assign to LDAP syntaxes
    1.3.6.1.4.1.X.2.2 - assign to LDAP matchingrules
    1.3.6.1.4.1.X.2.3 - assign to LDAP attributes
    1.3.6.1.4.1.X.2.4 - assign to LDAP objectclasses
    1.3.6.1.4.1.X.2.5 - assign to LDAP supported features
    1.3.6.1.4.1.X.2.9 - assign to LDAP protocol mechanisms
    1.3.6.1.4.1.X.2.10 - assign to LDAP controls
    1.3.6.1.4.1.X.2.11 - assign to LDAP extended operations
    By using these conventions for attributes and object class, I did got any error and they were created in OID.
    Thanks a zillion.
    Kalpana.

  • How to create a attribute to context node with the structure that is in DDIC

    Hi,
    I have created a 3 value attributes while creating a view.
    now i have changed the name of the one of the field in my own database table.
    now the problem is, when i open the webui and try to insert a row. i am getting error like "there is no field with that name(previous name) in collection".
    that is not showing the new name that i have changed. so i deleted the attribute from my view and tried to add the attribute again. and while adding a single attribute it is not taking the ddic structure. and one more problem is, when i open the ui it is showing an error like "  the attribute BaseEntityName is not defined or is still initial  "
    someone help me how to add the one more attribute from the same structure & how to provide BaseEntityName.
    Regards,
    Harry

    Hi Harry,
    If my understanding is correct you have added a attribute with name "ZX" and now you have changed the name of the field to "ZZX" and when you try to add the attribute it gives an error.
    In this case, if you are trying to add a attribute with the same name as you have used before. it will not allow so better to use a new name.
    If the attribute is there and if you are not able to get or set the value of it, Please change the attribute name in the getter and setter methods in the set and get property method call, because by default SAP generates a hard coded text for your attribute name in the methods and if you change the name of the field this will not change.
    Thanks,
    Ashok N.

  • How to create own attributes in the graph.xml of 10g Reports

    Hi,
    Iam using 10g reports. Iam recreating the graphs in 10g which were created in Graphics builder earlier. While doing that I found lot of features are missing in 10g reports charts wizard. It has only limited number of Graph types when compared to the Graphics builder. Like there is no Curve graph in 10g. The available are Line, Bar and Area. So how can I draw a curve instead of line? 10g Legend looks very ugly. There is lot of space between the values. Is there anyway that I can add my own attributes in the graph.xml and register in the reports?
    Please advise.
    Thanks.
    Ram Dontineni.

    Hi Ram,
    how can I draw a curve instead of line?I have posted a Q in BI Beans Forum for you, we should get an answer there:
    Curved Line Graph?
    10g reports charts wizard. It has only limited number of Graph types when compared to the Graphics builderThat may not be exactly true.
    10g Graph Wizard supports 11 major graph types, and 47 sub-types
    While 6i Graphics Builder supported 5 major graph types and 35 graph sub-types
    There are differences between 6i Graphics and 10g Graph Wizard, so certain things you might have been able to do in 6i may not be entirely possible in 10g. However, the main advantages of the 10g Graph option are - it internally uses BI Beans, which is used in ALL Oracle poducts like JDeveloper, Discoverer, Oracle Apps etc. So the customer gets a consistent look-and-feel. And that it is possible to define your Graph in XML format (and through Java API in JDeveloper).
    We have published a list of FAQ's on OTN where you should get answers to at least some of your Q's:
    http://otn.oracle.com/products/reports/index.html (click on Graphing FAQ)
    Is there anyway that I can add my own attributes in the graph.xml and register in the reports?This will not be possible, however, you should take a look at the complete list of elements and their attributes that is exposed in Graph.dtd - you can then choose the attributes you want, and add them to your Report's Graph.xml:
    http://otn.oracle.com/products/reports/htdocs/getstart/whitepapers/graphdtd/graph_dtd_technote_2.html
    Navneet.

  • How to create CMPCTRL attribute of the type internal table (as global list)

    Hi,
    I want to create global internal table to be able to access it across all my webdynpro views.
    Ideally I will create this global internal table in CMPCTRL and will add different values from diffent methods of one view and use in another view as table of values. So I am thinking to use CMPCTRL Attribute declaration to my make internal table as global internal table. How do I achieve this ? Please help
    Thanks
    Praveen

    Thanks Aditya, But I am getting "comp_attr" unknown.
    I am pasting here What I am doing, Please let me know ehere is the error?
    CMPCTRL:
    it_pod     Public clicked, Type Clikced  Assoc Type:Element_<node_name>.
    View access
    DATA lo_nd_<node_name> TYPE REF TO if_wd_context_node.
      DATA lo_el_nd_<node_name> TYPE REF TO if_wd_context_element.
      DATA ls_nd_<node_name> TYPE wd_this->Element_<node_name>.
    data podetails TYPE TABLE OF WD_COMP_CONTROLLER->IT_POD.
    Here it says IT_POD unknown. any issues?
    Thanks
    Praveen

Maybe you are looking for