Question on initialize method (p. 255 of  WDJ Tutorial #3 )

At the top of p. 25 of Tutorial #3, the code block says to add the line:
(a)
wdContext.currentContextElement().setBirthday(new Date(0)));   
When I do this, an error message results saying that setBirthday takes a string argument.
So I change the above line to:
b)
wdContext.currentContextElement().setBirthday(new Date(0)));   
and the error message goes away. 
What's going on here?  Is (a) a mistake in the tutorial, or have I overlooked something somewhere ?
Thanks
Dave

Yep it seems there is an error on page 12. If you import the attached source and if you check the simple type BirthDay in the dictionary (in your studio), you can see that the build-in type is set to date and not to string. It is also expected to use a date type for a birthday.
Regards,
Christophe

Similar Messages

  • Raising custom error message in generic service initialize method of Pr&for

    Dear all,
    I am developing the HCM process form.
    Is it possible to raise an error if any condition is not met in initialize method in generic service of HCM process & forms?
    If possible could you please provide me the steps/process.
    Thanks & Regards,
    Krishna K

    Change for a BADI more suited (not in the update of after-save process) like ME_PROCESS_PO_CUST (Method PROCESS_ITEM, CHECK).
    ME_PURCHDOC_POSTED  is too late.
    Regards

  • RSR_OLAP_BADI -  initialization method

    We have created an  implementation using the RSR_OLAP_BADI. In the INITIALIZATION METHOD we are using the code shown below from one of the white papers. The code goes through the characteristics and key figures and finds there position in the table. That position is used in an ASSIGN statement in the COMPUTE METHOD so we can put a value in our virtual key figures. The code for characteristics works fine but the code for key figures does not.
    What we found in debug is that field VALUE_RETURNNM in  table I_TH_SFK does not contain a value for any of our key figures.
    Does anyone know how or where the table I_T_SFK is filled?
    Regards,
    Mike...
    **CODE:
    class cl_exm_im_rsr_olap_badi definition load.
    get field postions for characteristics in structure
      loop at i_th_sfc assigning <l_s_sfc>
      where user_exit ne rrke_c_mode-none.
    field name in structure is keyreturnnm
    name of the global variable
        concatenate 'P_CHA' <l_s_sfc>-chanm
            into l_global_name separated by '_'.
    fill the global variable
        unassign <l_global>.
        assign (l_global_name) to <l_global>.
        check <l_global> is assigned.
        <l_global> = cl_exm_im_rsr_olap_badi=>get_field_position_d(
        i_fieldnm = <l_s_sfc>-keyreturnnm
        i_s_data = i_s_data ).
      endloop.
    get field positions for key figures in structure
    loop at i_th_sfk assigning <l_s_sfk>
           where value_returnnm is not initial.
    name of the global variable
        concatenate 'P_KYF' <l_s_sfk>-kyfnm
            into l_global_name
            separated by '_'.
    fill the global variable
        unassign <l_global>.
        assign (l_global_name) to <l_global>.
        check <l_global> is assigned.
        <l_global> = cl_exm_im_rsr_olap_badi=>get_field_position_d(
                                           i_fieldnm = <l_s_sfk>-value_returnnm
                                           i_s_data  = i_s_data ).
      endloop.

    Fred,
    The reference to VALUE_RETURNNM is in the LOOP for Key Figures
    in methond INITIALIZE.
    get field positions for key figures in structure
    loop at i_th_sfk assigning <l_s_sfk>
    where value_returnnm is not initial.
    name of the global variable
    concatenate 'P_KYF' <l_s_sfk>-kyfnm
    into l_global_name
    separated by '_'.
    fill the global variable
    unassign <l_global>.
    assign (l_global_name) to <l_global>.
    check <l_global> is assigned.
    <l_global> = cl_exm_im_rsr_olap_badi=>get_field_position_d(
    i_fieldnm = <l_s_sfk>-value_returnnmi_s_data = i_s_data ).
    endloop.

  • Initialize method in JAAS login module

    Hi All,
    In my JAAS login module (extended AbstractLoginModule) deployed on WAS 6.40 (sneak preview) my initialize method is being called for every browser session. I have added some logging in the login module contructor, even that is being called for every new browser session. Is this the expected behaviour?
    I guess the initialize method should be called on once.
    regards,
    Vishal

    Hi,
    We had the same problem.
    What we found was that Sap has a new Login Module called HeaderVariableLoginModule which you have to create using the class com.sap.security.core.server.jaas.HeaderVariableLoginModule. You can do this in NWA -> Configuration -> Authentication and Single Sign-On -> Login Module, then click on the create button and fill out the fields with the information i just gave you.
    The list of Login Modules should now include HeaderVariableLoginModule, which you can configure by selecting the row of this module, and adding two options-  ume.configuration.active=true and Header=REMOTE_USER.
    It appears that this Login Module is covertly delivered as a class in every Netweaver version >= 7.0.
    Good luck,
    Steven McElwee, Duke University
    PS- I tried to attach a word document that shows the procedure for this, but this system rejected it. I can email it you if you let me know where to send it. In our case we used "Header=uid" rather than "Header="REMOTE_USER".

  • Java collaboration initialization method- exists on javacaps 5.1.1?

    Hi everyone
    I have javacaps version 5.1.1
    I want cache properties on a Map in a Java collaboration definition.
    Has a Java collaboration definition an initialization method? or how can implement it?
    Any help will we appreciated

    I do not think in such method exists. If you need to implement the cache at begining of the collaboration- Have a static method in side that method limplement your load properties code. This will gurantee the cache available as long as your JVM life i.e until restart the Integration Server instance.
    Cheers
    Raghu

  • Two other minor errors in NWDS/WDJ Tutorial #2 (and one mroe question)

    First:
    In the layout instructions for the QuesdtionMarkView on page 25-26 of Tutorial #2, it does not say to delete the default text view (although it does say to do this for the other views.)  So when you first deploy/run as per instruction on page 29, you will see the text "QuestionMarkView" as well as the question mark image itself.
    Second (a little more important):
    On page 29, the tutorial seems to read as if the code generator has ALREADY added the line
    (1)  wdThis.wdFirePlugStartQuizOut();
    for the START plug, and that you only have to add this line of code for the EXIT plug:
    (2) wdThis.wdGetQuizInterfaceViewController().wdFirePlugGotoUrl("http://www.sap.com");
    But inn my version of NWDS, line #1 bove has NOT already been added by the code generator for the START plug, and it has to be added manually as well as line #2.
    Is this a change in the operation of the code generator or an error in the tutorial?

    hi L.M.:
    You may be right, though I can't tell at this point if I missed the step you mention when following BG's instructions on page 28 of WDJ Tutorial #2.  I'm pretty sure I followed his instructions to set plug values for all view actions, including StartQuizOut for StartPressed.  I'm sure I'll hit this again in another tutorial, and will check at that point to see if you're right.
    Anyway, 10 for explaining how the NWDS "points-and-clicks" are related to the code generator.
    Thanks
    djh

  • MIME directory in WDJ Tutorial #2: Question 1 of 2

    On page 26 of WDJ tutorial #2 (Creating Extended WD App), it says to store the MIME objects in
    com.sap.tc.webdynpro.tutorials.quiz.Quiz
    But the directory
    com.sap.tc.webdynpro.tutorials.quiz.QuizComp
    is already there (created automatically by NWDS.)
    Does the tutorial REALLY mean "Quiz", or does it mean "QuizComp"?
    This is question 1 of 2 - see next post for related question ...

    If you want to use images in UI elements and want to simply use the image file name as property value (e.g. in Image.source), you have to put the images into folder
    src/mimes/components/<qualified-component-name>
    for the component containing the view with the UI elements. The runtime is then able to create the correct URL from the file name automatically.
    Otherwise, you would have to create the URL in your application by yourself.
    Armin

  • Next Question about NWDS/WDJ Tutorial #2 - bottom of page 29

    At the bottom of p.29 of the NWDS/WDJ Tutorial #2, it says to rebuild the project and deploy/run the application so that you can see the "runtime behavior" of the app at this stage of development.
    OK - so I get a clean rebuild with no errors.
    I also get a clean deploy/run with no errors.
    But when the application "pops", there is nothing but a blank frame.
    I know this is not a config problem, because I can still run the Tutorial #1 application and have it "pop" the way it is supposed to.
    I have redone the tutorial up to page 29 twice now to make sure I have made no mistakes. 
    But I still get that d***d blank frame when I do what it says to do at the bottom of page 29.
    What might have I done wrong that I'm not aware of ??
    And how can I tell what I've done wrong if the rebuild and the deploy/run are clean with no error messages ???
    Thanks for any insight anyone can provide.
    djh

    ar/rh -
    Yes - your suggestions led me to the right answer.
    Although BG says to set the VerticalSlashPosition of the viewset QuizViewSet to 50% when creating it (in #7 at the top of page 19), he does not say to set the default property of this viewset to "true".
    As soon as I did this, the view popped.
    I'm giving 6 to you and asking Craig/Gali to give ar 6 also.
    Dave

  • IWDMessageManager in WDJ Tutorial #3(Simple Input Form), p.23

    Prior to typing in any of the code shown on page 25 of WDJ Tutorial #3, the generated Java code looks like this for the checkDateInPast method:
      //@@begin javadoc:checkDateInPast()
      /** Declared method. */
      //@@end
      public void checkDateInPast( java.lang.String fieldName )
        //@@begin checkDateInPast()
        //@@end
    When I type in the first line of the code to be added, the result looks like this:
      //@@begin javadoc:checkDateInPast()
      /** Declared method. */
      //@@end
      public void checkDateInPast( java.lang.String fieldName )
        //@@begin checkDateInPast()
        IWDMessageManager msgMgr =
          wdComponentAPI.getMessageManager();
        //@@end
    But right away I get this error message:
    "IWDMessageManager cannot be resolved or is not a type."
    I have checked back carefully on previous pages and don't see anything I've neglected to do.
    Can someone suggest what might be going on here, either an error in the tutorial or an error in something I've done ????
    Thanks
    Dave

    Yes - that did it, thanks.
    Before you answered I found another way - I looked back at the Java for the views in previous tutorials and found these statements:
    import com.sap.tc.webdynpro.progmodel.api.*;
    import com.sap.tc.webdynpro.progmodel.gci.*;
    import com.sap.tc.webdynpro.progmodel.context.*;
    When I added these, the error message went away also - obviously because the IWDMessageManager is included in progmodel.api.*
    But while you're around let me ask you the following question:
    When I do it your way (ctrl-shift-o), how does NWDS know to add just the line for the MessageManager:
    "import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;"
    Thanks.
    Dave

  • A question about a method with generic bounded type parameter

    Hello everybody,
    Sorry, if I ask a question which seems basic, but
    I'm new to generic types. My problem is about a method
    with a bounded type parameter. Consider the following
    situation:
    abstract class A{     }
    class B extends A{     }
    abstract class C
         public abstract <T extends A>  T  someMethod();
    public class Test extends C
         public <T extends A>  T  someMethod()
              return new B();
    }What I want to do inside the method someMethod in the class Test, is to
    return an instance of the class B.
    Normally, I'm supposed to be able to do that, because an instance of
    B is also an instance of A (because B extends A).
    However I cannot compile this program, and here is the error message:
    Test.java:16: incompatible types
    found   : B
    required: T
                    return new B();
                           ^
    1 errorany idea?
    many thanks,

    Hello again,
    First of all, thank you very much for all the answers. After I posted the comment, I worked on the program
    and I understood that in fact, as spoon_ says the only returned value can be null.
    I'm agree that I asked you a very strange (and a bit stupid) question. Actually, during recent months,
    I have been working with cryptography API Core in Java. I understood that there are classes and
    interfaces for defining keys and key factories specification, such as KeySpec (interface) and
    KeyFactorySpi (abstract class). I wanted to have some experience with these classes in order to
    understand them better. So I created a class implementing the interface KeySpec, following by a
    corresponding Key subclass (with some XOR algorithm that I defined myself) and everything was
    compiled (JDK 1.6) and worked perfectly. Except that, when I wanted to implement a factory spi
    for my classes, I saw for the first time this strange method header:
    protected abstract <T extends KeySpec> T engineGetKeySpec
    (Key key, Class<T> keySpec) throws InvalidKeySpecExceptionThat's why yesterday, I gave you a similar example with the classes A, B, ...
    in order to not to open a complicated security discussion but just to explain the ambiguous
    part for me, that is, the use of T generic parameter.
    The abstract class KeyFactorySpi was defined by Sun Microsystem, in order to give to security
    providers, the possibility to implement cryptography services and algorithms according to a given
    RFC (or whatever technical document). The methods in this class are invoked inside the
    KeyFactory class (If you have installed the JDK sources provided by Sun, You can
    verify this, by looking the source code of the KeyFactory class.) So here the T parameter is a
    key specification, that is, a class that implements the interface KeySpec and this class is often
    defined by the provider and not Sun.
    stefan.schulz wrote:
    >
    If you define the method to return some bound T that extends A, you cannot
    return a B, because T would be declared externally at invocation time.
    The definition of T as is does not make sense at all.>
    He is absolutely right about that, but the problem is, as I said, here we are
    talking about the implementation and not the invocation. The implementation is done
    by the provider whereas the invocation is done by Sun in the class KeyFactory.
    So there are completely separated.
    Therefore I wonder, how a provider can finally impelment this method??
    Besides, dannyyates wrote
    >
    Find whoever wrote the signature and shoot them. Then rewrite their code.
    Actually, before you shoot them, ask them what they were trying to achieve that
    is different from my first suggestion!
    >
    As I said, I didn't choose this method header and I'm completely agree
    with your suggestion, the following method header will do the job very well
    protected abstract KeySpec engineGetKeySpec (Key key, KeySpec key_spec)
    throws InvalidKeySpecException and personally I don't see any interest in using a generic bounded parameter T
    in this method header definition.
    Once agin, thanks a lot for the answers.

  • External drive not showing up - which disk initialization method will NOT erase the data on that external hard drive?

    Hi,
    as thousands of other users, my WD Passport drive worked like a charm until yesterday and now it wont show on any computer, but does show in the Disk management and when plugged in , the Disk Management offers two ways of initialization : MBR and GPT
    i dont understand any of that and want to know if any of those two methods will make the disk initialize wITHOUT loosing the data on the drive?
    i looked on so many forums and some people say that it will and others that it will not erase the data. 
    can you please tell me what is correct?? also a suggestion is to add some more wording to that initializaiton dialog box so that we can know what initialization does and doesnt
    thank you so much

    Try connecting it to a different computer to see if you can access the data, under no circumstances should you Initialize the drive as all existing data will be lost.
    If you still can't access your files, then remove the drive from the case and connect it via an extra SATA cable and power connector (you usually need a desktop PC in order to do this if the drive is a 3.5 inch model, a 2.5in drive will fit into a laptop
    if you have a spare slot).
    J W Stuart: http://www.pagestart.com
    Never be afraid to ask. This forum has some of the best people in the world available to help.

  • Question repost: Add Methods in a Linked List.

    Please excuse my reposting of this question. The previous question had a lot of unformatted code.
    Here, I'll just have the two methods that I need help with. If more information is needed, I have it by the buttloads.
    They are add methods for a List class:
      public boolean add(E o)
      Node newNode = new Node();
      newNode.data = o;
      if (first == null)
          first = last = newNode;
      else {
      last.next = newNode;
      } // end if
      size++;
      return true;
    public void addLast(E o)
      Node newNode = new Node();
      newNode.data = o;
      newNode.previous = last;
      if (first == null)
          first = last = newNode;
      else {
      last.next = newNode;
       size++;
      }Can anybody help me with these? Duke points will be rewarded.

    Once again: continue to ask for help in your original post. Include your up-to-date code and provide as much details as possible, such as error messages (copy and paste the entire message, do not paraphrase) or for incorrect behviour describe what is happening and what is supposed to happen.
    Do this in your original post. I don't want to see another post here!

  • Question regarding a method of stocking data

    I know this thread already is in the "New to Java Technology" Forum, although I said the topic was closed there so I could open it back here.. I realized it would be more fitting here and it would probably get more replies...
    I am working with a friend on a Client for Ultima Online and we have to stock data concerning the various objects and characters in the same sector as the Client. We have 3 ideas of what the best method could be, but we have no clue which method would be the most performant (concerning both speed and memory), or if there is a better method to do so.
    Here's a description of the methods we thought about:
    Method #1
    Create many class files for each type of object, having the various related variables in their respective classes...
    Exemple: A principal class called DataObject which holds the data common to all objects/characters. Classes which extends DataObject such as DataMobile (for the Characters) and DataItem (for the Items) in which the data specific to characters and items is stocked. And also various classes for the various types of objects such as Containers which will extend DataItem...
    Method #2
    Create a single class file which would hold an Array containing the various variables and of which the size would be the maximum amount of parameters possible. The array would work in relation with a byte which would hold the type of data stocked into the Array, this way we could know the structure of data and retrieve this data where it is in the Array...
    M�thod #3 <= This one was the first idea and we know it is the worse one.. Telling you about it though
    Create a single class file which would hold all the possible variables. These variables would only be used when necessary.
    M�thod #4
    Create a single class file which would extend java.util.Hashtable. The parameters would be stocked this way: The Key mapped to the value would be the type of parameter (represented by a Byte (not byte)) (type of parameter such as Serial, Name, Strenght, Dexterity, etc...). And the value would be stocked as a String, Integer, Short or Byte according to the case (once again, it isn't primitives, it is the classes from java.lang.*).
    Thanks in advance for the suggestions :)

    This is not an advanced language topic. This is a beginner question, I would be very surprised if you got an answer in this forum.

  • Question on getEncoded method of Key (interface) and its impl

    Hi,
    I need help to understand on how we use the encoded method of security key. The following is quoted from Sun spec about the getEncoded() as a reference.
    "An Encoded Form. This is an external encoded form for the key used when a standard representation of the key is needed outside the Java Virtual Machine, as when transmitting the key to some other party. The key is encoded according to a standard format (such as X.509 or PKCS#8), and is returned using the getEncoded method".
    Questions:
    How can we decode the bytes back into the original key object ? if it is used for this purpose by user (like me).
    Also, I try this method with the following code snippet. I get encoded format as "RAW". So now, how can I set the encoded format to other standard (after I know the answer to my first question above)? btw, i use Sun JCE 1.2.1
    KeyGenerator keygen = KeyGenerator.getInstance("DES");
    SecretKey desKey = keygen.generateKey();
    System.out.println("the encoded to String is " + desKey.getEncoded());
    System.out.println("format of key is " + desKey.getFormat());
    Thanks a lot

    To restore key from encoded data you have to use one of the KeySpec lasses in your case DESKeySpec. Then you can use KeyFactory (SecretKeyFactory in this case) class to regenerate key.
    SecretKeyFactory factory = SecretKeyFactory.getInstance("DES", "SunJCE");
    myDESkey = factory.generateSecret(keySpec);

  • Question about static method hiding

    I undestand that a static method may only be hidden in a subclass not overridden. But, I don't understand why an exception type thrown by the subclass method must be a subtype of the exception type thrown by the superclass method. For example,
    public class A {
    public static void foo() throws ExceptionA { }
    public class B extends A {
    public static void foo() throws ExceptionB { }
    gives a compile-time error if ExceptionB is not a subclass of ExceptionA. This makes perfect sense in the non-static case but what does it matter here?
    Thanks,
    Tim

    I don't understand your point. In either case, static
    or non-static, ExceptionB must be the same or a
    subclass of ExceptionA. My question is why this
    matters in the static case.I think it's for binary compatibility, that is, so that you can make changes to Java source files and recompile only the changed files. If you originally did not have the static method in class B, and called B.foo() in another class, the A.foo() method would actually be called at run time. If you then change the B class and add a foo() method, it must be compatible so that the other class's method call is still valid.
    If you're unfamiliar with the concept of binary compatibility, read the chapter in the Java Language Specification. It's a critical but often overlooked aspect of the Java language.

Maybe you are looking for

  • Ical does not work in Day View

    When I was working in ICal I have input an event in a date but I can only see it or change it when in Week View. When I put in Day View it suddenly freezes and nothing appears. What can it be? it's curious that it freezes in October 15th. Anybody saw

  • What are  the input parameters for Function Module

    Dear Experts, I want to generate a Sales Tax returns report,those fields are not available in my existing Datasources. For that i want to write a Generic Datasource with Function Module. audat bukrs vkorg vtweg spart aurat auart netwr mwsbp kschl zed

  • Report Painter - Library 7KO - Characteristic WERKS

    Hello All - I am trying to add field WERKS (plant) to my selection parameters for my report painter report. I had to activate it as a characteristic in the library because it wasn't activate yet. When I select plants on the selection screen, I get no

  • Is AirPlay mirroring available only on OS 10.8 and above?

    No matter what I try, I can't see the mirroring icon in the nav bar.  I am running 10.7.5 on a mid-2011 Mac.  My Apple TV 2 is running the most recent upgrade, but I am not willing to upgrade to Maverick (too many negative comments). Thanks

  • Safari 6 on Lion slow

    I've installed Safari 6 on Lion (work machine so I cannot upgrade to Mountain Lion just yet) Now Safari Web Content constantly and consistently pegs my processor at 60-98% Add in the Safari process itself using 5-10% and Safari 6 is rendering my comp