How to read "Customixed Information" in UME using WebDynpro Java APIs

Dear All
In our Portal UME we have defined 3 custom fields that appear in the "Customized Information"
tab in the standard Portal "Identity Mangagement" application ie:
krb5principalname :
How can I retrieve the custom fields and values using WebDynpro APIs?
I have the following basic code to retrieve the standard user session information, but
do not know how to extend it to extract the values of the custom fields.
Full points will be awarded to whoever answers question with suggestion that works.
Many thanks in advance
Mike

Hi Mike,
Following code is for just one custom attribute <custom attribute>
                              String namespaces[] = umeUser.getAttributeNamespaces();
                              String ns = null;
                              for (int i = 0; i < namespaces.length; i++) {
                                   if (i > 0)
                                        ns = namespaces[ i ];
                                   String attrNames[] = umeUser.getAttributeNames(ns);
                                   if (ns != null){                                   
                               if(ns.equals("<name-space>")){     
                                   for (int j = 0; j < attrNames.length; j++) {
                                        if(attrNames[j].equals("<custom attribute>")){                                        
                                             Object attr[] = umeUser.getAttribute(ns, attrNames[j]);
                                             for (int k = 0; k < attr.length; k++){
                                                  if(!(null == attr[k])|| !(attr[k].toString().length() == 0)){                                                  
                                                       //attr[k].toString() has the custom attribute value
                                                  break;
                                        }else
                                             continue;               
                               }else
                                   continue;
Where <name-space> is the same value you set in config tool or on portal UME configuration.
Config Tool: Global Service Configuration>services->com.sap.security.core.ume.service>ume.virtual_groups.user_attribute.namespace
Portal
System Administration>System Configuration>UME configuration> User Admin UI tab>
Custom attributes of the user profile
Administrator-Managed Custom Attributes: add ;<name-space>:<custom-attribute>
Hope this helps

Similar Messages

  • How to access the SAP MDM destinations using mdm java api in 7.1

    hi,
    I have SAP MDM 7.1 SP11 and SAP Portal 7.3 and developing the custom webdynpro application using the  JAVA MDM API. I want configure the SAP MDM destinations in SAP Portal .
    How to access the MDM destinations in java code using API? and how to create the connection with MDM using the MDM destinations.
    Please provide the code for access the SAP MDM destinations in java code using MDM java api and creating the connection to MDM.
    Thanks

    Jun,
    Thanks for the reply and api information.
    I have got this api information from the following sap documentation. But i am looking for the code by implementing this class and creating the mdm connection.
    Creating an MDM Connection Using Java Code - SAP NetWeaver Master Data Management (MDM) - SAP Library
    if any thing can you share it.
    Thanks

  • How to send pdf attachment through mail using Webdynpro-Java

    How can i send the Adobe Interactive Form with data involved as a PDF attachment to mail? using Webdynpro-Java.
    Is there any Adobe API or jar file for generating pdf?
    Helpful answer is highly appreciable and rewarded with points.!

    Hi Sankar,
    try [Offline Interactive PDF Form Using E-Mail|/docs/DOC-8061#49]
    Michal

  • How to create relationship between two records using MDM Java APIs

    Hi,
    I am trying to create relationship between two records using Java Apis. Please guide me in doing this.
    Regards,
    Niraj

    Hi Niraj,
    There is ModifyRelationshipsCommand:
    http://help.sap.com/javadocs/MDM/SP06/com/sap/mdm/data/commands/ModifyRelationshipsCommand.html
    Retrieve Relationship command:
    http://help.sap.com/javadocs/MDM/current/com/sap/mdm/schema/commands/GetRelationshipListCommand.html
    Also, please refer similar thread, MDM Java API and relationships.
    Hope it helps..
    Regards,
    Mandeep Saini

  • How to add record in Qualified table using MDM Java API

    Hi experts,
    I am trying to add a record into a Table.
    but I am facing the problem in setFieldValue method.
    //Getting Field-ID to pass in setFieldValue() method.
    FieldId[] fields = new FieldId[6];
              fields[0] = repSchema.getFieldId("GTINs", "Description");
              fields[1] = repSchema.getFieldId("GTINs", "Unit_Descriptor");
              fields[2] = repSchema.getFieldId("GTINs", "GTIN");
              fields[3] = repSchema.getFieldId("GTINs", "Alternate_Item_Classifications");
              fields[4] = repSchema.getFieldId("GTINs", "Country_Of_Origin");
              fields[5] = repSchema.getFieldId("GTINs", "Bar_Coded");
    Record rec = RecordFactory.createEmptyRecord(mainTableId);
    rec.setFieldValue(fields, );
    but I am not getting how to assign the value to these fields using MDMvalue Interface.
    Can anyone provide me the code sample or Code flow so that I can do this.
    Plz help me it'll be great help for me.
    Thanks
    Tarun
    Edited by: Tarun Sharma on Feb 4, 2008 11:39 AM
    ==========================================================================================
    Hi Gurus
    I found the way to add the MDMValue in setFieldValue Method.
    we can set like this:
    setFieldValue(<fieldId object like fieldId[], <MdmValue like this> new StringValue("ABC"));
    Now I am facing problem in adding value to lookup flat table.
    According to the setFieldValue method we can assign the loookup like this:
    setFieldValue(<fieldId[0]>, new LookpValue(<here we have to pass the recordID of lookup table>);
    so I want to know how I can pass the recordId of lookup table here.
    Please suggest.
    Thanks
    Tarun Sharma
    Edited by: Tarun Sharma on Feb 4, 2008 3:15 PM
    Edited by: Tarun Sharma on Feb 4, 2008 3:25 PM
    Edited by: Tarun Sharma on Feb 8, 2008 6:58 PM

    Hi Andrea,
    I tried your suggestion but now i am getting Type Mismatch Error.
    Please suggest me what I can do?
    //TableId for Lookup[Flat].
    TableId lookupTableId = repSchema.getTableId("Return_Goods_Policies");
    FieldId[] ReturnGoodsPolicyTableIdFields = new FieldId[1];
    ReturnGoodsPolicyTableIdFields[0] = repSchema.getFieldId("Return_Goods_Policies", "Name");               
    Record recLookup = RecordFactory.createEmptyRecord(lookupTableId);
    try{
    recLookup.setFieldValue(ReturnGoodsPolicyTableIdFields[0], new StringValue("New_Brand"));
    }catch(Exception ex){
    System.out.println(ex);
    //Creating Record in Qualified Table - Request Details
    CreateRecordCommand createLookupcommand = new CreateRecordCommand(simpleConnection);
    createLookupcommand.setSession(session);
    createLookupcommand.setRecord(recLookup);
    createLookupcommand.execute();     
    //Getting the recordId of Lookup record.
    RecordId lookupRecordId = createLookupcommand.getRecord().getId();
    //Table Id for Qualified table.
    TableId  qualifiedTableId = repSchema.getTableId("Ext_Hardlines");
    FieldId[] ExtHardlinesFields = new FieldId[3];
    ExtHardlinesFields[0] = repSchema.getFieldId("Ext_Hardlines", "Name");//Text
    ExtHardlinesFields[1] = repSchema.getFieldId("Ext_Hardlines", "Pieces_Per_Trade_item");//Integer
    ExtHardlinesFields[2] = repSchema.getFieldId("Ext_Hardlines","Return_Goods_Policy");
    Record recQualified = RecordFactory.createEmptyRecord(qualifiedTableId);
    try{
    recQualified.setFieldValue(ExtHardlinesFields[0], new StringValue("Qualified Value"));
    recQualified.setFieldValue(ExtHardlinesFields[1], new StringValue("Qualified Description"));
    recQualified.setFieldValue(ExtHardlinesFields[2], new LookupValue(lookupRecordId));
    }catch(Exception ex){
    System.out.println(ex);
    //Creating Record in Qualified Table - Request Details
    CreateRecordCommand createQualifiedCommand = new CreateRecordCommand(simpleConnection);
    createQualifiedCommand.setSession(session);
    createQualifiedCommand.setRecord(recQualified);
    createQualifiedCommand.execute(); I am getting this Type match here, but i m not getting what mistake i did.     
    RecordId qualifiedRecordId = createQualifiedCommand.getRecord().getId();
    //Adding to Main Table
    TableId  mainTableId = repSchema.getTableId("GTINs");
    FieldId[] gtinsFields = new FieldId[1];
    gtinsFields[0] = repSchema.getFieldId("GTINs","Ext_Hardlines");
    Record recMain = RecordFactory.createEmptyRecord(mainTableId);
    //Adding the new record to Qualifed Lookup value and setting the Yes Qualifiers
    QualifiedLookupValue qualifiedLookupValue = new QualifiedLookupValue();
    qualifiedLookupValue.createQualifiedLink(qualifiedRecordId);
    try{
    recMain.setFieldValue(gtinsFields[0], new QualifiedLookupValue(qualifiedLookupValue));
    }catch(Exception ex){
    System.out.println(ex);
    CreateRecordCommand createCmd = new CreateRecordCommand(simpleConnection);
    createCmd.setSession(session);
    createCmd.setRecord(recMain);
    createCmd.execute();
    Could you help me out?
    Thanks
    Tarun

  • Attachments using MDM java API

    Hi
    How to store attachments in MDM repository using MDM java API.
    Could you please suggest us.
    Thanks
    Sowmya

    Hi Sowmya,
    You can store attachments using MDM Java API. You can use the following piece of code.
    BinaryBlobRecord record2 = RecordFactory.createEmptyBinaryObjectRecord(tableID);
    //Attachment to be saved
    String filePath = wdContext.currentContextElement().getVa_Resource().getUrl(0);
    IWDResource resource = wdContext.currentContextElement().getVa_Resource();
    FileInputStream stream = (FileInputStream)resource.read(true);
    int length = 0;
    while(stream.read() != -1)
         length++;
    byte[] b = new byte[(int) length];
    stream.read(b);
    stream.close();
    record.setName(new StringValue("filename"));
    record.setOriginalName(new StringValue("filename"));
    record.setHasOriginal(new BooleanValue(true);
    RetrieveGroupTreeCommand groupTreeCommand = new    RetrieveGroupTreeCommand(wdContext.currentContextElement().getVa_ConnectionStr());
    groupTreeCommand.setSession(wdContext.currentContextElement().getVa_SessionID());
    groupTreeCommand.setGroupType(GroupTypes.DATA_GROUP_TYPE);
    groupTreeCommand.execute();
    //Set data location and data group ID
    record.setDataLocationId(new GroupNodeId("GN2"));
    record.setDataGroupId(new GroupNodeId("GN2"));
    record.setBinary(new BinaryValue(b));
    CreateRecordCommand createRecComm =
                             new CreateRecordCommand(wdContext.currentContextElement().getVa_ConnectionStr());
    createRecComm.setSession(wdContext.currentContextElement().getVa_SessionID());
    createRecComm.setRecord(record);
    createRecComm.execute();
    //Link this record to the main table record
    Record QRec = RecordFactory.createEmptyRecord(mainTable);
    //Setting the above created record in main table record object
    QRec.setFieldValue(attachmentField, new LookupValue(record.getId()));
    CreateRecordCommand createRecComm =
                        new CreateRecordCommand(wdContext.currentContextElement().getVa_ConnectionStr());
    createRecComm.setSession(wdContext.currentContextElement().getVa_SessionID());
    createRecComm.setRecord(QRec);
    createRecComm.execute();
    Now the main table record is created with an attachment.
    Hope this helps you.
    Regards,
    Sruti

  • Help!!! Can Anybody tell me how to read bookmarks of MS word using ABAP?

    It took me around 3 days , but there is still no solutions...
    Can Anybody tell me how to read bookmarks of MS word using ABAP ?
    Many thanks.

    Dear Nick  ,
    Thanks for your attention!
    I have MS word installed in the R3 server , and I uploaded my word doc with some self-defined bookmarks into SAP R3 system.
    Now I want to read these bookmarks using ABAP in this R3 system...
    Is it clear enough?
    Looking forward to your solution ...
    Thanks again..
    Best Regards,
    Leon.

  • [E2010][EWS-XML][JAVA]How to get the properties of meeting rooms in Exchange 2010 using EWS Java API

    When you look at meeting room properties in Outlook 2010, you can see 'City', 'Country/Region' and 'Department' information.
    Is there any way to get this information using EWS Java API? 

    Hi Glen,
    I am able to understand what u have said, but do not know how to implement it with meeting rooms....
    If i am implementing
    "Get all appointments between startDate and endDate in the specified folder, including recurring meeting occurrences" in ews-java-api, as you have mentioned above, i am able to get only my appointments from the start date to end date , as i
    have given my email id and password, how to get my organization meeting room details, booked or not.
    static ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
    public static void main(String[] args) throws Exception {
    // TODO Auto-generated method stub
    ExchangeCredentials credentials = new WebCredentials("[email protected]", "zzzz");
    service.setCredentials(credentials);
    try {
    System.out.println("Check");
    service.autodiscoverUrl("[email protected]",new RedirectionUrlCallback());
    } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    NameResolutionCollection nameResolutions = service.resolveName("SDB1",ResolveNameSearchLocation.DirectoryOnly, true);
    System.out.println("nameResolutions==="+nameResolutions.getCount());
    for(NameResolution nameResolution : nameResolutions)
    System.out.println("NAME==="+nameResolution.getContact().getDisplayName());
    The above code gives me the output like, the meeting room in my organization with word SDB1 are
    Output:
    nameResolutions===2
    NAME===SDB1- TELCON - 1
    NAME===SDB1-TELCON - 2
     for. eg. I need to know today at what are the appointments in the room SDB1-TELCON2 and who all have booked the room.
    I do not know how to implement for the meeting room can you please help me how to give it.
    Thanks in advance.

  • How do I create a user, in my context in OID using the Java API

    How do I create a user, with subschema, in my context in OID using the JAVA API
    I need to be able to create new users in my OID, I was doing it in our old iPlant Directory, but I don't seem to see the same methods in the Oracle LDAP API. I figured out how to get and modify the attributes of a user, but I can't seem to figure out how to add a new one.

    Try this code , modify it accordingly
    ------- cut here -------
    import oracle.ldap.util.*;
    import oracle.ldap.util.jndi.*;
    import javax.naming.NamingException;
    import javax.naming.directory.*;
    import java.io.*;
    import java.util.*;
    public class NewUser
    final static String ldapServerName = "yourLdapServer";
    final static String ldapServerPort = "4032";
    final static String rootdn = "cn=orcladmin";
    final static String rootpass = "welcome1";
    public static void main(String argv[]) throws NamingException
    // Create the connection to the ldap server
    InitialDirContext ctx = ConnectionUtil.getDefaultDirCtx(ldapServerName,
    ldapServerPort,
    rootdn,
    rootpass);
    // Create the subscriber object using the default subscriber
    Subscriber mysub = null;
    String [] mystr = null;
    try {
    RootOracleContext roc = new RootOracleContext(ctx);
    mysub = roc.getSubscriber(ctx, Util.IDTYPE_DN, "o=dec", mystr);
    catch (UtilException e) {
    e.printStackTrace();
    // Create ModPropertySet with user information
    ModPropertySet mps = new ModPropertySet();
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"cn", "Steve.Harvey");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"sn", "Harvey");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"uid", "SHarvey");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"givenname", "Steve");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"mail", "[email protected]");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"userpassword", "welcome1");
    // Create the user
    User newUser = null;
    try {
    newUser = mysub.createUser(ctx, mps, true);
    System.out.println("New User DN: " + newUser.getDN(ctx));
    catch (UtilException e) {
    e.printStacktrace();
    ------- end cut --------
    Enjoy.
    Suhail

  • How to find out internet explorer version ,using a java program?

    How to find out internet explorer version ,using a java program?

    Browser version from java?....you must be referring it from some web application....rite?
    You can read the User-Agent header using request.getUserAgent() or request.getHeader("User-Agent") in your jsp or servlet.
    for more details pls refer:
    http://www.jguru.com/jguru/faq/view.jsp?EID=12253

  • How To read/write file on remote server in java

    Hi All,
    How To read/write file on remote server in java? I mean using URL - http://www.xyz.com can I right file to that perticular server.
    Thanks in advance

    If your server support a means of uploading files you can.
    A popular means is [http://en.wikipedia.org/wiki/WebDAV]
    However, by default web server don't allow you upload files, its usually something you need to configure or install.
    I suggest you have a look at your web servers documentation.

  • How to retrieve the data from MDM hierarchy table using MDM Java API

    Hi,
    I had a hierarchy table in MDM. This table had some column say x. I want to retrieve the values of this x column and need to show them in a drop down using MDM Java API.
    Can anyone help me to solve this?
    Regards
    Vallabhaneni

    Hi,
    Here is your code...
    TableId Hier_TId = repository_schema.getTableId(<hierarchy table id>);
    java.util.List list = new ArrayList();
    ResultDefinition Supporting_result_dfn = null;
    FieldProperties[] Hier_Field_props =rep_schema.getTableSchema(Hier_TId).getFields();
    LookupFieldProperties lookup_field = null;
    TableSchema lookupTableSchema = null;
    FieldId[] lookupFieldIDs = null;
    for (int i = 0, j = Hier_Field_props.length; i < j; i++) {
    if (Hier_Field_props<i>.isLookup()) {     
                                  lookup_field = (LookupFieldProperties) Hier_Field_props<i>;
         lookupTableSchema =repository_schema.getTableSchema(lookup_field.getLookupTableId());
                                  lookupFieldIDs = lookupTableSchema.getFieldIds();
         Supporting_result_dfn = new ResultDefinition(lookup_field.getLookupTableId());
         Supporting_result_dfn.setSelectFields(lookupFieldIDs);
         list.add(Supporting_result_dfn);
    com.sap.mdm.search.Search hier_search =new com.sap.mdm.search.Search(Hier_TId);
    ResultDefinition Hier_Resultdfn =     new ResultDefinition(Hier_TId);
    Hier_Resultdfn.setSelectFields(rep_schema.getTableSchema(Hier_TId).getDisplayFieldIds());
    ResultDefinition[] supportingResultDefinitions =
    (ResultDefinition[])list.toArray(new ResultDefinition [ list.size() ]);
    RetrieveLimitedHierTreeCommand retrieve_Hier_tree_cmd =
    new RetrieveLimitedHierTreeCommand(conn_acc);
    retrieve_Hier_tree_cmd.setResultDefinition(Hier_Resultdfn);
    retrieve_Hier_tree_cmd.setSession(Auth_User_session_cmd.getSession());
    retrieve_Hier_tree_cmd.setSearch(hier_search);
    retrieve_Hier_tree_cmd.setSupportingResultDefinitions(supportingResultDefinitions);
    try {
         retrieve_Hier_tree_cmd.execute();
    } catch (CommandException e5) {
              // TODO Auto-generated catch block
              e5.printStackTrace();
    HierNode Hier_Node = retrieve_Hier_tree_cmd.getTree();
    print(Hier_Node,1);
    //method print()
    static private void print(HierNode node, int level) {
    if (!node.isRoot()) {
         for (int i = 0, j = level; i < j; i++) {
              System.out.print("\t");
         System.out.println(node.getDisplayValue());
    HierNode[] children = node.getChildren();
    if (children != null) {
              level++;
    for (int i = 0, j = children.length; i < j; i++) {
    print(children<i>, level);
    //end method print()
    Best regards,
    Arun prabhu S
    Edited by: Arun Prabhu Sivakumar on Jul 7, 2008 12:19 PM

  • How to populate boolean fields using MDM Java API's

    Hi Experts!
    I am trying to populate Boolean fields in main table of my repository using MDM JAVA API SP 05 patch 2.
    Problem is i am geting syntax error for any value that i try to put in.
    Please provide me sample code for the purpose.
    Thanks in advance!

    Hi,
    Here is the code snippet to populate boolean values from Main Table in the Repository:
    Populating boolean values from Main Table in the Repository:
    wdContext.currentNodeElement().setABC(Boolean.valueOf((strABC).toString()).booleanValue());
    Putting boolean values in the main table:
    Record objEmptyRecord = RecordFactory.createEmptyRecord(new TableId(strTableId));
    boolean bFieldValue = ((Boolean)strABC).booleanValue();
    objEmptyRecord.setFieldValue(new FieldId(strFieldId),new
    BooleanValue(bFieldValue));
    Hope this helps.
    Regards
    Neha Sharma

  • How can I create a new User with the Java API like OIDDAS do?

    Hello,
    I'm currently working on an BPEL based process. And i need to create an OCS user. So far I can create an user in the OID. But I cant find any documentation about given this user an email account,calendar and content function etc.
    Did anybody know if there are some OIDDAS Webservices? Or did anybody know how to do this using the Java APIs?

    You are asking about a Database User I hope.
    You can look into the Oracle 8i Documentation and find various privillages listed.
    In particular, you may find:
    Chapter 27 Privileges, Roles, and Security Policies
    an intresting chapter.
    You may want to do this with the various tools included with 8i - including the
    Oracle DBA Studio - expand the Security node and you can create USERS and ROLES.
    Or use SQL*Plus. To create a
    user / password named John / Smith, you would login to SQL*Plus as System/manager (or other) and type in:
    Create user John identified by Smith;
    Grant CONNECT to John;
    Grant SELECT ANY TABLE to John;
    commit;
    There is much more you can do
    depending on your needs.
    Please read the documentation.
    -John
    null

  • Can we use Essbase JAVA API in Hyperrion Planning

    Hi,
    I want to load data and extract data from Hyperion Planning applications. can i use Essbase Java APIs to do this Or is there any separate set of APIs available for Planning Applications ?
    Thanks a lot,
    Prince

    Hi John,
    I have following doubts regarding loading data to Hyperion planning by a custom connector
    1) Loading data to Hyperion Planning application using Essbase Java API would be possible at application layer (Hyperion Planning) or at database layer (loading data directly to essbase database) ?
    2) If we load data directly to essbase database how are we going to recognize which essbase server is connected with Hyperion Planning application ? Does user require to know in advance the underlying databse server ? Is there any API in Essbase or in Planning to connect to Planning application ?
    3) If we load data directly to essbase database how to find out Planning applications and essbase application ? In other words how to differentiate between essbase applications and Hyperion Planning appllications ? Or How to recognize Planning applications ? Is there any API in Essbase to find out this ?
    4) If we read data directly from Essbase how do we recognize data from a Planning application ?
    5) What is the difference between Classic planning application and EPMA planning application ? Can we develop a connector to work with both these flavour or type ?
    Please suggest.
    Thanks,
    Prince

Maybe you are looking for