Access Custom Attributes in JavaScript and in Transactions

Hello,
I try to work with custom attributes. I've problems accessing the values in JavaScript and in transactions, but it works fine within .irpt pages.
What's the trick?
For a custom attribute called PLANT, can I write something like this in JavaScript?
var p = ;
Is there a way to access custom attributes in the Link Editor of an Action Block?
Kind Regards,
Matthias

Hi Matthias,
it is not possible to integrate that kind of MII variables in JavaScript like you discribed before.
You are right that this kind of expression is possible in the .irpt file. The reason why it is working in the .irpt
but not in the .js is, that the MII script parser is only replacing in HTML content. Everywhere you have
scripting the parser will not replace the {...} markings (since the curly brackets also show start/end of functions aso.).
Variables to JavaScript
The easiest Way to get those variables is to create hidden fields in the .irpt file that you can access via JavaScript.
For example:
<input type="hidden" id="hidden_plant" value="{PLANT}" />
This will be parsed to (e.g.)
<input type="hidden" id="hidden_plant" value="Karlsruhe/DE" />
Now you can access this value in JavaScript via:
document.getElementById( "hidden_plant" ).value;
Variables to Transactions
To parse custom variables to a transaction you first have to specify corresponding transaction variables in the
transaction itself. After saving the transaction you can map those variables to Parameters in the Xacute-Query-Editor.
Including this transaction to your webpage you can simply assign the required value to the corresponding parameter.
For example if you mapped the Plant variable of the transaction to Param.1 you can specify the information in the .irpt
like:
<applet id="trx_test" ....>
  <... />
  <param name="Param.1" value="{PLANT}" />
</applet>
Another possibility is to set the value dynamically via JavaScript if you use:
document.getElementById( "trx_test" ).getQueryObject().setParam( 1, "Karlsruhe/DE" );
Native access to user variables via the BLE is not possible (as far as I know).
I hope this is what you wanted to hear?
Best Regards
Sebastian
Edited by: Sebastian Holzschuh on Jun 10, 2008 12:16 PM

