BC4j-- unable to set date type attribute in a row

when i m set a attribute which is of date type in row of a view.
it is giving me error " cannot create object of date type"
i'll apreciate the answer to this problem
thanx

<%
SimpleDateFormat databaseFormat = new SimpleDateFormat();
SimpleDateFormat viewFormat = new SimpleDateFormat();
databaseFormat.applyPattern("yyyy-MM-dd");
viewFormat.applyPattern("MM/dd/yyyy");
// to convert &#8220;MM/dd/yyyy&#8221; to &#8220;yyyy-MM-dd&#8221; for updating database
String date_view=&#8221;12/31/2001&#8221;;
String date_db=new String(databaseFormat.format(viewFormat.parse
(date_view)));
...setAttribute(column_name,date_db);
%>

Similar Messages

  • How to set default value to date type attribute.

    Hi,
    How to set default value to date type attribute.
    E.g I want to set u201C01/01/1999u201D to date attributes.
    First i want to set value and then i want to fetch the same & want to check equals.
    please suggest solution.
    Regards,
    Smita

    Hi,
    In wdinit() method u can set the date
    DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
    Date today = Calendar.getInstance().getTime();
    String reportDate = df.format(today);
    wdContext.currentContextElement().setFromDate(reportDate);
    Another way you have set the this formate like that
    1. Create a Simple type under "Dictionaries->SimpleType" called DateFormat
    2. Select the type as "date"
    3. Go to the "Representation" tab and set the format as "dd/MM/yyyy" (or whatever u want, but month should be MM)
    4.Bind the context attribute to the type created now.
    Hope this helps u.
    Best Regards
    Vijay K

  • 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

  • Error deploying EJB on weblogic: Unable to set the transaction attribute

    Hi,
    I'm trying to deploy an application in WL10.3.2 and an error occurred during activation of changes.
    Here is the error message from the log file:
    <Jun 6, 2011 1:28:27 PM MDT> <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'serverEAR-2' due to error weblogic.application.ModuleException: Exception preparing module: EJBModule(serverEJB-2.8.0.jar)
    Unable to deploy EJB: C:\oracle\Middleware\user_projects\domains\base_domain\servers\Server_3\tmp\_WL_user\serverEAR-2\1zw7ao\serverEJB-2.8.0.jar from serverEJB-2.8.0.jar:
    Unable to set the transaction attribute for method 'saveActionGroup(EditableActionGroup)' on EJB 'ViewBean'. No matching method could be found. Please verify the method signature specified in the ejb-jar.xml file matches that of your Remote interface for this EJB.
    weblogic.application.ModuleException: Exception preparing module: EJBModule(serverEJB-2.8.0.jar)
    Unable to deploy EJB: C:\oracle\Middleware\user_projects\domains\base_domain\servers\Server_3\tmp\_WL_user\serverEAR-2\1zw7ao\serverEJB-2.8.0.jar from serverEJB-2.8.0.jar:
    Unable to set the transaction attribute for method 'saveActionGroup(EditableActionGroup)' on EJB 'ViewBean'. No matching method could be found. Please verify the method signature specified in the ejb-jar.xml file matches that of your Remote interface for this EJB.
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:454)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:391)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:59)
         Truncated. see log file for complete stacktrace
    Caused By: weblogic.ejb.container.deployer.DeploymentDescriptorException: Unable to set the transaction attribute for method 'saveActionGroup(EditableActionGroup)' on EJB 'ViewBean'. No matching method could be found. Please verify the method signature specified in the ejb-jar.xml file matches that of your Remote interface for this EJB.
         at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.processCTs(MBeanDeploymentInfoImpl.java:1502)
         at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.processSpecificMethodCTs(MBeanDeploymentInfoImpl.java:1472)
         at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.initializeTransactionAttribute(MBeanDeploymentInfoImpl.java:773)
         at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.<init>(MBeanDeploymentInfoImpl.java:259)
         at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1190)
         Truncated. see log file for complete stacktrace
    Please help me...Thanks.

    In your ejb-jar.xml you are referring to a method saveActionGroup(EditableActionGroup) which is not defined in your remote interface.
    Maybe you have made some typo in the configuration. Check your transaction section, i.e.,
    <container-transaction>
                <method>
                    <ejb-name>ViewBean</ejb-name>
                    <method-name>saveActionGroup</method-name>
                    <method-params>
                        <method-param>package.EditableActionGroup</method-param>
                    </method-params>
                </method>
                <trans-attribute>Required</trans-attribute>
    </container-transaction>or something similar. See if the defined methods are corresponding to the methods defined in the remote interface.

  • "[Oracle][ODBC]Restricted data type attribute violation

    Hi,
    I have a program that use the database object,TQuery in Borland C++ Builder 5 to access information on an Oracle8i table. The program was working fine until I updated the Oracle8i ODBC driver from 8.1.5 to 8.1.6.
    I am getting the error :
    "[Oracle][ODBC]Restricted data type attribute violation."
    I can't see what I have done wrong with the SQL statement in the query as it is only a select * from table statement. Can anyone help me with this ? Thank in advance.
    C.M.

    I think I had found what is causing the problem. It looks like the latest Oracle ODBC driver doesn't like any table that
    consists of any 2 fields of type NUMBER but with 1 of them having
    NOT NULL. >example : >Name Null? Type>-------- --------
    ----------------- NO1 NUMBER>NO2 NOT NULL NUMBER>I think this is
    a bug. >null
    I am not sure what you mean by the statement
    "the latest Oracle ODBC driver doesn't like any table that
    consists of any 2 fields of type NUMBER but with 1 of them having
    NOT NULL"
    Do you mean there cannot be two not null number columns in a
    table witht he latest Oracle ODBC driver.
    I am running into the same problem as you did. I am getting a
    restricted type violation, and have isolated the column and it is
    a number(x,y). I have the the Oracle Client 8.01.06.00 driver
    and I have PowerBuilder8.0 as the GUI.
    Any help would be much appreciated,
    Thanks in advance,
    Khanh

  • How can i validate(compare) two date type attribute in EO.

    Hi All,
    jdev version 11.1.2.1.0
    i have created one EO where two date type attribute ToDate and FromDate now i want to add validation rule.
    which validate that difference b/w ToDate and FromDate not more than 3 month.
    How can i validate this?

    You can create script expression
    Something like
    if((toDate.getTime()-fromDate.getTime())/(1000 * 60 * 60 * 24)>30)
      return true;
    else
      return false;-Arun
    P.S : Above example calculates based on number of Days (30). If you want 3 months, you need to put a logic - Simply 90 days? What about the months with 31 days and 28/29 days? etc.

  • To find the date type fields in the row and validate those date fields

    TYPES : BEGIN OF TY_MARA,
              MATNR TYPE MARA-MATNR,
              ERSDA TYPE MARA-ERSDA,
              ERNAM TYPE MARA-ERNAM,
              LAEDA TYPE MARA-LAEDA,
              MTART TYPE MARA-MTART,
            END OF TY_MARA.
    DATA : it_mara TYPE STANDARD TABLE OF ty_mara,
          it_mara1 TYPE STANDARD TABLE OF ty_mara,
           wa_mara TYPE ty_mara.
    loop at it_mara into wa_mara.
      describe field wa_mara-ersda type c_data.
    if c_data eq 'D'.
      CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
        EXPORTING
          date                            = wa_mara-ersda
       EXCEPTIONS
         PLAUSIBILITY_CHECK_FAILED       = 1
         OTHERS                          = 2
      IF sy-subrc eq 0.
    wa_mara-ersda = '00000000'.
        append wa_mara to it_mara1.
        write :wa_mara-matnr,wa_mara-ersda.
        else.
            wa_mara-ersda = '00000000'.
        append wa_mara to it_mara1.
        write :wa_mara-matnr,wa_mara-ersda.
      ENDIF.
      endif.
      endloop.
    This issue regarding how to find the date type fields in the row and validate those date fields.If its not a valid date ,i have to assign initial value to that.
    I've tried that for single field using describe field.Please help me do that for all fields.

    Hi Sam,
     I believe we had discussed the same issue in the below thread. Can you please refer the below one?
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d93e16ff-c123-4b36-b60b-60ccd34f6ca7/calculate-time-differences-in-infopath?forum=sharepointcustomizationprevious
    If it's not helping you please let us know
    Sekar - Our life is short, so help others to grow
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer

  • Set xsi:type attribute

    Hi All,
    I have a requirement where I need to set the xsi:type attribute to some value before I submit the SOAP request from SAP PI.  I have not been able to figure out where how to set the value of this attribute.  I have an XSD that I am using to generate the request, but I do not see anywhere in the mapping tools where I can assign this value.  I tried using MAP Force to do XSLT mapping but couldn't really make that happen using that either...
    This is how I would like the request message type to have...
    <m:sObjects xsi:type="ns3:Account" xmlns:ns3="urn:sobject.enterprise.soap.sforce.com">
    but this is how it comes...
    <m:sObjects>
    Any tips and ideas to make this happen would be highly appreciated...
    Regards,
    Jawwad

    hi,
    there are at least two places where you can do it:
    a) inside a mapping using XSLT
    b) write an adapter module that will add this to your call and put it in receiver soap adapter
    Regards,
    Michal Krawczyk

  • Set data type property

    Hi all.
    I'm on devsuite 10g.
    Is there a way to set the data type property of an item at runtime???
    Thanks all for the collaboration,
    Fabrizio

    You can't it's a design time only construct

  • Validation on Integer data type attribute

    Hi,
    Working on jdev 11.1.1.3.0
    I have to do validation on integer data type like, it should not allow 13.20(only single digit numbers.).
    I am doing validation on AMImpl and converting the int into string
    String per=Row.getPer().toString();// here if user enter 13.20, then per containing only 13 so its not going to inside if.
    if(StringUtils.contains(per,"."))
    return false;
    Even i have written regular expression on my field but its working
    can any one help me.

    Hi,
    Why don't you use the af:convertNumber in your tag?
    Something like that:
    <af:inputText>
    <af:convertNumber>
    </af:inputText>
    Doc: http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_convertNumber.html
    Regards,

  • Unable to set default table attributes in Keynote

    I've been trying to change the default table attributes in one of my themes, and as per the description in the Keynote manual (page 237-8), this should be a straightforward process:
    1) In the slide navigator, create a new slide.
    2) If you're setting up default attributes for a particular master slide (rather than all the masters in the current theme), click Masters in the toolbar and choose the master slide. [I want to change the table attributes in all master slides in the particular theme, I skip this step.)
    3) Place a table on the slide.
    4) Select the table and set its attributes.
    5) Do one of the following: To make the table the default for only the current master slide, choose Format>Advanced>Define Table for Current Master. To make the table the default for all masters slides in the current theme, choose Format>Advanced>Define Table for All Masters.
    6) If you don't want the table on the slide, delete the table.
    Step 1) through 4) is unproblematic, but the second I try to execute step 5), the new formatting is all mixed up, and I am left with a table that looks nothing like the one I have just created in step 4). (Choosing to make the new table layout valid only in the current master doesn't help.)
    Any thoughts on how to sort this out would be greatly appreciated!  I should mention that following a similar procedure for diagrams works like a dream.

    Hi!
              We have same problem!
             The layout can be selected in application, but it is not taken as default.
         We appreciate your feedback
    Best Regards.
    Angelica

  • Entity DATE type attribute : Derieved From SQL Expression for date format

    Hi,
    I want to set one of the Entity's Date Attribute with specific format , for e.g DD-MM-YYYY
    I see a Derieved From SQL Expression checkbox, how can I define the SQL Expression
    can I use TO_DATE(EMP_START_DATE,'DD-MM-YYYY'), I want to insert a date in that format, when I am creating a row using viewObject.createRow()
    Java Type is oracle.jbo.domain.Date which take YYYY-MM-DD as a string, I do not want to use this format
    Thanks,

    Here is a solution, but I am sure it is not the best one. It will work in a hurry. Maybe you can create a helper method to generalize this conversion until something more succinct comes along for US:
    This code assumes an import of jbo.oracle.domain.Date.
        public void updateDateTest () {
            AddressesViewImpl lVO = (AddressesViewImpl)this.getAddressesView1();
            AddressesViewRowImpl lRow = (AddressesViewRowImpl)lVO.first();
            System.out.println("create date for current record is currently: " +
                               lRow.getCreationDate());
            java.util.Date today = new java.util.Date();
            SimpleDateFormat dateFormat =
                new SimpleDateFormat("dd-MM-yyyy");
            SimpleDateFormat jboDateFormat =
                new SimpleDateFormat("yyyy-MM-dd");
            String lSampleDateString = "15-04-2010";
            java.util.Date lSampleDate = null;
            try {
                lSampleDate = dateFormat.parse(lSampleDateString);
            } catch (ParseException e) {
                System.out.println("Parsing exception thrown:  " + e.getMessage() +
                                   "\n ==> caused by \n==>"+ e.getCause().getMessage());
                lRow.setCreationDate(new Date(jboDateFormat.format(lSampleDate)));
            System.out.println("about to commit; create date for current record is currently: " +
                               lRow.getCreationDate());
            this.getDBTransaction().commit();
            System.out.println("resetting to some other date; create date for current record is currently: " +
                               lRow.getCreationDate());
                lRow.setCreationDate(new Date(jboDateFormat.format(today)));
            this.getDBTransaction().commit();
        }I defined this code in my Application Module Impl file and ran it with the BC tester. Here was its output:
    Mar 18, 2010 8:27:54 AM oracle.jbo.jbotester.MainFrame main
    INFO: BC4J Tester started.
    Source breakpoint occurred at line 66 of FusionExperimentsAMImpl.java.
    create date for current record is currently: 2009-02-02 12:09:54.0
    about to commit; create date for current record is currently: 2010-04-15
    resetting to some other date; create date for current record is currently: 2010-04-15I spent a little time looking around the forum for additional solutions. I think several years ago I even wrote a blog entry on this subject. If I remember how to do this right I will amend with more information.

  • Unable to set Data in MODEL NODE ??????

    Hello All,
    I have created a Web Dynpro application which makes  RFC or BAPI calls.
    I need to <b>pass data to the BAPI as input parameter, but am failing to do so.</b>
    The Context structure for the model node is as follow -
    Level1 - Z_Mm_XXX_Input
    Level2 - Output_Repo
    Level3 - T_Plants_Selected_Repo of structure type "Werks"
    and supplying function "T_Plants_Selected"
    This contains the model attribute as Werks.
    Now i need to send this Werks attribute and pass it to the BAPI
    I have written the following piece of code -
    Z_Mm_XXX_Input zbapi_ip =
                   new Z_Mm_XXX_Input();
    com.xxx.Werks plants_sel = new com.xxx.Werks();
    plants_sel.setWerks("4522");
    zbapi_ip.addT_Plants_Selected(plants_sel);
    wdContext.nodeZ_Mm_Cmet_Report_Contrctr_Cse4_Input().bind(zbapi_ip);     
    The attributes for the model node Z_MM_XXX_input node is -.
    cardinality - 0..1
    selection - 0..1
    singleton - true
    The attributes for the model node Output_Repo node is -
    cardinality - 0..1
    selection - 0..1
    singleton - true
    The attributes for the model node T_Plants_Selected_Repo node is -
    cardinality - 0..n
    selection - 0..1
    singleton - true
    Still am not able to pass data to the model node.
    Am really confused what could be the probable mistake.
    Please let me know what have i missed out.
    Thanks in advance,
    Samta

    hi,
    i've the same problem,
    i can't set my input data to the BAPI.
    i've you the solution ?
    thanks
    PS here is a part of my code
    public void executeBapi_Wd_Tut_Listuser_R3_Input( )
        //@@begin executeBapi_Wd_Tut_Listuser_R3_Input()
              try {
                   Bapi_Wd_Tut_Listuser_R3_Input input =
                        new Bapi_Wd_Tut_Listuser_R3_Input();
                   Zuname nom_start = new Zuname();
                   Zuname nom_end = new Zuname();
                   nom_start.setUname("P*"); //hard coded for the moment...
                   nom_end.setUname("Q*");
                   input.setUname(nom_start);
                   input.setUname_End(nom_end);
                   wdContext.nodeBapi_Wd_Tut_Listuser_R3_Input().bind(input);
                   wdContext
                        .currentBapi_Wd_Tut_Listuser_R3_InputElement()
                        .modelObject()
                        .execute();
                   // Synchronise the data in the context with the data in the model
                   wdContext.nodeOutput().invalidate();

  • Setting data type of an object at run time

    This is something of an advanced problem, so I hope there's
    someone out there who can speak to this. I apologize for the length
    of the post, I'm just trying to be clear about a rather unclear
    conundrum. --
    We all use arrays to hold collections of things. As you know,
    an array is its self a type (Array) and so there is no way to
    declare, for instance, an array of MovieClips or an array of
    Strings. Heres what happens: lets pretend that we have 3 movie
    clips clip1_mc, clip2_mc, and clip3_mc, and an Array called
    anArray. so we can legally do this. anArray.push( clip1_mc );
    anArray.push( clip2_mc ); anArray.push( clip3_mc );. An array of
    size 3. Now the code: trace( typeof anArray[0] ); will output
    "object." This can be a problem. If you try this: var
    newClip:MovieClip = anArray[0]; you get a type mismatch from the
    compiler. "Found Object where MovieClip is required." It
    necessitates this: var newClip:MovieClip = MovieClip( anArray[0] );
    Bummer no?
    Ok. So fast forward. Lets assume a class List that uses an
    array to hold the items in the list. So the class uses the Array
    class in "composition." So you have methods like insert( ); and
    retrieve(). Retriece() returns an item from an index in the array.
    Because of the aforementioned problem, no matter what type the
    thing was going into the list it comes out with type Object because
    the retrieve function must return an item of some type, the only
    option is to declare the return type of the retrieve() function as
    Object. Lets say you know that this is a list of Strings. You could
    write the retrieve()'s code like: return String( returnItem ); And
    type the object "on the way out" .. but what if you want the list
    to work with any type object, you would have to have a variable to
    hold the desired type of objects in the list. And then as the
    objects are being returned, you'd cast them to the type stored in
    that variable. I guess that you'd pass the type to the constructor
    of the List: var aList:List = new List( "AddressCard" ); -- That
    should declare a List (Array) of AddressCards.
    Is there a way to do this? have the type specified in casting
    be dynamic?
    And the flip-side of that is detecting the name of the class
    of an object instance. The thing here would be to try to derive a
    String from the name of the constructor function. (which is always
    the class name) In actionscript 3 there is a service package--
    mx.util -- I think, that has a function to return the qualified
    class name of an object. But is there a jimmy rig for this in AS2?
    My actual project does not use an Array to implement List. (
    or Stack ) It uses a structure called a "linked list" - which is a
    whole other topic, but same problem as with Arrays is also present
    in the linked list versions and so requires the same solution. If
    one is willing to type things explicitly when assigning an item in
    the list to a variable of some type, this thing is quite excellent.
    But I don't like it. I have the package with docs, code, sample
    fla's, diagrams and everything that I would encourage people to
    download, look at, try and whatever and then come back here with
    any thoughts on it. There is a component with Flash professional
    that is a list like structure, but it's so general that it crosses
    the line into bloat. Ie: if you are using a list as a stack, you
    only need getTop() and pop() and push() not all the other (12 or
    so) methods in the class. Mine are patterned after structures from
    the C++ standard template library. And the code style is C++, but I
    think it's actually easier to read that way.
    the files:
    http://www.null.bz/ADL_Lib/ADT_Lib.zip
    Thanks in advance, for your efforts! I really appreciate all
    of it, helpful or not.

    First reactions:
    >>var newClip:MovieClip = MovieClip( anArray[0] );
    Even though you must use a cast to prevent the compile time
    error, you don't get an error on this line because the compiler
    skips typechecking for values accessed with the [] operator.
    >>Is there a way to do this? have the type specified in
    casting be dynamic?
    Nope. You must effectively type check all objects used
    through array elements yourself.
    Reading on...

  • Check box with Boolean data type is not behaving properly

    Hi,
    I create a sample application with one entity driven view object with two attributes. One is of String data type [Value will be Y/N] and another (transient) attribute with Boolean data type. I planned to bind this boolean data type attribute to UI. I overridded the view row impl class and included setting of boolean attribute inside the setter of String attribute. Also in the getter of boolean attribute, added code to check the string attribute and return true/false based on that. Everything is working fine in application module tester. But when i test the same in view controller project in a page, it is not working. Always Check box component is not checked eventhough when i explicitly check it.
    [NOTE: I have given the control hint of Boolean attribute as check_box. Also i don't want selected/unselected entries in the page def file. That's why followed this approach]
    Have i missed out anything? Why this behaviour.
    Thanks in advance.
    Raguraman

    what is the value that is going in when u check it.. did u debug it.. is the viewRowimps setter and getter getting called.. and is it having the right value set and got.. and ur sure that ur using selectBooleanCheckBox..
    ur binding the checkbox to the transient value right??

Maybe you are looking for

  • Adobe acrobat 6.0 document pages insert

    Hello! I cant insert a word document into the pdf. It seems to be right but it doesnt work and I dont know why.Thanks.

  • BI Content Install SHORT DUMP

    HELP! I am trying to install BI Content on a newly installed netweaver Box.  We are running BI 7.0 with SP 15 and BI_CONT 703 SP 5.  This is the error: Runtime Errors         ASSIGN_LENGTH_0 Date and Time          2008/02/18 12:55:36 Short dump has n

  • 3G blocking call facility

    Over the last few days, I have not been able to make or receive calls. Vodafone suggested turning 3G off which I did, and I can now make and receive calls again. This is obviously not an ideal solution as I have to keep turning 3G on and off dependin

  • Simple TCP Chat program behid router

    Hello, I've been reading some of the examples from http://pirate.shu.edu/~wachsmut/Teaching/CSAS2214/Virtual/Lectures/chat-client-server.html, and understand how these examples work well enough to fool around with it... I have it working inside my lo

  • Nokia e-mail issues

    First thing was I have been watching my phone memory going low - since I install applications only in memory card that seemed a bit strange.The only application receiving data was nokia mail so I think this could be the source of the problem. Q1: am