Hi ,info need on container creation,methods,class,interface....

hi ppl,
          Can anybody give me information on what is and how to create
container creation,methods,class,interface....with programs.

>
priyank dev wrote:
> hi ppl,
>           Can anybody give me information on what is and how to create
>  container creation,methods,class,interface....with programs.
Hi Dev,
Interface is just the skeleton of the class definition.
If you want to have your own code for all or any of the methods that interface is havings then you can create an instance of that interface and implement those methods with you own code.
That is the advantage of object oriented programming. And if you want to use the standard method or original method's functionality then you have call the method along with the class which implemented it like below
class => method1
For Imore information on interfaces Check this link.
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
For creating classes you can follow this procedure.
Go with abap dictionary->select database table->provide the table for dev classs eg. V_TDEVC-> go for display option-> select utilities->select contents option-> select create dev class,
provide the name and short text,software component->create req.no.
with this dev class will be created.
Thanks
Nitesh
Edited by: Nitesh Kumar on Nov 18, 2008 10:56 AM

Similar Messages

  • I teach Continuing education classes to Real Estate agents and I need to issue them certificates at the class, whihc need to be signed by me and it needs to contain their info on the certificate. The certificate is currently saved in a word format.What i'

    I teach Continuing education classes to Real Estate agents and I need to issue them certificates at the class, whihc need to be signed by me and it needs to contain their info on the certificate. The certificate is currently saved in a word format.What i'm trying to accomplish is to do a "mail merge " ( as some classes i have as many as 150 attendees) for the document, digitally sign each one with my signature on the certificate and then e-mail it out to the respective attendees. can this be done? if so How?

    This is the step that I took after inputting my signature.
    On the right, after saving my document, I click "Get Others to Sign."  I was confused because it says that it's powered by EchoSign.  Like I stated before, my clients are able to sign this document when I send it to them, but it is returned to me with their signature (not in the signature field, but at the end of the document), and my signature is missing.  I tested this on myself - my signature is missing when they receive it. 

  • Creation of class inside Method

    Hi Forums,
            I am new to WebDynpro-Abap and i am trying to practice WebDynpro-Abap with the help of  standard Tutorial avl in the SDN.
            In the Tutorial 4, i am getting the following error,
    The type <b>CL_WDABAP_FLIGHT_MODEL=>get_bookings is unknown or not found</b>
            but in that tutorial,they specify the  encounter of  the above error like
    <u>Simply create a ZCL_WDABAP_FLIGHT_MODEL class in your get_bookings method.</u>
           But  i don't know,where  to  Create the class  inside the get_bookings method
    can any body  tell me the steps to create  ZCL_WDABAP_FLIGHT_MODEL class in the get_bookings method and the remaining steps to execute the particular application.
    Thanks in Advance,
    Ashok

    Hi Ashok,
    Follow the steps for creation of Class and the method,
    STEPS TO CREATE CLASS:
    1) CREATE ZIT_FLIGHTTAB(AN INTERNAL TABLE) IN SE11 UNDER DATA TYPE->TABLE TYPE.
    2) GIVE LINE TYPE AS SFLIGHT. SAVE,CHECK AND ACTIVATE THE INTERNAL TABLE.
    3) CREATE GLOBAL CLASS ZNET_NET310_FLIGHTMODEL_## USING TRANSACTION CODE SE24.
    4) IN THE ATTRIBUTES TAB, ENTER AS FOLLOWS,
        ATTRIBUTE          LEVEL          VISIBILITY     TYPING          ASSOCIATED TYPE
        TY_FLIGHTS        STATIC ATTRIBUTE       PUBLIC     TYPE             SFLIGHT
        ZIT_OUTTAB        STATIC ATTRIBUTE       PUBLIC     TYPE             TY_FLIGHTS
    5) IN THE METHODS TAB, ENTER AS FOLLOWS,
          METHOD          LEVEL          VISIBILITY     DESCRIPTION
       READ_FLIGHTS          STATIC METHOD        PUBLIC     READ FLIGHT DATA
    6) CLICK ON PARAMETERS, ENTER AS FOLLOWS,
          PARAMETER          TYPE          TYPING METHOD     ASSOCIATED TYPE          
          I_CARRID           IMPORTING             TYPE          SFLIGHT-CARRID
          I_CONNID           IMPORTING             TYPE         SFLIGHT-CONNID
          E_FLIGHTS           EXPORTING            TYPE         ZIT_FLIGHTTAB
    7) DOUBLE CLICK ON METHOD:READ_FLIGHTS AND ENTER FOLLOWING SORCE CODE IN BETWEEN METHOD AND ENDMETHOD.
         SELECT * FROM SFLIGHT INTO TABLE ZIT_OUTTAB WHERE CARRID = I_CARRID AND CONNID = I_CONNID.
          E_FLIGHTS[] = ZIT_OUTTAB[].
    8) SAVE CHECK AND ACTIVATE CLASS.
    NOTE :
    PLEASE FOLLOW SAME STEPS FOR OTHER METHODS THAT COMES IN FOLLOWING EXCERCISE IN SAME CLASS i.e ZCL_NET310_FLIGHTMODEL_##.
    In next few tutorials you will need to create more methods. Follow steps to add new methods as and when required.
    Regards,
    Achyut

  • I need  to implement clone method  in theAdvancedDataGrid class

    I need  to implement clone method  in theAdvancedDataGrid class, to copy the object in its completeness   Could anyone give me a helping hand.

    Hi Nikos,
    from youe question it's not clear what do you need to copy: data, parts of ADG (GUI) or something else?
    If it's not a GUI - only data - you can use mx.utils.ObjectUtil.copy(value:Object):Object

  • HT2736 when i need to gift any app by print gift myself take me to billing info to choose the raiment method and already i have credit on my iTunes card

    when i need to gift any app by print gift myself take me to billing info to choose the raiment method and already i have credit on my iTunes card

    You cannot use a balance from a gift card to purchase another gift. You will have to provide a credit card.
    Regards.

  • Need to Call the Parent Class Method

    Hi..
    Please go thru the following code.
    class Parent {
         Parent() {
              System.out.println("In Parent Constructor");
         void set() {
              System.out.println("In Parent set method");
    class Child extends Parent {
         Child() {
              System.out.println("In Child Constructor");
         void set() {
              super.set();
              System.out.println("In Child set method");
    class SetTrial {
         public static void main(String args[])
              Child aChild = new Child();
              Parent theImpl = (Parent)aChild;
              theImpl.set();
    I want to know, is there any way by which we can get the Parent Set method to be executed, when we invoke it in main.
    In the main, I should be able to decide which Set to invoke based on certain conditions.
    TIA..
    Basu.

    Since you seem to have an aversion to using the child class decide whether to call just the parent's set function, I think I would do it like this:
    class Parent{
      Parent() {
         System.out.println("In Parent Constructor\n");
      void set(ConditionClass C) {
        System.out.println ("In Parent set method\n");
    class Child extends Parent {
      Child() {
        System.out.println("In Child Constructor");
      void set(ConditionClass C) {
        super.set();
        if (C.CallChildSet()) {
          System.out.println("In Child set method");
    class SetTrial {
         public static void main(String args[])
              Child aChild = new Child();
              Parent theImpl = (Parent)aChild;
                    ConditionClass C = new ConditionClass()
              theImpl.set(C);
    }In any case I would decide in the child's set to call the parent's set or not.

  • Need help with calling method

    I'm new to Java, trying to pass a required class so I can graduate this semester, and I need help figuring out what is wrong with the code below. My assignment is to create a program to convert celsius to fahrenheit and vice versa using Scanner for input. The program must contain 3 methods - main, convert F to C, method, and convert C to F method. Requirements of the conversion methods are one parameter which is an int representing temp, return an int representing calculated temp after doing appropriate calculation, should not display info to user, and should not take in info from user.
    The main method is required to ask the user to input a 1 for converting F to C, 2 for C to F, and 3 to end the program. It must include a while loop that loops until the user enters a 3, ask the user to enter a temp, call the appropriate method to do the conversion, and display the results. I'm having trouble calling the conversion methods and keep getting the following 2 compiler errors:
    cannot find symbol
    symbol : method farenheitToCelsius(int)
    location: class WondaPavoneTempConverter
    int celsius = farenheitToCelsius(intTemp);
    ^
    cannot find symbol
    symbol : method celsiusToFarenheit(int)
    location: class WondaPavoneTempConverter
    int farenheit = celsiusToFarenheit(intTemp);
    The code is as follows:
    public static void main(String[] args) {
    // Create a scanner
    Scanner scanner = new Scanner(System.in);
    // Prompt the user to enter a temperature
    System.out.println("Enter the temperature you wish to convert as a whole number: ");
    int intTemp = scanner.nextInt();
    System.out.println("You entered " + intTemp + " degrees.");
    // Prompt the user to enter "1" to convert to Celsius, "2" to convert to
    // Farenheit, or "3" to exit the program
    System.out.println("Enter 1 to convert to Celsius, 2 to convert to Farenheit, or 3 to exit.");
    int intConvert = scanner.nextInt();
    // Convert temperature to Celsius or Farenheit
    int celsius = farenheitToCelsius(intTemp);
    int farenheit = celsiusToFarenheit(intTemp);
    while (intConvert >= 0) {
    // Convert to Celsius
    if (intConvert == 1) {
    System.out.println("Celsius is " + celsius + " degrees.");
    // Convert to Farenheit
    else if (intConvert == 2) {
    System.out.println("Farenheit is " + farenheit + " degrees.");
    // Exit program
    else if (intConvert == 3) {
    break;
    else {
    System.out.println("The number you entered is invalid. Please enter 1, 2, or 3.");
    //Method to convert Celsius to Farenheit
    public static int celsiusToFahrenheit(int cTemp) {
    return (9 / 5) * (cTemp + 32);
    //Method to convert Farenheit to Celsius
    public static int fahrenheitToCelsius(int fTemp) {
    return (5 / 9) * (fTemp - 32);
    I readily admit I'm a complete dunce when it comes to programming - digital media is my area of expertise. Can anyone point me in the right direction? This assignment is due very soon. Thanks.

    1) consider using a boolean variable in the while statement and converting it to true if the input is good.
    while (inputNotValid)
    }2) put the code to get the input within the while loop. Try your code right now and enter the number 30 when your menu requests for input and you'll see the infinite loop.... and why you need to request input within the loop.
    3) Fix your equations. You are gonig to have to do some double calcs, even if you convert it back to int for the method return. Otherwise the results are just plain wrong. As a good test, put in the numbers -40, 0, 32, 100, and 212. Are the results as expected? (-40 is the only temp that is the same for both cent and fahr). I recommend doing double calcs and then casting the result to int in the return. for example:
    int a = (int) (20 + 42.0 / 3);  // the 42.0 forces the compiler to do double calc.4) One of your equations may still be plain wrong even with this fix. Again, run the test numbers and see.
    5) Also, when posting your code, please use code tags so that your code will be well-formatted and readable. To do this, either use the "code" button at the top of the forum Message editor or place the tag &#91;code&#93; at the top of your block of code and the tag &#91;/code&#93; at the bottom, like so:
    &#91;code&#93;
      // your code block goes here.
    &#91;/code&#93;

  • Global Container in Java Class of Interface Mapping

    I have written a Java Class that implements the StreamTransformation interface for use in an Interface Mapping. I would like to cache information read from a file between message processing calls of this mapping.
    It appears that maybe the GlobalContainer object can be used to perform this caching. How do I access the GlobalContainer object from a class that implements StreamTransformation?
    The examples all show container.getGlobalContainer() method call to get access to this object. However container is not a variable in this interface. Any ideas on how to do this?
    Thanks,
    Jay

    Hi Jay,
    if you want to link data from different messages you must use BPM, you cannot do this with GlobalContainer because it is instantiated at the begin of the mapping and is flushed at the end of the mapping (e.g. graphical mapping).
    2 files for the same scenario will use 2 different instances of the same message mapping program and they will not share the container.
    The container is shared inside the same instance of the mapping program.
    So it is shared for example between two UDF in the same mapping
    So if you are using Java mapping you do not need to use the global container, you can use an Object to store data, but keep in mind that all this data will be lost at the end of the mapping.
    Hope it helps,
    Kind Regards,
    Sergio

  • Track public classes, interfaces and methods by ID

    Hi All,
    I'm wondering whether there is a tool to assign a unique ID to classes, interfaces and methods (eg. within Javadoc) and track these IDs.
    The reason I'd need such a feature is that I'd like to do requirements tracking in an easy but complete way. I have a document containing functional specifications (with IDs) and on the other side there is the source code; where the javadoc of the public methods and classes is my software specification. What I now want to do is make a link between the IDs in the functional spec to the IDs in the sofware spec (ie. the source code).
    Does anybody know of such a tool (commercial or not)?
    Thanks,
    Daniel

    I'm a bit confused as to whether or not I understand you correctly. Please tell me if the following pseudocode is somewhat like the solution you are looking for:
    class MethodFunctionality {
       private Class methodClass;
       private String methodSignature;
       private List methodFunctions;
        *   Returns true if the method is used for the specified
        *   requirement, false otherwise.
       public boolean fulfills(int requirementId) {
          if methodFunctions.contains(requirementId)
             return true;
          else
             return false;
       public String getMethodSignature() {
          return this.methodSingature;
       public Class getMethodClass() {
          return this.methodClass;
        *   Returns an array with IDs of each functional
        *   requirement covered by the method.
       public int[] getCoverage() {
          return this.methodFunctions;
    class ClassFunctionality {
       private Map methodDetails;
       private List classFunctions;
       public MethodFunctionality getMethodDetails(String methodSignature) {
          return (MethodFunctionality) this.methodDetails.get(methodSignature);
        *   Returns true if the class is used for the specified
        *   requirement, false otherwise.
       public boolean fulfills(int requirementId) {
          if classFunctions.contains(requirementId)
             return true;
          else
             return false;
        *   Returns an array with IDs of each functional
        *   requirement covered by the class.
       public int[] getCoverage() {
          return this.classFunctions;
    }Mapping classes and methods to functionality like this would both allow you to query each class and method for all the functional requirements they claim to cover and would allow you to collect all classes and methods involved for a particular functional requirement.

  • Class/Interface/Methods

    Hi All,
    I'm trying to understand the concept behind abap class/interface/methods.
    1. Is it mandatory to have an interface in every class?
    2. Once a class is created is it right to define methods as static and public and use them without reference to the interface?
    Any help appreciated.
    Meghna

    hi meghna,
    interfaces in ABAP Objects play the same role as classes. Just like classes, interfaces are object types that reside in the namespace of all types. While a class describes all aspects of a class, an interface only describes a partial aspect
    The syntax for declaring a local interface is:
    INTERFACE intf.
       DATA ...
       CLASS-DATA ...
       METHODS ...
       CLASS-METHODS ...
    ENDINTERFACE.
    Basically, the declaration of an interface corresponds to the declaration part of a class, where instead of CLASSu2014ENDCLASS, you simply use INTERFACEu2014ENDINTERFACE. Interfaces can contain exactly the same components as classes. Unlike classes, however, interfaces don't need to be divided into different visibility sections because interface components are always integrated in the public visibility section of classes.
    i dont want to confuse you .
    please go to the below link to know more about... interface and classes.
    [http://help.sap.com/saphelp_nw04/helpdata/en/ec/d9ab291b0b11d295400000e8353423/frameset.htm]

  • Need to import my java class. Please help

    Dear all.
    I made a java class named GetOS which contains a method that return th OS name. Then I deployed this class to a Jar file called tarek.jar.
    now I need to import this jar file in my form
    i'm using forms9i release2
    I did the following:
    I copied "tarek.jar" to \\developerhome\forms90\java\
    then I opend the forms builder - program-import java class but my jar file "tarek" doesn't exist in the list.
    please help.

    Dear all
    I solved this problem. I editing the class path of the system control panel>system>advanced and it works fine
    Now i can import my class easly without any problems
    But when the forms builder imported my class , it generates a pl/sql package which contains a function with the same name of the method i did in my class.The problem is I do not know how to call this function
    Function getOSname( obj ora_java.jobject)
    return varchar2 is
    begin
    cls := jni.get

  • Need to create a driver class for a program i have made...

    hey guys im new to these forums and someone told me that i could get help on here if i get in a bind...my problem is that i need help creating a driver class for a program that i have created and i dont know what to do. i need to know how to do this is because my professor told us after i was 2/3 done my project that we need at least 2 class files for our project, so i need at least 2 class files for it to run... my program is as follows:
    p.s might be kinda messy, might need to put it into a text editor
    Cipher.java
    This program encodes and decodes text strings using a cipher that
    can be specified by the user.
    import java.io.*;
    public class Cipher
    public static void printID()
    // output program ID
    System.out.println ("*********************");
    System.out.println ("* Cipher *");
    System.out.println ("* *");
    System.out.println ("* *");
    System.out.println ("* *");
    System.out.println ("* CS 181-03 *");
    System.out.println ("*********************");
    public static void printMenu()
    // output menu
    System.out.println("\n\n****************************" +
    "\n* 1. Set cipher code. *" +
    "\n* 2. Encode text. *" +
    "\n* 3. Decode coded text. *" +
    "\n* 4. Exit the program *" +
    "\n****************************");
    public static String getText(BufferedReader input, String prompt)
    throws IOException
    // prompt the user and get their response
    System.out.print(prompt);
    return input.readLine();
    public static int getInteger(BufferedReader input, String prompt)
    throws IOException
    // prompt and get response from user
    String text = getText(input, prompt);
    // convert it to an integer
    return (new Integer(text).intValue());
    public static String encode(String original, int offset)
    // declare constants
    final int ALPHABET_SIZE = 26; // used to wrap around A-Z
    String encoded = ""; // base for string to return
    char letter; // letter being processed
    // convert message to upper case
    original = original.toUpperCase();
    // process each character of the message
    for (int index = 0; index < original.length(); index++)
    // get the letter and determine whether or not to
    // add the cipher value
    letter = original.charAt(index);
    if (letter >='A' && letter <= 'Z')
    // is A-Z, so add offset
    // determine whether result will be out of A-Z range
    if ((letter + offset) > 'Z') // need to wrap around to 'A'
    letter = (char)(letter - ALPHABET_SIZE + offset);
    else
    if ((letter + offset) < 'A') // need to wrap around to 'Z'
    letter = (char)(letter + ALPHABET_SIZE + offset);
    else
    letter = (char) (letter + offset);
    // build encoded message string
    encoded = encoded + letter;
    return encoded;
    public static String decode(String original, int offset)
    // declare constants
    final int ALPHABET_SIZE = 26; // used to wrap around A-Z
    String decoded = ""; // base for string to return
    char letter; // letter being processed
    // make original message upper case
    original = original.toUpperCase();
    // process each letter of message
    for (int index = 0; index < original.length(); index++)
    // get letter and determine whether to subtract cipher value
    letter = original.charAt(index);
    if (letter >= 'A' && letter <= 'Z')
    // is A-Z, so subtract cipher value
    // determine whether result will be out of A-Z range
    if ((letter - offset) < 'A') // wrap around to 'Z'
    letter = (char)(letter + ALPHABET_SIZE - offset);
    else
    if ((letter - offset) > 'Z') // wrap around to 'A'
    letter = (char)(letter - ALPHABET_SIZE - offset);
    else
    letter = (char) (letter - offset);
    // build decoded message
    decoded = decoded + letter;
    return decoded;
    // main controls flow throughout the program, presenting a
    // menu of options the user.
    public static void main (String[] args) throws IOException
    // declare constants
    final String PROMPT_CHOICE = "Enter your choice: ";
    final String PROMPT_VALID = "\nYou must enter a number between 1" +
    " and 4 to indicate your selection.\n";
    final String PROMPT_CIPHER = "\nEnter the offset value for a caesar " +
    "cipher: ";
    final String PROMPT_ENCODE = "\nEnter the text to encode: ";
    final String PROMPT_DECODE = "\nEnter the text to decode: ";
    final String SET_STR = "1"; // selection of 1 at main menu
    final String ENCODE_STR = "2"; // selection of 2 at main menu
    final String DECODE_STR = "3"; // selection of 3 at main menu
    final String EXIT_STR = "4"; // selection of 4 at main menu
    final int SET = 1; // menu choice 1
    final int ENCODE = 2; // menu choice 2
    final int DECODE =3; // menu choice 4
    final int EXIT = 4; // menu choice 3
    final int ALPHABET_SIZE = 26; // number of elements in alphabet
    // declare variables
    boolean finished = false; // whether or not to exit program
    String text; // input string read from keyboard
    int choice; // menu choice selected
    int offset = 0; // caesar cipher offset
    // declare and instantiate input objects
    InputStreamReader reader = new InputStreamReader(System.in);
    BufferedReader input = new BufferedReader(reader);
    // Display program identification
    printID();
    // until the user selects the exit option, display the menu
    // and respond to the choice
    do
    // Display menu of options
    printMenu();
    // Prompt user for an option and read input
    text = getText(input, PROMPT_CHOICE);
    // While selection is not valid, prompt for correct info
    while (!text.equals(SET_STR) && !text.equals(ENCODE_STR) &&
    !text.equals(EXIT_STR) && !text.equals(DECODE_STR))
    text = getText(input, PROMPT_VALID + PROMPT_CHOICE);
    // convert choice to an integer
    choice = new Integer(text).intValue();
    // respond to the choice selected
    switch(choice)
    case SET:
         // get the cipher value from the user and constrain to
    // -25..0..25
    offset = getInteger(input, PROMPT_CIPHER);
    offset %= ALPHABET_SIZE;
    break;
    case ENCODE:
    // get message to encode from user, and encode it using
    // the current cipher value
    text = getText(input, PROMPT_ENCODE);
    text = encode(text, offset);
    System.out.println("Encoded text is: " + text);
    break;
    case DECODE:
    // get message to decode from user, and decode it using
    // the current cipher value
    text = getText(input, PROMPT_DECODE);
    text = decode(text, offset);
    System.out.println("Decoded text is: " + text);
    break;
    case EXIT:
    // set exit flag to true
    finished = true ;
    break;
    } // end of switch on choice
    } while (!finished); // end of outer do loop
    // Thank user
    System.out.println("Thank you for using Cipher for all your" +
    " code breaking and code making needs.");
    }

    My source in code format...sorry guys :)
       Cipher.java
       This program encodes and decodes text strings using a cipher that
       can be specified by the user.
    import java.io.*;
    public class Cipher
       public static void printID()
          // output program ID
          System.out.println ("*********************");
          System.out.println ("*       Cipher      *");
          System.out.println ("*                   *");
          System.out.println ("*                          *");
          System.out.println ("*                   *");
          System.out.println ("*     CS 181-03     *");
          System.out.println ("*********************");
       public static void printMenu()
          // output menu
          System.out.println("\n\n****************************" +
                               "\n*   1. Set cipher code.    *" +
                               "\n*   2. Encode text.        *" +
                               "\n*   3. Decode coded text.  *" +
                               "\n*   4. Exit the program    *" +
                               "\n****************************");
       public static String getText(BufferedReader input, String prompt)
                                           throws IOException
          // prompt the user and get their response
          System.out.print(prompt);
          return input.readLine();
       public static int getInteger(BufferedReader input, String prompt)
                                           throws IOException
          // prompt and get response from user
          String text = getText(input, prompt);
          // convert it to an integer
          return (new Integer(text).intValue());
       public static String encode(String original, int offset)
          // declare constants
          final int ALPHABET_SIZE = 26;  // used to wrap around A-Z
          String encoded = "";           // base for string to return
          char letter;                   // letter being processed
          // convert message to upper case
          original = original.toUpperCase();
          // process each character of the message
          for (int index = 0; index < original.length(); index++)
             // get the letter and determine whether or not to
             // add the cipher value
             letter = original.charAt(index);
             if (letter >='A' && letter <= 'Z')          
                // is A-Z, so add offset
                // determine whether result will be out of A-Z range
                if ((letter + offset) > 'Z') // need to wrap around to 'A'
                   letter = (char)(letter - ALPHABET_SIZE + offset);
                else
                   if ((letter + offset) < 'A') // need to wrap around to 'Z'
                      letter = (char)(letter + ALPHABET_SIZE + offset);
                   else
                      letter = (char) (letter + offset);
             // build encoded message string
             encoded = encoded + letter;
          return encoded;
       public static String decode(String original, int offset)
          // declare constants
          final int ALPHABET_SIZE = 26;  // used to wrap around A-Z
          String decoded = "";           // base for string to return
          char letter;                   // letter being processed
          // make original message upper case
          original = original.toUpperCase();
          // process each letter of message
          for (int index = 0; index < original.length(); index++)
             // get letter and determine whether to subtract cipher value
             letter = original.charAt(index);
             if (letter >= 'A' && letter <= 'Z')          
                // is A-Z, so subtract cipher value
                // determine whether result will be out of A-Z range
                if ((letter - offset) < 'A')  // wrap around to 'Z'
                   letter = (char)(letter + ALPHABET_SIZE - offset);
                else
                   if ((letter - offset) > 'Z') // wrap around to 'A'
                      letter = (char)(letter - ALPHABET_SIZE - offset);
                   else
                      letter = (char) (letter - offset);
             // build decoded message
             decoded = decoded + letter;
          return decoded;
       // main controls flow throughout the program, presenting a
       // menu of options the user.
       public static void main (String[] args) throws IOException
         // declare constants
          final String PROMPT_CHOICE = "Enter your choice:  ";
          final String PROMPT_VALID = "\nYou must enter a number between 1" +
                                      " and 4 to indicate your selection.\n";
          final String PROMPT_CIPHER = "\nEnter the offset value for a caesar " +
                                       "cipher: ";
          final String PROMPT_ENCODE = "\nEnter the text to encode: ";
          final String PROMPT_DECODE = "\nEnter the text to decode: ";
          final String SET_STR = "1";  // selection of 1 at main menu
          final String ENCODE_STR = "2"; // selection of 2 at main menu
          final String DECODE_STR = "3"; // selection of 3 at main menu
          final String EXIT_STR = "4";  // selection of 4 at main menu
          final int SET = 1;            // menu choice 1
          final int ENCODE = 2;         // menu choice 2
          final int DECODE =3;          // menu choice 4
          final int EXIT = 4;           // menu choice 3
          final int ALPHABET_SIZE = 26; // number of elements in alphabet
          // declare variables
          boolean finished = false; // whether or not to exit program
          String text;              // input string read from keyboard
          int choice;               // menu choice selected
          int offset = 0;           // caesar cipher offset
          // declare and instantiate input objects
          InputStreamReader reader = new InputStreamReader(System.in);
          BufferedReader input = new BufferedReader(reader);
          // Display program identification
          printID();
          // until the user selects the exit option, display the menu
          // and respond to the choice
          do
             // Display menu of options
             printMenu(); 
             // Prompt user for an option and read input
             text = getText(input, PROMPT_CHOICE);
             // While selection is not valid, prompt for correct info
             while (!text.equals(SET_STR) && !text.equals(ENCODE_STR) &&
                     !text.equals(EXIT_STR) && !text.equals(DECODE_STR))       
                text = getText(input, PROMPT_VALID + PROMPT_CHOICE);
             // convert choice to an integer
             choice = new Integer(text).intValue();
             // respond to the choice selected
             switch(choice)
                case SET:
                // get the cipher value from the user and constrain to
                   // -25..0..25
                   offset = getInteger(input, PROMPT_CIPHER);
                   offset %= ALPHABET_SIZE;
                   break;
                case ENCODE:
                   // get message to encode from user, and encode it using
                   // the current cipher value
                   text = getText(input, PROMPT_ENCODE);
                   text = encode(text, offset);
                   System.out.println("Encoded text is: " + text);
                   break;
                case DECODE:
                   // get message to decode from user, and decode it using
                   // the current cipher value
                   text = getText(input, PROMPT_DECODE);
                   text = decode(text, offset);
                   System.out.println("Decoded text is: " + text);
                   break;
                case EXIT:
                   // set exit flag to true
                   finished = true ;
                   break;
             } // end of switch on choice
          } while (!finished); // end of outer do loop
          // Thank user
          System.out.println("Thank you for using Cipher for all your" +
                             " code breaking and code making needs.");
    }

  • How to see which methods/classes are important?

    Hi Everyone,
    I am a beginner writing one of my first applications and I have a very newby question. How do I organize and manage many methods (and classes) to see which are the important ones and which are not?
    The questions arised for me because I noticed that I am a bit reluctant to introduce new helper private methods in a class, because I fear there would be too many methods and I couldn’t handle/oversee them... I know it’s probably very wrong and stupid. That’s why I would really like to put it right in me.
    So for example I create a class with a few public methods that are of course the most important part of the class. Those public methods need some more private methods that still do something important and maybe complex thing. But then I stilll need more methods to make clear code in the previous methods. Finally I end up with 20-30 methods in a supposed to be simple class. If I just look into it in Eclipse I have to scroll up and down a lot and even in the package explorer I can’t tell the importants methods apart from the rest. Is this normal?* (Please confirm it is; it would bring relief to me :))
    I thought some kind of method hierarchy shown in the package explorer and expressed in the indentation of the code would help. It would be based on the call hierarchy, but I realize that may be ambiguous. Still, do you know if there is any tool, plugin, solution for this?
    I mean something like this:
    SomeClass:
    ..-veryImportantMethod
    ....-importantMethod
    ....-imprtantMehtod2
    ........-method
    ........-method2
    ........-method3
    ............-reallyNotImportanMethod
    The same thing goes for classes. I start with a few important ones and introduce many less important later. I guess I can’t organize them into different packages based on importance because packages are not for that. It’s just looks strange for me to see a small unimportant helper class opened in the tab next to my main delagator class. (I'm not sure I know correclty what delegator means but that's not important at the moment :))
    I am really just a beginner (needless to say probably :)) but I think it would be easier to intellectually manage the code if there would be some importance hierarchy. It doesn’t even have to be unambiguous as it would only be a way to display the code by the IDE; it wouldn’t affect the program in any way.
    If you have any comments about why this whole thing is not important “because when you write your code..... “ or why I am totally lost and wrong here; I would really appreciate that as well :)
    Thanks in advance,
    lemonboston

    lemonboston wrote:
    Hi Everyone,
    I am a beginner writing one of my first applications and I have a very newby question. How do I organize and manage many methods (and classes) to see which are the important ones and which are not?
    The questions arised for me because I noticed that I am a bit reluctant to introduce new helper private methods in a class, because I fear there would be too many methods and I couldn’t handle/oversee them... I know it’s probably very wrong and stupid. That’s why I would really like to put it right in me.
    So for example I create a class with a few public methods that are of course the most important part of the class. Those public methods need some more private methods that still do something important and maybe complex thing. But then I stilll need more methods to make clear code in the previous methods. Finally I end up with 20-30 methods in a supposed to be simple class. If I just look into it in Eclipse I have to scroll up and down a lot and even in the package explorer I can’t tell the importants methods apart from the rest. Is this normal?* (Please confirm it is; it would bring relief to me :))
    I thought some kind of method hierarchy shown in the package explorer and expressed in the indentation of the code would help. It would be based on the call hierarchy, but I realize that may be ambiguous. Still, do you know if there is any tool, plugin, solution for this?
    I mean something like this:
    SomeClass:
    ..-veryImportantMethod
    ....-importantMethod
    ....-imprtantMehtod2
    ........-method
    ........-method2
    ........-method3
    ............-reallyNotImportanMethod
    The same thing goes for classes. I start with a few important ones and introduce many less important later. I guess I can’t organize them into different packages based on importance because packages are not for that. It’s just looks strange for me to see a small unimportant helper class opened in the tab next to my main delagator class. (I'm not sure I know correclty what delegator means but that's not important at the moment :))
    I am really just a beginner (needless to say probably :)) but I think it would be easier to intellectually manage the code if there would be some importance hierarchy. It doesn’t even have to be unambiguous as it would only be a way to display the code by the IDE; it wouldn’t affect the program in any way.
    If you have any comments about why this whole thing is not important “because when you write your code..... “ or why I am totally lost and wrong here; I would really appreciate that as well :)
    Thanks in advance,
    lemonbostonI think you would benefit from this http://en.wikipedia.org/wiki/Domain-driven_design

  • Method/Class used in workflow

    Hi all,
    can anyone help me regarding this problem of mine.
    Can you give some notes/documents regarding workflow.
    I need to create a program in work flow, i need a standard program of a method/class that is usually used in creating a notification in workflow.
    thanks a lot.
    regards,
    JC

    Hi,
    Please check the link,
    WorkFlow and SAP Scripts
    Regards,
    Hema.
    Reward points if it is useful.

  • WebDynpro Method from a Class Interface?

    Is possible to call a webdynpro method from a class interface that is register in the WDDOINIT of the same WEBDYNPRO component?
    I register my custom webdynpro screen into FPM_OIF_COMPONENT, now when I execute a FPM action my WebDynpro receives the action but ofcourse WDDOINIT doesn't get triggered again. I need to call my webdynpro code in the class interface so I can update my custom screen.
    SAP does that in their standard screen, Can I do that?
    Jason PV

    As Matt pointed out, your questions indicate that you should start from the basics, then as your knowledge enlarges, go and familarize with more advanced concepts of ABAP Objects. Once you feel a bit comfortable with that, go for BADIs and read a bit about that too.
    In my opinion the best start is to read some book, which covers most of ABAP OO concepts. Personally I would recommend [ABAP Objects: ABAP Programming in SAP NetWeaver|http://www.sap-press.com/product.cfm?account=&product=H1934] as I like this author and had his previous book. This would give you strong foundations of what is going on here. Eventually you will often want to refresh some concepts so you have everything you need in one spot (book).
    Of course if want to save some money, simply look for articles/blogs/wikis in SDN or search in Google. There are plenty of these.
    For start I suggest these series of videoblogs [Basic ABAP OO eLearnings|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414800)ID1160600550DB10016261778120999663End?blog=/pub/wlg/15408]
    This will give you rough idea how the OO design should be done.
    Regards
    Marcin

Maybe you are looking for

  • Getting Error while running EBS ER Trusted Recon Scheduler

    Hi All, I have created EBS Connector and loaded it in oim. While i am trying to run the Scheduler EBS ER Trusted Recon Scheduler I got this Error : oracle.iam.connectors.common.ConnectorException: * I have checked in Log File It shows following Error

  • Can no longer drag and drop into my iPhone after iOS 7.0.3.

    I'm not entirely sure what is up with this but it's excruciatingly frustrating. I updated my iPhone 4S 64GB to iOS 7.0.3 the other day. When I plugged it into my car to play some music I noticed that most of the songs in my playlists showed up as bei

  • Short Dump - CONNE_IMPORT_CONVERSION_ERROR

    Hi, We just trying to upgrade to ECC6 EHP4 SP12. when trying to delete transactions in a company code, we are getting the short dump. Runtime Errors CONNE_IMPORT_CONVERSION_ERROR Exception CX_SY_CONVERSION_CODEPAGE Error in IMPORT statement: Change o

  • Valid email certificate in Keychain - How to use it sending messages?

    After asking a free Personal E-mail Certificate by thawte.com, I was enabled to dowload a file which automagically added my personal certificate in my Keychain. Wow.. nice.. and now? How to add this certificate in the headers of my messages? Btw, dur

  • Iphone automatically checks mail even though it's set to "manual" check

    In settings > mail, Auto-check is set to manual, but my phone still vibrates and beeps periodically -- even when it has been asleep and I'm not touching -- announcing that new mail has arrived. I'm using it to check a yahoo and a gmail account. Why i