How to Add custom Attribute in XML

How to add Custom attribute recusrivly. With sequence order.
//Before xml:-
var myxml:XML=
<root>
<leval0 >
<leval1 >
<leval2></leval2>
<leval2></leval2>
</leval1>
<leval1 >
<leval2></leval2>
<leval2></leval2>
</leval1>
</leval0>
</root>
////After xml:
var myxml:XML=
<root>
<leval0 levalid="0" >
<leval1 levalid="0_0" >
<leval2 levalid="0_0_0"></leval2>
<leval2 levalid="0_0_1"></leval2>
</leval1>
<leval1 levalid="0_1" >
<leval2 levalid="0_1_0"></leval2>
<leval2 levalid="0_1_1"></leval2>
</leval1>
</leval0>
</root>

//call this method
            trace(addAttribute(myxml));
//method
            private function addAttribute(node:XML, depth:String = ""):XML
                if (node.hasComplexContent())
                    var count:int = 0;
                    var prefix:String = 0 < depth.length ? depth + "_" : "";
                    var currentAtt:String;
                    for each (var nodeItem:XML in node.children())
                        currentAtt = prefix + count;
                        nodeItem.@levalid = currentAtt;
                        addAttribute(nodeItem,currentAtt);
                        count++;
                return node;

Similar Messages

  • How to add custom attributes to UME

    hi gurus,
    I have developped an appliation in that I want add custom attributes to UME for the sake of retriving the BrandType.
    Please give me suggestion how to do this.
    Thanks in adance.
    Lohi

    Hi Lohi,
    UME setup
    1)     go to Configuration tool (C:\usr\sap\J2E\JC02\j2ee\configtool\consoleconfig.bat)
    2)     For “Global server configuration->services->com.sap.security.core.ume.service” define property “ume.admin.addattrs” as “BU_PARTNER” and for “ume.admin.self.addattrs” as “<empty>”. (to set value select entry, input value in “Value” field and click “Set”)
    3)     Click “Apply changes” button on the toolbar.
    4)     Restart server.
    5)     Login to http://<server_name>:<server_port>/useradmin/index.jsp and define “BU_PARTNER” property.
    Code:
    try {
         final IWDClientUser wdUser = WDClientUser.getCurrentUser();
         final IUser user = wdUser.getSAPUser();
         final String[] attribute = user.getAttribute(
              "com.sap.security.core.usermanagement",
              "BU_PARTNER");
         if( attribute==null || attribute.length == 0 || !Utils.isNotEmpty(attribute[0]) ) {
              wdComponentAPI.getMessageManager().reportMessage(...);
              return;
         } else {
              buPartner = attribute[0];
    } catch (final WDUMException e) {
         wdComponentAPI.getMessageManager().reportMessage(...);
    Best regards, Maksim Rashchynski.

  • How to add Custom Attributes in the SOAP header for OWSM

    Hi,
    I like to know how to add the Custom Attributes in the SOAP header for OSWM username token authentication.
    Currently we are getting the header element like
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    here we need to add the attribute "soap:mustUnderstand="1" , so the element will look like
    <wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    Any info on this will be helpful.
    Thanks,
    ArunM

    Hi Jay, you can make it in more than 1 way.
    I suggest you the following:
    - create an URL iview that points to any URL you want.
    - define a Resource that points to the iview (with a window name, to open in new window)
    - define an Area that points to the resource
    - add your new Area to the your current Area Group
    Regards!

  • How to Add custome attribute value of user id

    Hi my friend.
    from below cmd i can able to view the current attribute value. but i wanted to modify the value. so can you please provide dsmod cmd for modify
    dsquery * domainroot -filter "&(objectCategory=person)(objectClass=user)(sAMAccountName=username)" -attr extensionattribute2
    Dsmod ...................?
    James
    8892722073

    Hi James,
    As you said, the command Dsmod user can be used to modify attributes of one or more existing users in the directory. However, this command could not be used to modify the custom attribute, its syntax has been set.
    You can use builted in Active Directory Attribute Editor to modify a user's attribute:
    Open Active Directory Users and Computers.
    Locate the User container, and then find the user which you want to modify.
    Right-click the user, click Properties, and then click the tab
    Attribute Editor.
    Slect the attribute which you want to modify, click Edit, modify the value, and then
    click OK to save the change.
    For your information, please refer to the following figure:
    What's more, please refer to the following article to learn to use the PowerShell AD Provider to Modify User Attributes
    Use the PowerShell AD Provider to Modify User Attributes
    http://blogs.technet.com/b/heyscriptingguy/archive/2013/03/21/use-the-powershell-ad-provider-to-modify-user-attributes.aspx
    Regards,
    Lany Zhang

  • How can i add custom attributes to a new Class Object using the API ?

    Hello everyone,
    Here is my problem. I just created a subclass of Document using the API (not XML), by creating a ClassObjectDefinition and a ClassObject. Here is the code :
    // doc is an instance of Document
    ClassObject co = doc.getClassObject();
    ClassObjectDefinition cod = new ClassObjectDefinition(ifsSession);
    cod.setSuperclass(co);
    cod.setSuperclassName(co.getName());
    cod.setName("MYDocument");
    ClassObject c = (ClassObject)ifsSession.createSchemaObject(cod);
    Everything seems to be OK since i can see the new class when i use ifsmgr. But my question is : how can i add custom attributes to this new class ? Here is what i tried :
    AttributeDefinition value = new AttributeDefinition(ifsSession);
    value.setAttribute("FOO", AttributeValue.newAttributeValue("bar"));
    c.addAttribute(value);
    But i got the following error message :
    oracle.ifs.common.IfsException: IFS-30002: Unable to create new LibraryObject
    java.sql.SQLException: ORA-01400: impossible d'insirer NULL dans ("IFSSYS"."ODM_ATTRIBUTE"."DATATYPE")
    oracle.ifs.server.S_LibraryObjectData oracle.ifs.beans.LibrarySession.DMNewSchemaObject(oracle.ifs.server.S_LibraryObjectDefinition)
    oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.NewSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
    oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.createSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
    void fr.sword.ifs.GestionDocument.IFSDocument.createDocument(java.lang.String)
    void fr.sword.ifs.GestionDocument.IFSDocument.main(java.lang.String[])
    So, what am i doing wrong ?
    More generally, are we restricted in the types of the attributes ? (for example, would it be possible to add an attribute that would be an inputStream ? Or an object that i have already created ?).
    Any help would be appreciated. Thanks in advance.
    Guillaume
    PS : i'm using Oracle iFS 1.1.9 on NT4 SP6 and Oracle 8.1.7
    null

    Hi Guillaume,
    you're welcome. Don't know exactly, but assume that ATTRIBUTEDATATYPE_UNKNOWN
    is used to check for erronous cases only
    and it shouldn't be used otherwise.
    Creating your own objects could be simply done via
    ClassObject ifsClassObject;
    DocumentDefinition ifsDocDef = new DocumentDefinition(ifsSession);
    // get class object for my very own document
    ifsClassObject = ClassObject.getClassObjectFromLabel(ifsSession, "MYDOCUMENT");
    // set the class for the document i'd like to create
    ifsDocDef.setClassObject(ifsClassObject);
    // set attributes and content for the document...
    ifsDocDef.setAttribute("MYFOO_ATTRIBUTE",....);
    ifsDocDef.setContent("This is the content of my document");
    // create the document...
    PublicObject doc = ifsSession.createPublicObject(ifsDocDef);
    null

  • Office 365 - sharepoint: In Advanced search Page, How to add custom column under property restrictions

     In Advanced search Page, How to add custom column under property restrictions?

    Hi,
    The Navigation control can be added into your HTML page in the Snippet Gallery:
    The two links below about how to create HTML master page and adding snippets needed into it for your reference:
    http://borderingdotnet.blogspot.jp/2012/12/how-to-create-html-masterpage-for.html
    http://msdn.microsoft.com/en-us/library/office/jj822370(v=office.15).aspx
    Feel free to reply if there still any question.
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • How to  add Custom Relationship in MSS Employee Search Drop down

    Dear Sap Fans,
    I would like to link Custom Drop down link at following path.
    Manager Self-Service->Team->Employee Information->General Information->Employee Selection
    Drop Down 1. Direct Reports
              2. Employee from Organization Structure
              3. Employee from Organization Units
              4. Who's Who
    We would like to add one more custom drop down. Can any one suggest how to add custom drop down in this list ? We have created custom relationship in R/3 but it is not showing in Portal.
    Your prompt reply highly appreciated and points will be rewarded.
    Regards,
    Ashish Brahmbhatt

    Barin,
    I have done settings in back end. I have created new realtionship for evaluation path. I am not able to see that link on portal. How/From Where I can use object and data provider tool and eventing for config ?
    rds,
    Aashish

  • How to add  customer group(KNVV-KDGRP)in the  standard report?

    Dear  All,
    My customer requirment is that  Customer group (KNVV-KDGRP)wise  should be run  in  FBL5N report AND   Customer group should be shown in  FBL3N report.
    how to add  customer group in the  standard report?
    thanking you,
    regards,
    Rupang shah

    Hi,
    This is what I did for FBL5N with a developer because additional fields configuration does include certain tables.
    BTE1650  available for FBL5N and add a new field into one of those tables as an append structure and then use a BTE to populate the field for FBL5N.
    Hope that this helps
    Kind regards

  • How to add custom Template transaction types ( for Quote ) ?

    How to add custom template in transaction types?
    Note : I have gone through below note. But not getting appropriate solution for this.
    982142.1 (OM Sales Order Template Not Available In Layout Template LOV For Print&Preview)
    444687.1 (OM Quote Template Not Available In Layout Template LOV for Print And Preview)
    Thanks in advance..
    Sameer

    Hi
    Thanks for your support,
    Pls let me know which steps i should go ?  my secanrio is  inbound side only,
    step 1 )   Define idoc extension for HRMD_A01 using WE30 transaction and define it in partner profiles
    step 2) do i need to write some code in BADI also to update information for my custom infotype also  if yes then where and which BADI pls let me know  ? because already am working on one badi HRALE00INBOUND_IDOC for  few validation for incoming data.
    step 3 )  add  this new custom infotype in my standard ALE  filters.
    Pls let me know if am mistaking some where or if  i have to do some thing else ?
    Regards
    Meeta & Glory

  • How to add customized payslip in the place of standered payslip.

    Dear Experts,
    We have implementing ESS/MSS, how to add customized payslip( Zprograme) in the place of standered payslip and how do we can get pay slip under ESS from portal.
    Thanks in advance.
    Regards,
    Mahee.

    If you have developed your own SMARTFORM Payslip and a custom program to display it, then there is not much you can do with standard configuration.
    Steps provided by Siddhart will call a custom HRFORMS payslip in a standardv way, or convert a PE51 payslip to SMARTFORMS pdf and display in a standard way.
    You have to work with your Portal Consultant and/or ESS/MSS consultant and ABAP/Webdynpro Programmer for this one.
    One suggested appraoch is
    1) Create A Webdynpro programme which launches when Employee clicks on Payslip link
    2) This program passes the employee user id to an ABAP program in ECC
    3) ABAP Program calls the custom payslip program already developed and generates the payslip and passes it to the webdynpro program as a binary file.
    4) Webdynpro program displays payslip as pdf file.
    this Webdynpro program has a PCD URL. A resource is created and assigned this PCD URL.. Homepage customizing is done - this resource is assigned to the Payslip service which is assigned to the Payslip Subarea.
    Hope this helps. We actually used this approach briefly long back before switching to HRFORMS, so I know it will work, but I have obviously provided very high level here. Hope you can do something with this.
    Edited by: Harish T K on Feb 2, 2011 4:23 PM

  • How to add new attribute in product catalog?

    Hi All,
    Can anyone tell me how to add new field/attribute in product catalog?
    The requirement is to display product's new attribute on product catalog screen.
    Do I need to create any custom java class?
    Need suggestion!!
    Thanks.
    Regards,
    Rupali

    Hello Rupali,
    I am assuming a CRM E-Commerce scenario for my help here.
    Can anyone tell me how to add new field/attribute in product catalog?
    You must start from defining the new Attribute in an exisiting or new Set Type. Use transaction code COMM_ATTRSET. Once you have the attribute / attribute set defined, you can assign this to your catalog - in the header data as the Basic characteristic List.
    to display product's new attribute on product catalog screen
    See catalog/ProductDetailISA.jsp for tips - search for catalog.isa.attribute. The catalog item WebCatItem has all the details available already.
    com.sapmarkets.isa.catalog.webcatalog.WebCatItem currentItem = webCatItem;
    If you want to show the details of attributes in the catalog page - say - catalog/ProductsISA.jsp, the instance of WebCatItem is already available. In this page look for
      <isa:iterate id="item"
                   name="itemPage"
                   type="com.sapmarkets.isa.catalog.webcatalog.WebCatItem">
    You can see that item is an instance of the WebCatItem and follow the code in the <isa:iterate> loop. Using the following code
    Iterator itemAttribute = item.getCatalogItemAttributes();
    will give you the attribute list. You can iterate over the list of attributes and do what you want.
    Easwar Ram
    http://www.parxlns.com

  • How to enable Custome Attribute

    We wanted to create custome attribute for Version dimension in planning appliction but this option is disabled in planning web for this dimension property.
    How to enable the custome attribute option for version dimension in Hyperion Planning application(11.1.2.1).
    Thanks in Advance,
    ID
    Edited by: 818693 on 17 Jun, 2011 2:48 AM

    Hi,
    I'm not sure at all, but due to te fact that Version is a specific planning dimension, you may not add an attribute dimension on it.
    If in Planning Administration, Dimensions page, you select your version dimenion. If you click on dimension, do you see a button "add attribute" appearing ? You may try on Entity dimension.
    If you see it in Entity, and not in Version so it means you can't add an attribute.
    Regards,

  • How to add custom fields in BADI  Subscreen.

    Hi Friends,
    I have to include some custom fields in MFBF tcode.(In make-to-order tab page).
    To do that I have used RM_HR_INTEGRATION  BADI definition  and created implementation for this. In the provided subscreen I tried to add custom fields but it asks access key . I donu2019t know , how to proceed further. Your help is needed.
    Or kindly provide me solution to achieve my requirement.
    Thanks in Advance,
    senthil.

    Hi Venky,
    We can see the documentation in
    se18 -> badi -> LE_SHP_TAB_CUST_HEAD -> display -> documentation button above the definition name
    in the first pop-up of documentation..go to the end which says 'Further notes'
    Further notes
    Documentation on BAdI Interface LE_SHP_TAB_CUST_HEAD
    click on this and we have a detailed description of each method defined in the badi
    Hope it helps
    Regards
    Byju

  • How  to add custom fields to the  sap standard  program ukm_bp_display

    How  to add new custom  fields to the  sap standard  program ukm_bp_display .
    could u  please any one help me on this?

    Hello Kumar,
    You have to modify below structure, as this structure is providing the field catalog for output display (ALV).
    Here you can see there are a lot of include structures, so if you want to add fields in the output display you can add those fileds as an append structure to any of the below mentioned structures (Like ukm_s_account, ukm_s_bp_cms_sgm etc as per your requiremnt and positon at which you need to dispaly your fields.)
    DATA: BEGIN OF gt_grid_alv OCCURS 0.
           partner LIKE but000-partner,
           credit_sgmnt LIKE ukmbp_cms_sgm-credit_sgmnt.
            INCLUDE STRUCTURE ukm_s_account.
            INCLUDE STRUCTURE ukm_s_bp_cms_sgm.
    DATA:   credit_sgmnt_txt LIKE ukmcred_sgm0t-credit_sgmnt_txt.
          Gruppe Vector
            INCLUDE STRUCTURE ukm_s_bp_vector.
          Gruppe OBL = Obligo
          include structure UKM_S_BP_CMS_MALUSDSP_OUT.
            INCLUDE STRUCTURE ukm_s_display_segment.
            INCLUDE STRUCTURE ukm_s_bp_cms.
            INCLUDE STRUCTURE bus000_dat.
    *DATA:   icon(4).
          Gruppe RAST (Raster)
    DATA:
             rast01 LIKE ukm_s_display_segment-AMOUNT_GRID,
             rast02 LIKE ukm_s_display_segment-AMOUNT_GRID,
             rast03 LIKE ukm_s_display_segment-AMOUNT_GRID,
             rast04 LIKE ukm_s_display_segment-AMOUNT_GRID,
             rast05 LIKE ukm_s_display_segment-AMOUNT_GRID,
             rast06 LIKE ukm_s_display_segment-AMOUNT_GRID.
    DATA:    rast2_6 LIKE ukm_s_display_segment-AMOUNT_GRID.
    "Summe raster 2 bis 6
    DATA:  END OF gt_grid_alv.
    Another way is you can  go  to SE38, and you can create implicit enhancements.One enhancement point is available here in this required area. so create an implementation and add your fileds with data types.This way is also simple.
    Hope this will solve yiour problems.
    Regards,
    Antony Thomas

  • How to add Navigation attributes values via ABAP while creation of CVC

    Hi,
    I have a requirement like, I have to add navigational attributes to the cvc record while CVC creation ( /sapapo/mc62 transaction).
    There were two scenarios: 1. Usually when they load master data from BW side those navigation attributes available and when we do CVC creation it's automatically picks those values. If NOT then i have to bring Market segment and Business unit navigational attributes values from ECC via RFC function module by passing MPN and End customer division as a input.
    I am facing problem when BW side if business unit and Market segment were blank.
    Do we have any Function modules available to add navigational attributes data and should update corresponding master data tables.
    Please help me step by step process on this.
    Thanks
    Ravi
    Edited by: REDDY KALLURI on Jan 22, 2011 10:30 PM

    Michael,
    Are you intending this as a commercial solution or a work around?
    To take an existing equivalent, one would build a view in the database tailored for each grid in an Oracle Forms application. Or a separate query layered over tables for each form/grid in a Delphi or Access application? Even if it is ninety nine percent the same over half a dozen forms/grids?
    And now you've added a whole slew of "slightly different" rowSetInfos to maintain.
    So if you wanted to add a column that needs to appear everywhere... you've just increased the workload multi-fold?
    That would be a management nightmare, wouldn't it? Not to mention yet more performance cost and a slower system?
    Hmmmm..... I'm not sure I like where this is headed... someone needs to do some convincing...
    null

Maybe you are looking for