Type Mapping in Web Dynpro

Hi there,
rather a Web Dynpro newbie, I have scanned the documentation and forum threads to find whether there is something like a type mapping mechanism (say, your web service automatically creates Calendar attributes from xsd:dateTime elements, and you want to display them as dates in your view), but it seems there isn't.
I have to do such type conversions by myself (by providing additional value attributes to my context node and populate them after executing the service call), right? Or did I overlook something?
Regards
Nils

Hi Nils,
define calculated context attributes of type readOnly=false for this purpose. In the generated getter and setter methods you can implement your own format (getter) and parse (setter) logic (or type mapping like you call it).
Excerpt from the Web Dynpro Help:
<i>Application-specific validations: You can use the setter and getter methods that are generated for writable calculated context attributes to format as well as parse and validate data application-specific. You can check the user input in the mutator method and save it in a separate, non-calculated context attribute. An error message is displayed if this is not successful. If you want to display the input value in the case of errors as well, then first you have to save the incorrect value in an additional usual context attribute, from which the access method of the calculated attribute is then supplied.</i>
Also read thread Re: Problem with time input field about problems with time input fields.
Regards, Bertram

Similar Messages

  • Creating Client-side Image Map in Web Dynpro

    Hi,
    How can I create a client-side Image Map in Web Dynpro application?
    My application consists of a screen-size image in which several areas will have to link to URLs and actions. I have browsed through the "Web Dynpro UI Element Reference Guide," but could not find anything appropriate.
    Can someone give me an advice? Thanks.
    Teecheu

    It doesn't, there is no corresponding UI control for this.
    There is only onAction event on BusinessGraphics (have not working with them since SP5, eventing did not work at that time) and onObjectAction in GeoMap (never see it in action, probably an option for you if your map is geographic map
    WBR,
    VS

  • Geo MAP in Web dynpro Application

    Hi all,
       we are trying to test the GeoMap Functionality in SAP Help we found that some Software Component is required to run the Geo Map Web Dynpro Application as given below
    "The GeoMap UI element can only be used with a special software component that is provided by the geographical maps.
    This software component which you can use to expand the Internet Graphics Service (IGS) is not included in the delivered SAP Web Application Server package. It must be purchased from a third-party provider. The GeoMap UI element cannot be displayed without this complementary software component. "
    can u help me with some pointers to these third party providers.
    Regards
    Sai Krishna Reddy

    Hi Sai,
    you can see the following tutorial
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on using geo services with web dynpro - 22.htm
    for GeoService information you can visit the following sites
    1.  http://www.geomap.com/
    2.  http://www.nacgeo.com/geoservices.asp
    Regards,
    Shubhadip

  • Date type attribute in web dynpro callable object

    Hi all,
    I am creating a callable object with date type attribute as input parameter in a web dynpro callable object.
    date type I have used is java.sql.date.
    But when I am exposing that callable object in GP its giving an error:
    Technical Exception:
    Web dynpro Component cannot be created.
    And when i am changing date type as java.util.date then I am not able to asssign that date attribute in my view layout.
    Can anyone plese help me.

    Hi Ritu ,
               u have to convert the util date to sql date in the execute method .
    do it as showm below in Execute method in the component Controller :
    let the Attribute be planEndDate in the Context:
    public void execute( com.sap.caf.eu.gp.co.api.IGPExecutionContext executionContext )  {
    java.util.Date planEndDate = null;
    planEndDate = (java.util.Date) inputStructure.getAttributeAsDate(IContextElement.PLAN_ENDDATE);
    java.sql.Date sqlDate = new java.sql.Date(planEndDate.getTime());
                        wdContext.currentContextElement().setPlanEnddate(sqlDate);
    Thanks and Regards

  • UI-Type using the Web Dynpro Dode Wizard

    Hi,
    every time i use the Web Dynpro Code Wizard and choose the Form i still get the UI-Element-Type "InputField". Is it possible to select ohter Element-Types for example DropDownByIndex or Text_Edit?
    i hope we can fix this.
    best regards,
    Michael

    Ofcourse you ca change it to UI-type that you want.
    change the Standard Cell Editor to DropDownbyKey all the UI elements will change(Default it will be InputField because most of the forms contains more number of InputFields ), also you can change the individual context attribute UI type also by changing the CellEditor of a table Column.
    Abhi

  • Parse method is not possible for this type Exception in web dynpro

    I have a file upload component and one button in a view.
    I have created a binary type context element and mapped it with fileupload component.while clicking the submit button I am getting " Parse method is not possible for this type" exception.
    help me out.

    Hi sridhar,
    Use this code for Upload
    context u create one attribute(up),u assign the data type as "Resource"(which is dictionary type)
    InputStream text = null;
        int temp = 0;
        try
             File file = new File(wdContext.currentContextElement().getUp().getResourceName());
             FileOutputStream op = new FileOutputStream(file);
             if(wdContext.currentContextElement().getUp()!=null)
                  text = wdContext.currentContextElement().getUp().read(false);
                   while((temp=text.read())!=-1)
                                                                       op.write(temp);
             op.flush();
             op.close();
        catch(Exception e)
         e.printStackTrace();   

  • Context Mapping in web dynpro

    Hi,
    Steps which I underwent for context mapping is:
    1. Opened view designer for start view .
    2. Choose the context tab.
    3. Opened the context menu for the root node context n choosed the option New->Value attribute.
    4. entered the name for the attribute such as name n choosed finish.
    5. From the context menu for the attribute Name choose Edit Context Mapping.
    Problem is in my case "edit context mapping" is disable.
    Regards

    Hi
    u have to add the Component Controller In the required Controllers List of the view
    thwn u fill find the it enabled.
    Suppose u want to map the value Attribute in the view to that of the Attribte in the Component Controller then add that ComponentContolle Name in the required Controllers of the view
    ur Component controler shuld also have the Value Attribute of same data type.
    u can go properties of the View there u have required Controllers and Add Button click on that and add ur controller Name

  • Dynamic Context Mapping in Web Dynpro ABAP

    Hi Experts,
    How can I create two dynamic Context nodes, one in ViewController and the other in Component Controller and finally create a context mapping between them?
    Regards,
    Johan Kriek.

    Hi Johan,
    I found a method IF_WD_CONTEXT_NODE_INFO~ADD_NEW_MAPPED_CHILD_NODE that seems to be the one that I am looking for.
    I do have same idea but i have been trying to give solution by using above method,unfortunately here my server is down.check the below code. i didnt check this code due to server down.
    DATA: lo_nd_purchase_header TYPE REF TO if_wd_context_node,
          lo_el_purchase_header TYPE REF TO if_wd_context_element,
    ls_purchase_header TYPE wd_this->element_purchase_header,
          lo_node_info type ref to if_wd_context_node_info,
          lo_child_node_info type ref to if_wd_context_node_info,
          MAPPING_INFO type WDR_CONTEXT_MAPPING_INFO.
    * navigate from <CONTEXT> to <PURCHASE_HEADER> via lead selection
      lo_nd_purchase_header = wd_context->get_child_node( name = wd_this->wdctx_purchase_header ).
                  CALL METHOD LO_ND_PURCHSE_HEADER->GET_NODE_INFO
                    RECEIVING
                      NODE_INFO = lo_node_info.
           MAPPING_INFO-controller = 'ZWDC_ALV'. "conponent name
           MAPPING_INFO-path = 'PURCHASE_HEADER'. "Controller context node name
          CALL METHOD LO_NODE_INFO->ADD_NEW_MAPPED_CHILD_NODE
            EXPORTING
              CHILD_NAME      = 'PURCHASE_HEADER'
              MAPPING_INFO    =  MAPPING_INFO
    *          IS_STATIC       = ABAP_TRUE
            RECEIVING
              CHILD_NODE_INFO = lo_child_node_info

  • Extranal contex mapping in web dynpro java 7.0

    hi,
    how to declare the usage of other webdynpro DC,how to pass data between the two DCs and Difference between External Context mapping and Normal mapping with working example.can any one send pdf
    G.srinu

    Hello Srinu,
    Refer the followings:
    For External Mapping and Context Mapping
    External Context Mapping
    context mapping
    For Used DC Context Mapping
    How to pass data to a used DC.
    Regards
    Nizamudeen SM

  • Google Maps inside Web Dynpro

    I've been trying to run Google Maps inside Webdynpro ABAP but I'm faced with a problem.
    In a normal HTML page with flash component I use Flashvars to send the API key to the component, but in SAP I can't use them. The result is API key error.
    I've got the key inside the SWF but it doesn't work without Flashvars. Is there a way to use them?
    EDIT: So, I put the HTML file in the root of the site, instead of a subfolder and now it works....weird. The question then is, to use google maps in a Webdynpro which URL to I need to register the API key for.
    EDIT2: It was a cache problem....the "folder site" was store in cache. It works fine now.

    Hi
    I have seen no documentation supporting Google Chrome for SAP WD applications
    Therefore end user issues may occur
    However if you have evidence to the contrary let me know
    Best wishes
    Stuart

  • Data node mapped to  Adobe Form empty - Web Dynpro ABAP

    Hi,
    I've created a web dynpro component in ABAP. One of the view contains an interactive Adobe form.
    Form properties : Data source and pdf source are mapped
    Enabled checked
    Submit action mapped to a method. This method reads the node mapped to the form.
    Form Layout: Used ZCI Layout and Inserted web dynpro script (XML interface)
    Dragged attributes from data view to create text fields.
    Submit button used from Web dynpro native group
    I could not read data from the form.
    When I submit the form, data is not captured in the context.
    I have used the same context for view and could save the data from the view. But from the adobe form, I cannot read the data.
    Is there anything I missed. I have been on this since 2 days with no solution. I dont see any mistake but the form doesnt work.
    Version: Adobe Designer : 8.1 (from market place)
    SAP Netweaver 2004s SP18
    Any help on this is appreciated.
    P.S. Used all possible help from SDN existing posts and SAP notes.
    Thanks in advance,
    Srinivas

    Hi Srinivas,
    place a button on webdynpro view it self then try.
    make sure your form is working in interactive mode.
    else keep this conde in modifyview method.
    method WDDOMODIFYVIEW.
    data: LR_INTERACTIVE_FORM type ref to CL_WD_INTERACTIVE_FORM,
    LR_METHOD_HANDLER type ref to IF_WD_IACTIVE_FORM_METHOD_HNDL.
    check first_time = abap_true.
    LR_INTERACTIVE_FORM ?= VIEW->GET_ELEMENT(u2018<<ID_OF_YOUR_UIELEMENT>>u2019).
    LR_METHOD_HANDLER ?= LR_INTERACTIVE_FORM->_METHOD_HANDLER.
    LR_METHOD_HANDLER->SET_LEGACY_EDITING_ENABLED( abap_true ).
    endmethod.
    or try these links
    For More Information look at the link below.
    http://help.sap.com/saphelp_nw70/helpdata/en/2c/241a427ff6db2ce10000000a1550b0/frameset.htm
    Please look into SAP Notes: 1229392
    You can also look at the elearning below:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/media/uuid/c766e918-0b01-0010-99b1-c2b78cd059b3
    Regards,
    Mahesh

  • URGENT: Illegal Argument Exception for  RAW data type in Web Dynpro

    I am getting this error in the following scenario.
    I want to save the text fields from an interactive form to SAP through RFC enabled function module. The type in the model and controller is byte[]. I have converted the string attribute from view to save to the model. But the model dictionary in Web Dynpro project (model) has this type as Binary (meta data model through EFC). The type in SAP is RAW. I am going nuts since a week to solve this.
    IS this a bug? I am using NW04s - SP12. and NWDS 7.0.9
    Exception Details:
    The initial exception that caused the request to fail, was:
    java.lang.IllegalArgumentException
    at com.sap.dictionary.runtime.DdTypeBinary.format(DdTypeBinary.java:60)
    at com.sap.dictionary.runtime.DdTypeBinary.toString(DdTypeBinary.java:64)
    at com.sap.tc.webdynpro.clientserver.data.DataContainer.doFormat(DataContainer.java:1405)
    at com.sap.tc.webdynpro.clientserver.data.DataContainer.getAndFormat(DataContainer.java:1098)
    at com.sap.tc.webdynpro.clientimpl.xdp.renderer.data.XfdRenderer.renderAttributes(XfdRenderer.java:370)
    ... 41 more

    Issue with the RAW data types is resolved now. I have changed the data type of the field into String in the dictionary (web dynpro).. I have changed the corresponding getters and setter functions from byte[] to string. And everything working fine now. I got the Illegal Argument exception initially because I was trying to display the binary data type fields on the adobe form or view which I am not supposed to do.
    Also it is better to create separate view attributes in the context to get the values rather than mapping the model attributes directly in the form or view.
    Thank you one and all.
    Regards
    Vasu

  • Custom Enumeration Type and Dropdown in Web Dynpro Java

    Hi Everyone!
    I have developed a custom enumeration type named com.agile.pmg.politicrh.customtypes.status.
    I can see correclty the dropdown with the enumeration in Service Browser with all values I have put, but I need to be able to see these values in web dynpro too. But if I create a attribute of type com.agile.pmg.politicrh.customtypes.status in web dynpro and map it to a dropdown, it doesnt show anything. The enumeration is empty.
    Does anyone know what is the problem?
    Bests Regards!
    Luiza

    Hi,
    Check out this link, might be of help
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/504540a4-fd0d-2a10-7c8e-c88289cf6457|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/504540a4-fd0d-2a10-7c8e-c88289cf6457]
    Regards,
    Ashutosh

  • Returning an array type from a local method in Web Dynpro Java application

    Hi,
    In my project, we have a requirement to display 18 rolling months along with the year, starting from current month.
    How I am going to approach is that I will get the system date and get the current month and send the month and year value to a local method which will return 18 rolling months along with the year.
    But, when I tried to create a new method there is no option to return an array type. It was greyed out.
    So, we can not return an array type from a method from Web Dynpro for Java application?
    If so, what is the alternative and how am I going to achieve it?
    I will appreciate your help!
    Regards
    Ram

    HI
    You can create new methods in
      //@@begin others
      private ArrayList MyMethod(){
           // ** Put your code here
           return new ArrayList();
      //@@end
    Other option are create a context node with cardinality 0...n with one or more attributes, and in your method create the needed registers into this node. To read this values, you only need to read your context node.
    Best regards
    Edited by: Xavier Aranda on Dec 2, 2010 9:41 AM

  • WDVisibility type paramter in Java Bean(Web Dynpro DC in CE 7.1)

    Hi All,
    I need to set a WDVisibility type paramter in a java bean and i am able to do so.It imports com.sap.tc.webdynpro.progmodel.api.WDVisibility class .
    The problem is when i am creating a Java Bean model  it is not allowing me to select the Java bean class it gives an error message" Invalid Class : No class files found for JavaBean : com/sap/tc/webdynpro/progmodel/api/WDVisibility".
    The java Bean class exists in Web Dynpro DC>src folder.
    Any Pointers?
    Regards
    Avinash

    Hi Ondrej ,
    Refer the above links to convert the component of the first dc as a public part.
    Then declare the methods which are written in the component controller of the first DC in the interface controller with the same signature.( When method is called automatically component controller method is called)
    In second dc in component controller properties tab add the reference of the first dc.
    Then access the method in second dc as
    wdthis.wdget<UsedComponent name>Interface.methodname();
    Thanks & Regards,
    Ardhendu

Maybe you are looking for

  • How to use Spry and Jquery on the same page.

    I'm using both spry (dataset) and jquery (datepicker) on my page. When I load the jquery script my dataset doesn't work. I've done some research and found that I need to insert an observer that tells jquery when the spry dataset is finished loading.

  • JMS Adapter configuration error

    Hi All       My scenario is file to jms.i configured the webspher MQ and i created queues manager and channals.I done JMS receiver like this, 1)Transport protocol:WebspherMQ JMS provied 2)Message porotocol:JMS x.1 3)Adapter Enigen:   Integration Serv

  • af:convertDateTime pattern="#{nls.datepattern}"/ not working

    Hi friends; Some pages selectInputdate items <af:convertDateTime pattern="#{nls.datepattern}"/> property is working but some pages it isnt working. I want to use datepattern same in all pages like dd/MM/yyyy but some pages date fields value came to b

  • User specific transaction varient

    Dear all, I am having a requirement, for the tcode J1IH the posting date should be made as display field for all users except for one specific user. 1) For the above requirement i have kept 2 transaction varient. 2) One varient is used to make posing

  • Time Machine crashes when selecting a date to restore from

    TM opens up fine, and allows me to scan through all available hours/days of backups. However, when I select a day to restore from, instead of the Finder window scrolling to that date, TM quits immediately. Any steps I can take to access my backups?