Similar Messages

  • Accessing custom attributes in LDAP using WD Java - UME APIs

    Hello Friends,
    I am trying to access a custom attribute from LDAP in WebDynpro Java. I am using bellow code.
    IWDClientUser clientUser = WDClientUser.getCurrentUser();
    IUser sapUser = clientUser.getSAPUser();
    if (sapUser != null) {
    String[] str_emp = sapUser.getAttribute(<Name Space>,"Attribute Name");
    if (str_emp == null || str_emp.length == 0) {
    wdComponentAPI.getMessageManager().reportSuccess(" NULL ");
    return;
    } else {
    strEmpID = str_emp[0];
    wdComponentAPI.getMessageManager().reportSuccess(strEmpID);
    The name space is "$usermapping$". I am not sure why it is like that only for this attribute i am trying to access.
    I am getting null value if i run this code.
    Can any one help
    thanks
    Shobhan

    Hi,
    Are you sure this is the right namespace? The default namespace is com.sap.security.core.usermanagement.
    You can get all namespaces and the names of all attributes defined for a user using methods getAttributeNamespaces and getAttributeNames : [Interface IPrincipal|http://help.sap.com/javadocs/NW04S/current/se/index.html].
    Regards,
    Pierre

  • How to Access Custom Attributes created in UME.

    Hi All,
    I have created a custom attribute in UME by using the config tool, the problem that i was facing is i am unable to access those custom attributes via Iuser Api i.e even though i am using the method getAttributeNamespaces() it is returning all the attributes except the custom attributes that i have created in UME.
    Thanks in Advance,
    RV.

    Hi RV,
    Use the user.api jar in your appln.
    follow these steps in your code:
    IWDClientUser wdUser = WDClientUser.getCurrentUser();
    IUser user = wdUser.getSAPUser();
    user.getAttribute("com.sap.security.core.usermanagement", "exact name of the custom attribute");
    if you are still facing the problem paste your code here for analysis.

  • Accessing Custom Controller from setter and Getter methods

    Hi Gurus
    How can we access the custom controller from setter and getter methods,is there any way to do that.
    Thanks & Regards
    Rajasekhar

    Hi Steve.
    Thanks very much for valuable information,  the main controller class is getting tracked in mo_owner which is declared as  CL_BSP_WD_VIEW_CONTROLLER, and I'm getting the reference through
    mo_owner ?= owner. (since mo_owner = owner is not getting converted of type mo_owner ). After doing this on whatever the contexnode class (say zl_xxxx_xxx_cnxx) the corressponding context node values are getting turned as  <#ERROR IN METADATA.
    I mean when I'm checking the configuration in bsp_wd_cmpwb configuration tab -> Available Fields->Enlarge the contex node->BTSTATUS (say for Example) there the values are showing as <#ERROR IN METADATA , After executing the above procedure
    I cross checked several times before and after redefining the context node method IF_BSP_MODEL~INIT, before redefining this method UI is working fine, after redefintion UI is throwing below error .
    Exception Details
    CX_SY_REF_IS_INITIAL - Dereferencing of the NULL reference
    Method: CL_BSP_MODEL=>IF_BSP_MODEL_BINDING~IS_ATTRIBUTE_VALID
    Source Text Row: 13
    Thanks & Regards
    Rajasekhar

  • How to access custom attribute value on the timecard at runtime

    I have created 2 attributes; Project and Task.
    Once a employee selects the Project from the Projects custom LOV I want the Task LOV to display only the tasks related to that particular project.
    How to access the PROJECT_ID during runtime which the user selects from Projects LOV?

    Hi
    I have added the below text in the ldt file.
    But its not working? Any suggestions?
    What may be going wrong?
    # CSR Project List
    BEGIN HXC_LAYOUT_COMPONENTS "XXCSR1 Payroll Timecard Layout - Project"
    OWNER = "CUSTOM"
    COMPONENT_VALUE = "XXCSRPROJECT"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_CODE_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "XXCSR_HXC_TIMECARD_PROJECT"
    ATTRIBUTE_CODE_APP_SHORT_NAME = "HXC"
    SEQUENCE = "211"
    COMPONENT_DEFINITION = "CHOICE_LIST"
    RENDER_TYPE = "WEB"
    PARENT_COMPONENT =
    "XXCSR1 Payroll Timecard Layout - Day Scope Building blocks for worker timecard matrix"
    BEGIN HXC_LAYOUT_COMP_QUALIFIERS "XXCSR1 Payroll Timecard Layout - Project"
    OWNER = "CUSTOM"
    QUALIFIER_ATTRIBUTE_CATEGORY = "CHOICE_LIST"
    QUALIFIER_ATTRIBUTE1 = "Custom1VO"
    QUALIFIER_ATTRIBUTE4 = "N"
    QUALIFIER_ATTRIBUTE5 = "15"
    QUALIFIER_ATTRIBUTE6 =
    "XxcsrProjectId|Projects List|RESULT|N"
    QUALIFIER_ATTRIBUTE10 =
    "oracle.apps.hxc.selfservice.timecard.server.Custom1VO"
    QUALIFIER_ATTRIBUTE20 = "N"
    QUALIFIER_ATTRIBUTE21 = "Y"
    QUALIFIER_ATTRIBUTE22 = "L"
    QUALIFIER_ATTRIBUTE25 = "FLEX"
    QUALIFIER_ATTRIBUTE26 = "Projects List"
    QUALIFIER_ATTRIBUTE27 = "Attribute1"
    QUALIFIER_ATTRIBUTE28 = "Projects List"
    END HXC_LAYOUT_COMP_QUALIFIERS
    END HXC_LAYOUT_COMPONENTS
    # CSR Project List
    # CSR Task List
    BEGIN HXC_LAYOUT_COMPONENTS "XXCSR1 Payroll Timecard Layout - Task"
    OWNER = "CUSTOM"
    COMPONENT_VALUE = "XXCSRTASK"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_CODE_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "XXCSR_HXC_TIMECARD_TASK"
    ATTRIBUTE_CODE_APP_SHORT_NAME = "HXC"
    SEQUENCE = "212"
    COMPONENT_DEFINITION = "CHOICE_LIST"
    RENDER_TYPE = "WEB"
    PARENT_COMPONENT =
    "XXCSR1 Payroll Timecard Layout - Day Scope Building blocks for worker timecard matrix"
    BEGIN HXC_LAYOUT_COMP_QUALIFIERS "XXCSR1 Payroll Timecard Layout - Task"
    OWNER = "CUSTOM"
    QUALIFIER_ATTRIBUTE_CATEGORY = "CHOICE_LIST"
    QUALIFIER_ATTRIBUTE1 = "Custom2VO"
    QUALIFIER_ATTRIBUTE4 = "N"
    QUALIFIER_ATTRIBUTE5 = "15"
    QUALIFIER_ATTRIBUTE10 =
    "oracle.apps.hxc.selfservice.timecard.server.Custom2VO"
    QUALIFIER_ATTRIBUTE14 =
    "HxcCuiTaskProjectId|PROJECT|Y"
    QUALIFIER_ATTRIBUTE15 =
    "pro_id = ::XxcsrProjectId"
    QUALIFIER_ATTRIBUTE20 = "N"
    QUALIFIER_ATTRIBUTE21 = "Y"
    QUALIFIER_ATTRIBUTE22 = "L"
    QUALIFIER_ATTRIBUTE25 = "FLEX"
    QUALIFIER_ATTRIBUTE26 = "Projects List"
    QUALIFIER_ATTRIBUTE27 = "Attribute2"
    QUALIFIER_ATTRIBUTE28 = "Task List"
    END HXC_LAYOUT_COMP_QUALIFIERS
    END HXC_LAYOUT_COMPONENTS
    # CSR Task List
    ###########################################################

  • Regarding Adding Custom Fields to VTTK and VT01n transaction.

    Hi,
    We need to add few custom fields to Shipment header table VTTK.
    Also, these fields should be reflected in 'Additional Data' tab of transaction VT01n/VT02n for editing and should be available for display in VT03n.
    If anyone has done this, please provide the approach.
    Thanks,
    Arshad

    Hi Arshad,
    The fields suppl.1 to suppl.4 and Addit.text 1 to Addit.text 4 are the reserve fields available in additional data tab of shipment.
    If those fields are not being used already, u can utilise those fields for your purpose. Please check the documentation for the fields ADD01 to ADD04 and TEXT1 to TEXT4 in VTTK table.
    The description of the fields can be modified from CMOD transaction.
    Regards,
    Poornima

  • Declaring and accessing custom global attributes of component controller

    Hi,
    I want to declare some global attributes for Component Controller and initialize them in WdDoInit() method.
    I have declared them under Component Controller --> Attributes tab --> after wd_context and wd_this (say G_MESSAGE).
    However,  when I am trying to set them in wdDoInit() method, I get compilation error saying G_MYMESSAGE is unknown and its not defined using data statement.
    How do I access these attributes?
    Thanks and regards,
    Amey

    Hello Amey,
    You need to access the variable by "wd_this->g_mymessage"
    Since wd_this attribute in each controller refers to interface of local controller. you could read the description of that attribute in attribute tab.
    Regards
    Anurag Chopra

  • How can I add a custom attribute to the create page dialog?

    I followed the following link to add a custom attribute called starred and this attaribute can be displayed in siteadmin grid
    http://dev.day.com/docs/en/cq/current/developing/customize_siteadmin.html
    I would like to let the user input the value when they create a page. That's why I would like to add a custom field in the input dialog box as attached pic.
    The method you describe before can only added those CQ bulid-in attribute.
    For those custom attribute, how can I added it?

    Hi,
    How can I customize the /bin/wcmcommand or how can I make use of [2] to create a custom WCMCommand?
    I think the "formUrl" is to post those input value to the jcr repository?
    var createDialog = {
            "jcr:primaryType": "cq:Dialog",
            "id": CQ.Util.createId("cq-createdialog"),
            "title":CQ.I18n.getMessage("Create Page"),
            "formUrl": CQ.shared.HTTP.externalize("/bin/wcmcommand"),
            "params": {
                "cmd":"createPage",
                "_charset_":"utf-8"
    I have added a field called "starred"
    Moreover, when I using the firebug to trace the post command, I can see that the starred value is posted also.
    :status
    browser
    _charset_
    utf-8
    cmd
    createPage
    label
    b
    parentPath
    /content/keyword_elaboration
    starred
    c
    template
    /libs/collab/commons/templates/form
    title
    a
    Source
    cmd=createPage&_charset_=utf-8&%3Astatus=browser&parentPath=%2Fcontent%2Fkeyword_elaboration&title=a&label=b&starred=c&template=%2Flibs%2Fcollab%2Fcommons%2Ftemplates%2Fform
    However, when I go to the crxde to view the node's attribute, the properity starred is not created
    Are there anything I did wrong or missing?
    Thanks.
    Message was edited by: aslkit

  • LDAP Sync is not working on custom attributes

    Gurus,
    I have installed and configured OIM 11g release 2. While configuring OIM, i have enabled ldapsync to OID.
    Created a custom attribute in OID and also on OIM. But when I change this attribute in OIM, that change is not going to OID and vice versa. There are not errors in the logs.
    Please throw some light on this.

    While creating a custom attribute in oim, you will give label, name right..At the same time there will be an option to provide ldap attribute name. You need to provide the name of the attribute that you created in OID here. Then only ldap sync will work on custom attributes. without specifying ldap attribute name, ldap sync wiill not work.
    Give a try and post your results here.

  • Programmatically create custom attributes in KM

    Hi all,
    We are implementing an application which uploads/downloads files to/from KM content of a portal user. The application will also display the list of files for the portal user. The file list displays the standard file attributes: filename,  created_date, size.
    Additionally to these attributes we want to store  some custom attributes (e.g. last sent to, received from...) for files in the KM.
    We need to create these custom attributes programmatically at runtime, if the file is stored/updated in the KM content.
    How can we programmatically create these kind of custom attributes in KM and read/write these custom attributes at runtime?
    Thanks,
    Yasar

    hi,
    General example on how to code KM
    http://wiki.sdn.sap.com/wiki/display/Snippets/UpdateKnowledgeManagementusingWebDynproJavaApplication
    Coding custom attributes, look into Properties section
    https://media.sdn.sap.com/html/submitted_docs/nw_kmc/howto/rf/client_api/rf_client_api.html
    Coding custom renderer.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f7b176eb-0701-0010-2b84-8edb1f76771d?QuickLink=index&overridelayout=true
    Srini

  • My Inbox Custom Attributes are toggling

    Hello,
    Please provide me help.
    I am working on Documentum technology, I have customize my Webtop Inbox component.
    Using Java,Jsp, XMl .
    I have added three custom attributes in our Inbox.
    It is working fine, but the issue is my custom attributes are toggling,means that sometime my custom attributes are displaying and sometime not.This happened when I am clicking on refresh button or clicking on inbox link.
    please provide me help
    Thanks
    Shahnawaz

    I look deep into my crystal ball, and ... let's see... the haze is starting to thin... now the image is forming.... it says:
    "Post some code where you think the problem exists and ask specific questions about what you think may be the problem. Also post any error messages that occur and use code tags when you post any code."

  • Export Custom Attribute Mapping

    Hello Gurus!
    I'm migrating a xMII 11.5 project to MII 12.1 and the migration tool was fine on creating the Custom Attributes and Custom Attribute Mapping. However, what I need now is to export Custom Attribute and Custom Attribute Mapping from MII 12.1 DEV to QAS and PRD.
    My question is: When exporting Custom Attributes from Configurations menu, it will export Custom Attribute Mapping too? How can I export and import Custom Attribute Mapping from DEV to QAS and PRD?
    Thanks

    Manoel,
    have you tried the following:
    - open System Management / Configurations
    - unmark the "Select All" and only mark the "Custom Attributes"
    - click export and save the zip file
    The exported zip file should include all the settings. In your follow up systems QAS and PRD you can import the zip file.
    See also SAP Help on [MII 12.1 Configuration|http://help.sap.com/saphelp_mii121/helpdata/en/43/e80b59ad40719ae10000000a1553f6/frameset.htm]
    Michael

  • Edit OID Object Class to Add custom attributes

    Has anyone edited an existing object class( in my case orclADUser ) and added custom attributes to it?
    If so
    1) what is the best way to add it (oidadmin Schema management ? )
    2) what is the impact on such custom attributes ?

    Yes and no.
    I've done this but I created my own classes in the oidadmin. Then I populated them.
    My application searched through these attributes (in a separate part of the OID). One attribute pointed to the DN of the user.
    Doing it in this way will ensure that standard software and updates will not break your setup.
    cu
    Andreas

  • How to access custom property for attribute and control in .vm file?

    Hi,
    I have created custom properties in OPM for attribute and apply also that properties to attribute.
    But if how to access that value in .vm file?
    I accessed using
    $attribute.getProperty("ScreenProp", "default value")
    but it's not working but same is worked for screen custom property

    $control.getProperties().get("PropertyName") works for custom properties on a control
    If you output $control and $control.getProperties() to the html you can lookup the API for the used classes.
    I can't give an example of the html because it's stripped in this forum
    Edited by: Peter van de Riet on 20-mei-2011 14:18

  • How do I access the name of the file stored in a custom attribute?

    I have created a custom attribute based on a file type and am using it in a custom page type. However, the value stored in wwsbr_folder_attributes is a sequential number rather than the name of the jpg file entered into the attribute. How do I access the true filename, as this seems to be what I need in order to reference it in an <IMG SRC=> tag?

    Hi Francis -
    You should be able to use this relatively use this sequential number in an image tag in the following way:
    <img border="0" src="docs/1/211800.GIF" width="470" height="108">
    Hope this helps,
    Candace

Maybe you are looking for

  • How can I change a brush stroke to a pencil stroke after I've drawn it?

    How can I change a brush stroke to a pencil stroke after I've drawn it? Is this possible?

  • With DB02 tcode, DB file in red color & status gives No free space

    Hi Experts, With DB02 transaction --> in File tab it is showing all Database files with red color and in the status message gives "No free space in file". Below is details for your reference Logical file name used by SQL Server:  DEVDATA1 File size i

  • Sleep/Standby makes resolution changes to lowest setting

    Recently almost every time I turn my computer on after it going into sleep it ends up switching to the lowest resolution available (800x600). I can't figure out why exactly it's doing this. It's very annoying because when it resizes, it will move my

  • Printing columnar data on a JTextPane

    How can I format and print columnar data like data from a resultset and then formatting it so as to appear in tabular format while using the Document interface derived from a JTextPane. I would like to align data on the columns e.g. centered, left, o

  • How do I fix that spot from the Forehead?

    Hello Everyone, How do I fix that White Color spot from the Forehead? (white_patch_RedStroke.jpg) (white_patch.jpg) I know "Clone Stamp" tool. But alas, it's looking fuzzy and disorder... (white_patch_CloneStampTool.jpg) Please suggest... Thanks!