Need help tp check my code

Hi, I have been having too busy with my other project and now running issue with java that I can't seem to get the Search() working even though I could compile and enter data...hopefully your advice will be helpful. Thanks!
Create a user-defined class called Employee with the following characteristics.
Data members whose accessibility should be restricted to members of the immediate class and sub-classes only.
1.     First name
2. Last name
3.     ID
4.     Salary
5.     Grade - single character P, F or C
The following methods should be included in the Employee class
1.     An appropriate constructor that will accept the Employee�s name, Salary and grade as parameters and initialize the data members accordingly. The ID may also be passed as a parameter OR it may be generated automatically. The ID field will be used as the �primary key� and as such no duplication should be allowed.
2.     Accessor and mutator methods that provide accessibility to the data members.
3.     A method that allows the salary of the employee to be increased.
4.     A method that allows the grade of the Employee to be changed.
5.     Override the toString method so details of the Employee may be returned as a String.
EmployeeData.java
import java.io.*;
// Employee class declaration.
class Employees
     protected String first_name;
     protected String last_name;
     protected int id;
     protected double salary;
     protected char grade;
     public Employees(int a_id)
     int id = a_id;
     public Employees()
     // constructor
      public Employees(String first_name, String last_name, int id, double salary, char grade)
     this.first_name = first_name;
     this.last_name = last_name;
     this.salary = salary;
     this.grade = grade;
     this.id = id;
     //Accessor and mutator methods that provide accessibility to the data members.
     public int getid()
          return this.id;
     //accessor
     public double getsalary()
          return this.salary;
     public char getGrade()
          return this.grade;
     //mutator
     public void setSalary(double salary)
          this.salary = salary;
     public void setGrade(char grade)
          this.grade = grade;
     //A method that allows the salary of the employee to be increased.
     public void increaseSalary(double newSalary)
          this.salary = salary + newSalary;
     //A method that allows the grade of the Employee to be changed
     public void changeGrade(char grade)
          this.grade = grade;
     public void display()
          System.out.println("First Name " + first_name);
          System.out.println("Last Name  " + last_name);
          System.out.println("Salary  " + salary);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////Employee.java
import java.io.*;
class EmployeeData extends Employees
     //Override the toString method so details of the Employee may be returned as a String.
     public String toString () {
          String info = super.toString();
          return info = "Name: " + first_name + " " + last_name + "\nID: " + id + "\nSalary: " + salary + "\nGrade: " + grade;
     //The ID field will be used as the �primary key� and as such no duplication should be allowed.
     private Employees database[];
     public int numOfEmployee;
     static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
     public EmployeeData()
          //numOfEmployee = 0;
          database = new Employees[10];
     public void DisplayEmployee() throws Exception
               int index = search(id);
               if (index!= -1)
                    database[index].display();
     public void RegEvaluation() throws Exception
               System.out.println("Enter Employee Data");
               System.out.print("Enter First name : ");
               String a_first_name = input.readLine();
               System.out.print("Enter Last name : ");
               String a_last_name = input.readLine();
               System.out.print("Enter Employee ID: ");
               int a_id = Integer.parseInt(input.readLine());
               System.out.print("Enter Employee Salary: ");
               double a_salary = Double.parseDouble(input.readLine());
               System.out.print("Enter Employee Grade: ");
               char a_grade = (char)input.read();
               int index = search(id);
               if (index != -1)
                    System.out.println("numOfEmployee " + numOfEmployee);
                    System.out.println("-------------------------------------");
                    database[numOfEmployee] = new Employees(a_first_name, a_last_name, a_id, a_salary, a_grade);
                    System.out.println("Employee Account Created!");
                    System.out.println("-------------------------------------");
                    numOfEmployee++;
     // To check for duplicate ID values
     public int search(int findID) throws Exception
          for(int x = 0; x < numOfEmployee; x++)
               if(database[x].getid() == findID)
                    System.out.println("\nEmployee ID exists");
          }return 0;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////useEmployeeData.java
class useEmployeeData
     public static void main(String args[]) throws Exception
          EmployeeData EmployeeData = new EmployeeData();
          EmployeeData.RegEvaluation();
          EmployeeData.DisplayEmployee();
          EmployeeData EmployeeData2 = new EmployeeData();
          EmployeeData2.RegEvaluation();
          EmployeeData2.DisplayEmployee();
}Message was edited by:
proyb

when I execute the program, it will ask for employee:
first name:
last name:
ID:
salary:
grade:
and on the second run, I was surprise why the first name and last name are on the same line...
first name: last name:
and continue to key in data as require.
Suppose I try to key in same ID number, it did not show an error message and create another object, now there are 2 object with similar keys.
Message was edited by:
proyb

Similar Messages

  • Need help to check my code !

    I am not ble to fetch all the data .
    Where is the problem !
    please help me to  modify the select statement
    REPORT YINTERACTIVEPROGRAM01.
    *CREATED BY:JYOTIRMOY DEB                                            *
    *DATE OF CREATION :                                                  *
    *TABLE DECLARATION
    TABLES:VBAK,  "Sales Document: Header Data
           VBKD,  "Sales Document: Business Data
           VBPA,  "Sales Document: Partner
           VBAP,  "Sales Document: Item Data
           ADRC,  "Addresses (central address admin.)
           T178T, "Conditions: Groups for Materials:text
           T188T, "Pricing groups for customers
           TVM1,
           TVM1T,  "Material pricing group 1: Description
           TVM2,
           TVM2T,  "Material Pricing Group 2: Description
           TVM3,
           TVM3T,  "Material Pricing Group 3: Description
           TVM4,
           TVM4T,  "Material Pricing Group 4: Description
           TVM5,
           TVM5T,  "Material Pricing Group 5: Description
           SZA1_D0100,
           TVLV ,   "Check table for release orders: Usage ID
           TVLVT,
           TVKGG,   "Customer Condition Groups (Customer Master)
           TVKGGT,
           TPAR,   "Business Partner: Functions
           TPART,
           TVAUT.  "Sales Documents: Order Reasons: Texts
    *SELECT OPTIONS
    Select-options S_VBELN for vbak-vbeln.
    *CREATING INTERNAL TABLES
    TYPES:BEGIN OF TY_TAB,
             VBELN LIKE VBAK-VBELN,
             VKORG LIKE VBAK-VKORG,
             ERDAT LIKE VBAK-ERDAT,
             AUGRU LIKE VBAK-AUGRU,
             BEZEI LIKE TVAUT-BEZEI,
             BSTDK LIKE VBKD-BSTDK,
             BSTDK_E LIKE VBKD-BSTDK_E,
             BSTKD LIKE VBKD-BSTKD,
             KDKG2 LIKE VBKD-KDKG2,
             KONDA LIKE VBKD-KONDA,
             MATNR LIKE VBAP-MATNR,
             SPART LIKE VBAP-SPART,
             KONDM LIKE VBAP-KONDM,
             WAERK LIKE VBAP-WAERK,
             NETWR LIKE VBAP-NETWR,
             KWMENG LIKE VBAP-KWMENG,
             VKAUS LIKE VBAP-VKAUS,
             MVGR1 LIKE VBAP-MVGR1,
             MVGR2 LIKE VBAP-MVGR2,
             MVGR3 LIKE VBAP-MVGR3,
             MVGR4 LIKE VBAP-MVGR4,
             MVGR5 LIKE VBAP-MVGR5,
             KUNNR LIKE VBPA-KUNNR,
             POSTCODE1 LIKE ADRC-POST_CODE1,
             POBOX LIKE ADRC-PO_BOX,
             NAME1 LIKE ADRC-NAME1,
             NAME2 LIKE ADRC-NAME2,
             CITY1 LIKE ADRC-CITY1,
             CITY2 LIKE ADRC-CITY2,
             COUNTRY LIKE ADRC-COUNTRY,
             STREET LIKE ADRC-STREET,
             STRSUPPL1 LIKE ADRC-STR_SUPPL1,
             STRSUPPL2 LIKE ADRC-STR_SUPPL2,
             STRSUPPL3 LIKE ADRC-STR_SUPPL3,
             NRART LIKE TPAR-NRART,
             VTEXT1 LIKE TPART-VTEXT,
             PARVW LIKE TPART-PARVW,
             BEZE_I LIKE TVLVT-BEZEI,
             VTEXT LIKE V_T178-VTEXT,
             V_TEXT like V_T188-VTEXT,
             BEZEI1 LIKE TVM1T-BEZEI,
             BEZEI2 LIKE TVM2T-BEZEI,
             BEZEI3 LIKE TVM3T-BEZEI,
             BEZEI4 LIKE TVM4T-BEZEI,
             BEZEI5 LIKE TVM5T-BEZEI,
             VTEXT2 LIKE TVKGGT-VTEXT,
             SMTP_ADDR LIKE ADR6-SMTP_ADDR,
         END OF TY_TAB.
    DATA: ITAB TYPE STANDARD TABLE OF TY_TAB WITH HEADER LINE.
    *WRITING THE QUERY
    SELECT A1~VBELN
           A1~VKORG
           A1~ERDAT
           A1~AUGRU
           A2~BSTDK
           A2~BSTDK_E
           A2~BSTDK
           A2~KONDA
           A2~KDKG2
           A3~MATNR
           A3~SPART
           A3~KONDM
           A3~WAERK
           A3~NETWR
           A3~KWMENG
           A3~VKAUS
           A3~MVGR1
           A3~MVGR2
           A3~MVGR3
           A3~MVGR4
           A3~MVGR5
           A4~POST_CODE1
           A4~PO_BOX
           A4~NAME1
           A4~NAME2
           A4~CITY1
           A4~CITY2
           A4~COUNTRY
           A4~STREET
           A4~STR_SUPPL1
           A4~STR_SUPPL2
           A4~STR_SUPPL3
           A5~BEZEI
           A6~KUNNR
           A7~NRART
           A8~VTEXT
           A9~PARVW
           A10~BEZEI
           A11~VTEXT
           A12~VTEXT
           A13~BEZEI
           A14~BEZEI
           A15~BEZEI
           A16~BEZEI
           A17~BEZEI
           A18~VTEXT
         A20~SMTP_ADDR
    INTO CORRESPONDING FIELDS OF TABLE ITAB
    FROM VBAK AS A1
    JOIN VBKD AS A2
    ON A1VBELN = A2VBELN
    JOIN VBAP AS A3
    ON A1VBELN = A3VBELN
    LEFT OUTER JOIN VBPA AS A6
    ON A2VBELN = A6VBELN
    AND A2POSNR = A6POSNR
    *JOIN ADR6 AS A20
    *ON A6ADRNR = A20ADDRNUMBER
    JOIN ADRC AS A4
    ON A6ADRNR = A4ADDRNUMBER
    LEFT OUTER JOIN TVM1T AS A13
    ON A3MVGR1 = A13MVGR1
    LEFT OUTER JOIN TVM2T AS A14
    ON A3MVGR2 = A14MVGR2
    LEFT OUTER JOIN TVM3T AS A15
    ON A3MVGR3 = A15MVGR3
    LEFT OUTER JOIN TVM4T AS A16
    ON A3MVGR4 = A16MVGR4
    LEFT OUTER JOIN TVM5T AS A17
    ON A3MVGR5 = A17MVGR5
    JOIN TPAR AS A7
    ON A7PARVW = A6PARVW
    JOIN TPART AS A8
    ON A8PARVW = A6PARVW
    LEFT OUTER JOIN T178T AS A11
    ON A3KONDM =  A11KONDM
    AND A11~SPRAS = SY-LANGU
    LEFT OUTER JOIN T188T as A12
    ON A2KONDA = A12KONDA
    AND A12~SPRAS = SY-LANGU
    JOIN  TPART AS  A9
    ON A6PARVW = A9PARVW
    LEFT OUTER JOIN TVLVT AS  A10
    ON A1ABRVW = A10ABRVW
    AND A10~SPRAS = SY-LANGU
    LEFT OUTER JOIN TVAUT AS  A5
    ON A1AUGRU = A5AUGRU
    AND A5~SPRAS = SY-LANGU
    LEFT OUTER JOIN TVKGGT AS A18
    ON A8SPRAS = A18SPRAS
    UP TO 100 ROWS
    WHERE A1~VBELN IN S_VBELN.
    *PRINTING THE OUTPUT
    loop AT ITAB.
    WRITE :
    /(30) 'Order No                    :', itab-VBELN,
    /(30) 'Sales Org                   :', itab-VKORG,
    /(30) 'Order Date                    :', itab-ERDAT,
    /(30) 'Purchase Order #           :', itab-BSTKD,
    /(30) 'Purchase Order Date           :', itab-BSTDK,
    /(30) 'Order Reason code            :', itab-AUGRU,
    /(30) 'Order Reason description      :', itab-BEZEI,
    /(30) 'Partner Type                :', itab-NRART,
    /(30) 'Partner Type description      :', itab-VTEXT,
    /(30) 'Partner no                :', itab-KUNNR,
    /(30) 'Partner Name1                :', itab-NAME1,
    /(30) 'Partner Name2                :', itab-NAME2,
    /(30) 'Partner Address 1           :', itab-STREET,
    /(30) 'Partner Address 2           :', itab-STRSUPPL1,
    /(30) 'Partner Address 3           :', itab-STRSUPPL2,
    /(30) 'Partner Address 4           :', itab-STRSUPPL3,
    /(30) 'City                     :', itab-CITY1,
    /(30) 'DISTRICT                :', itab-CITY2,
    /(30) 'Country                 :', itab-COUNTRY,
    /(30) 'Post Code                 :', itab-POSTCODE1,
    /(30) 'PO BOX                     :', itab-POBOX,
    /(30) 'Partner email                :', itab-SMTP_ADDR,
    /(30) 'Material no                :', itab-MATNR,
    /(30) 'Material  Division           :', itab-SPART,
    /(30) 'Product Line and Edition code:', itab-MVGR1,
    /(30) 'Product Line and Edition Desc:', itab-BEZEI1,
    /(30) 'Product Name code           :', itab-MVGR2,
    /(30) 'ProductName Desc           :', itab-BEZEI2,
    /(30) 'Product Version Code           :', itab-MVGR3,
    /(30) 'Product Version Desc           :', itab-BEZEI3,
    /(30) 'Product Platform Code      :', itab-MVGR4,
    /(30) 'Product Platform Desc      :', itab-BEZEI4,
    /(30) 'Product App Server Code      :', itab-MVGR5,
    /(30) 'Product App Server Desc      :', itab-BEZEI5,
    /(30) 'Compiler Code                :', itab-KONDM,
    /(30) 'Compiler Desc                :', itab-VTEXT,
    /(30) 'LanguageCode                :', itab-KONDA,
    /(30) 'LanguageDesc                :', itab-V_TEXT,
    /(30) 'Runtime Band Code           :', itab-VKAUS,
    /(30) 'Runtime Band description      :', itab-BEZE_I,
    /(30) 'Support Start Date           :', itab-BSTDK,
    /(30) 'Support End Date           :', itab-BSTDK_E,
    /(30) 'Support Level Code           :', itab-KDKG2,
    /(30) 'Support Level Desc           :', itab-VTEXT2,
    /(30) 'Order Quantity           :', itab-KWMENG,
    /(30) 'Net Price                :', itab-NETWR,
    /(30) 'Currency                :', itab-WAERK.
    uline.
    ENDLOOP.
    if sy-subrc <> 0.
      write : / 'No data found'.
    endif.

    Hi  Jyotirmoy Deb,
    Last time might be,you are the one that asking about using join statement on 3 tables.
    Now what are you doing in your code. use are joining almost 18 tables.this will not work anyone, and it will slow down the processing time of the report.
    First of all analysis the report what exactly you want and then
    first read the header data as in your case you using the Sale Document Header data.
    On the basis of Header data fetch the line item data.
    Don't processes all the tables at a time using the join clause.Because it decrease the efficiency of the program.
    Reward points,if useful.
    Regards,
    Manoj Kumar

  • Need help to check the code!

    In my program its not giving data for any value of VBELN.What is the reason !
    I am only getting one record between 3000 and 5000 ! What is wrong here!
    REPORT YINTERACTIVEPROGRAM01.
    TABLES:VBAP,
           VBPA,
           vbak,
           VBRP,
           VBRK,
           KNA1,
           ADRC,
           TPAR,
           TVKGG,
           TVM1T,
           TVM2T,
           TVM3T,
           TVM4T,
           VBKD,
           SZA1_D0100,
           TVLVT,
           T002,
           T178T.
    Select-options S_VBELN for vbak-vbeln.
    TYPES:BEGIN OF TY_TAB,
             VBELN LIKE VBAK-VBELN,
             VKORG LIKE VBAK-VKORG,
             ERDAT LIKE VBAK-ERDAT,
             AUGRU LIKE VBAK-AUGRU,
             BSTDK LIKE VBKD-BSTDK,
             BSTDK_E LIKE VBKD-BSTDK_E,
             spart like vbap-spart,
             kondm like vbap-kondm,
             waerk like vbap-waerk,
             netwr like vbap-netwr,
             kwmeng like vbap-kwmeng,
             vkaus like vbap-vkaus,
             land1 like vbpa-land1,
             nrart like tpar-nrart,
           vtext like tpar-vtext,
             parvw like tpar-parvw,
             name1 like adrc-name1,
             name2 like adrc-name2,
             name3 like adrc-name3,
             name4 like adrc-name4,
             ort01 like kna1-ort01,
             pstlz like kna1-pstlz,
             vtext like t178t-vtext,
             bezei1 like tvm1t-bezei,
             bezei2 like tvm2t-bezei,
             bezei3 like tvm3t-bezei,
             bezei4 like tvm4t-bezei,
             bezei5 like tvm5t-bezei,
             BEZEI like tvlvt-bezei,
             spras like t002-spras,
             laspez like t002-laspez,
         END  OF TY_TAB.
    DATA: ITAB TYPE STANDARD TABLE OF TY_TAB WITH HEADER LINE.
    *parameters:salesno like itab-vbeln.
    select s1~vbeln
           s1~vkorg
           s1~erdat
           s1~augru
           k1~BSTDK
           k1~BSTDK_E
           p1~spart
           p1~kondm
           p1~waerk
           p1~netwr
           p1~kwmeng
           p1~vkaus
           r1~land1
           t1~nrart
          t1~vtext
           t1~parvw
           n1~name1
           n1~name2
           n1~name3
           n1~name4
           c1~ort01
           c1~pstlz
           x1~vtext
           t2~BEZEI
           b1~bezei
           b2~bezei
           b3~bezei
           b4~bezei
           b5~bezei
           t3~spras
           t3~laspez
    into corresponding fields of table itab
    from  vbak as s1
    join  VBKD as k1
    on   s1vbeln = k1VBELN
    join vbap as p1
    on   k1vbeln = p1vbeln
    join t178t as x1
    on   p1kondm = x1kondm
    join vbpa as r1
    on   p1vbeln = r1vbeln
    join tpar as t1
    on   r1parvw = t1parvw
    join ADRC as n1
    on   r1adrnr = n1addrnumber
    join kna1 as c1
    on   r1land1 = c1land1
    join tvlvT as t2
    on p1vkaus =  t2abrvw
    join t002 as t3
    on c1spras = t3spras
    join tvm1t as b1
    on c1spras = b1spras
    AND p1mvgr1 = b1mvgr1
    join tvm2t as b2
    on c1spras = b2spras
    AND p1mvgr2 = b2mvgr2
    join tvm3t as b3
    on c1spras = b3spras
    AND p1mvgr3 = b3mvgr3
    join tvm4t as b4
    on c1spras = b4spras
    AND p1mvgr4 = b4mvgr4
    join tvm5t as b5
    on c1spras = b5spras
    AND p1mvgr5 = b5mvgr5
    up to 10 rows
    WHERE S1~VBELN IN S_VBELN.
    loop AT ITAB.
      WRITE : /(30)'VBELN: ',  ITAB-VBELN,
              /(30)'VKORG: ',  ITAB-VKORG,
              /(30)'ERDAT: ',  ITAB-ERDAT,
              /(30)'AUGRU: ',  ITAB-AUGRU,
              /(30)'BSTDK: ',  ITAB-BSTDK,
              /(30)'BSTDK_E:', ITAB-BSTDK_E,
              /(30)'SPART: ',  itab-spart,
              /(30)'KONDM: ',  itab-kondm,
              /(30)'WAERK: ',  itab-waerk,
              /(19)'NETWR: ' , itab-netwr,
              /(17)'KWMENG: ', itab-kwmeng,
              /(30)'VKAUS:',   itab-vkaus,
              /(30)'LAND1:',   itab-land1,
              /(30)'NRART:',   itab-nrart,
              /(30)'PARVW:',   itab-parvw,
              /(30)'ADDR1:',   itab-name1,
              /(30)'ADDR2:',   itab-name2,
              /(30)'ADDR3:',   itab-name3,
              /(30)'ADDR4:',   itab-name4,
              /(30)'PSTLZ:',   itab-pstlz,
              /(30)'ORT01:',   itab-ort01,
              /(30)'RUN TIME BAND DESC:',   itab-BEZEI,
              /(30)'Compiler desc:',itab-vtext,
              /(30)'BEZEI:',    itab-bezei,
              /(30)'BEZEI1:',   itab-BEZEI1,
              /(30)'BEZEI2:',   itab-BEZEI2,
              /(30)'BEZEI3:',   itab-BEZEI3,
              /(30)'BEZEI4:',   itab-BEZEI4,
              /(30)'BEZEI5:',   itab-bezei5,
              /(30)'LASPEZ :',  itab-LASPEZ,
              /(30)'spras :', itab-spras.
             uline.
    ENDLOOP.
                if sy-subrc <> 0.
                write : / 'No data found'.
                endif.

    FIRST CHECK IN THE TABLE WHETHER DATA IS PRESENT  OR NOT FOR THIS PARTICULAR SELECTION CRITERIA.
    and secondly i would like to suggest you that dont use inner join on so many tables instead use FOR ALL ENTRIES and after every SELECT statement check whether that table is initial.
    may be any of the table does not contain data for that criteria thats y it may not be displaying anything.

  • Need help with a activation code for Adobe Acrobat X Standard for my PC,, Don't have older version serial numbers,  threw programs away,  only have Adobe Acrobat X Standard,  need a code to unlock program?

    Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7. 

    You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.

  • I need help getting new authorization codes for digital copies

    I need help getting new authorization codes for digital copies of movies. Can someone help me out?

    There's a lot of results in Google when you search for this but unfortunately refreshing the page doesn't seem to generate a different code anymore. Mine also says already redeemed

  • Hi! I am newbie to Reports need help with check boxes

    Hi! I am newbie to Reports need help with check boxes. I am try-in to make a new check boxes that will validate in runtime. I have created two frames and one frame is dummy and other frame has big X line on it with conditions. Is this a right way to create check box! Please help thanks!

    and one frame is dummy and other frame has big X
    line on it with conditions. Is this a right way to
    create check box! Please help thanks!Instead of creating a frame for X, you can create Ractangle and place X in it. Rest is fine.

  • Need help to redeem contact code for OS X 7

    Need help to redeem contact code for OS X 7

    Hello NOREDEEM,
    Thanks for using Apple Support Communities.
    If you have the purchase code for OS X 10.7 Lion, then you can follow the directions below to redeem it on your Mac.
    Mac App Store: Redeem gift cards and download codes
    Take care,
    Alex H.

  • I need help I scratched the code off my itunes card

    I need help I scratched the code off my itunes card

    Click here and ask the iTunes Store staff for assistance. Supply them with as much of the code as you can.
    (102006)

  • Need help fine tuning my code

    This program im making is eventualy going to end up as an attack calculator; the thing is i need help finetuning my program so that a) when it is run it will start at the very top of the window ancestory. b) the 2 windows are locked onto the same ancestory (ancestory is the position of the window relitive to the others: ie the window that is on top of another is higher on the ancestory). this code runs and should easily cut and paste.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class AttackCalculator implements ActionListener{
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
         "Use the legend below for the correct government number. ",
          "Legend: Democracy = 1, Communism = 2, Autocracy = 3, Fascism = 4, ",
          "Monarchy = 5, Pacifism = 6, Technocracy = 7, Theocracy = 8, ",
          "Anarchy = 9, Corpocracy = 10, Ochlocracy = 11, Physiocracy = 12 ",
           public static void createAndShowGUI(){
           String[] labels = {
          "Enter how many troops you have: ", "Enter how many tanks you have: ",
          "Enter how many jets you have: ", "Enter how many ships you have: ",
          "Enter your government type (1-12 refer above): ","Enter your health(%)",
          "Enter your stage number (1-4): ", "Enter how many troops your enemy has: ",
          "Enter how many tanks your enemy has: ", "Enter how many jets your enemy has: ",
          "Enter how many ships your enemy has: ", "Enter your enemy's government type (1-12 refer above): ",
          "Enter your enemy's stage number (1-4): ", "Enter your enemy health: "};
            int numPairs = labels.length;
           JTextField[] textField = {
           new JTextField( 10 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ),
           new JTextField( 1 ), new JTextField( 10 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ),
           new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 )};
            //Create and populate the panel.
            JPanel p = new JPanel(new SpringLayout());
            for (int i = 0; i < numPairs; i++) {
                JLabel l = new JLabel(labels, JLabel.TRAILING);
    p.add(l);
    l.setLabelFor(textField[i]);
    p.add(textField[i]);
    JLabel l = new JLabel("Your union has 2+ members", JLabel.TRAILING);
    p.add(l);
    JCheckBox checkBox = new JCheckBox("", false);
    l.setLabelFor( checkBox );
    p.add(checkBox );
    JLabel la = new JLabel("Enemy's union 2+ members", JLabel.TRAILING);
    p.add(la);
    JCheckBox jcheckBox = new JCheckBox("", false);
    la.setLabelFor( jcheckBox );
    p.add(jcheckBox);
    JButton calculate = new JButton("Calculate");
    p.add(calculate);
    //Lay out the panel.
    SpringUtilities.makeCompactGrid(p,
    16, 2, //rows, cols
    6, 6, //initX, initY
    6, 6); //xPad, yPad
    JFrame contentPane = new JFrame();
    contentPane.setSize(420, 105);
    JLabel title1 = new JLabel("Use the legend below for the correct government number. \n");
    JLabel title2 = new JLabel("Legend: Democracy = 1, Communism = 2, Autocracy = 3, Fascism = 4, \n");
    JLabel title3 = new JLabel("Monarchy = 5, Pacifism = 6, Technocracy = 7, Theocracy = 8, \n");
    JLabel title4 = new JLabel("Anarchy = 9, Corpocracy = 10, Ochlocracy = 11, Physiocracy = 12 " );
    contentPane.add( title1 );
    contentPane.add( title2 );
    contentPane.add( title3 );
    contentPane.add( title4 );
    SpringLayout layout = new SpringLayout();
    contentPane.setLayout(layout);
    //Adjust constraints for the label so it's at (5,5).
    layout.putConstraint(SpringLayout.WEST, title1,
    5,
    SpringLayout.WEST, contentPane);
    layout.putConstraint(SpringLayout.NORTH, title1,
    5,
    SpringLayout.NORTH, contentPane);
    //Adjust constraints for the label so it's at (5,5).
    layout.putConstraint(SpringLayout.WEST, title2,
    5,
    SpringLayout.WEST, contentPane);
    layout.putConstraint(SpringLayout.NORTH, title2,
    20,
    SpringLayout.NORTH, contentPane);
    //Adjust constraints for the label so it's at (5,5).
    layout.putConstraint(SpringLayout.WEST, title3,
    5,
    SpringLayout.WEST, contentPane);
    layout.putConstraint(SpringLayout.NORTH, title3,
    35,
    SpringLayout.NORTH, contentPane);
    //Adjust constraints for the label so it's at (5,5).
    layout.putConstraint(SpringLayout.WEST, title4,
    5,
    SpringLayout.WEST, contentPane);
    layout.putConstraint(SpringLayout.NORTH, title4,
    50,
    SpringLayout.NORTH, contentPane);
    //Create and set up the window.
    JFrame frame1 = new JFrame("Endless Revolution Attack Calculator");
    frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);
    //Set up the content pane.
    p.setOpaque(true); //content panes must be opaque
    frame1.setContentPane(p);
    //Display the window.
    frame1.pack();
    frame1.setLocationRelativeTo( null );
    frame1.setVisible(true);
    contentPane.setLocationRelativeTo( null );
    contentPane.setVisible(true);
    public void actionPerformed( ActionEvent evt){
    public static void main(String[] args) {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    here is the second class needed to run
    import javax.swing.*;
    import javax.swing.SpringLayout;
    import java.awt.*;
    * A 1.4 file that provides utility methods for
    * creating form- or grid-style layouts with SpringLayout.
    * These utilities are used by several programs, such as
    * SpringBox and SpringCompactGrid.
    public class SpringUtilities {
         * A debugging utility that prints to stdout the component's
         * minimum, preferred, and maximum sizes.
        public static void printSizes(Component c) {
            System.out.println("minimumSize = " + c.getMinimumSize());
            System.out.println("preferredSize = " + c.getPreferredSize());
            System.out.println("maximumSize = " + c.getMaximumSize());
         * Aligns the first <code>rows</code> * <code>cols</code>
         * components of <code>parent</code> in
         * a grid. Each component is as big as the maximum
         * preferred width and height of the components.
         * The parent is made just big enough to fit them all.
         * @param rows number of rows
         * @param cols number of columns
         * @param initialX x location to start the grid at
         * @param initialY y location to start the grid at
         * @param xPad x padding between cells
         * @param yPad y padding between cells
        public static void makeGrid(Container parent,
                                    int rows, int cols,
                                    int initialX, int initialY,
                                    int xPad, int yPad) {
            SpringLayout layout;
            try {
                layout = (SpringLayout)parent.getLayout();
            } catch (ClassCastException exc) {
                System.err.println("The first argument to makeGrid must use SpringLayout.");
                return;
            Spring xPadSpring = Spring.constant(xPad);
            Spring yPadSpring = Spring.constant(yPad);
            Spring initialXSpring = Spring.constant(initialX);
            Spring initialYSpring = Spring.constant(initialY);
            int max = rows * cols;
            //Calculate Springs that are the max of the width/height so that all
            //cells have the same size.
            Spring maxWidthSpring = layout.getConstraints(parent.getComponent(0)).
                                        getWidth();
            Spring maxHeightSpring = layout.getConstraints(parent.getComponent(0)).
                                        getWidth();
            for (int i = 1; i < max; i++) {
                SpringLayout.Constraints cons = layout.getConstraints(
                                                parent.getComponent(i));
                maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth());
                maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight());
            //Apply the new width/height Spring. This forces all the
            //components to have the same size.
            for (int i = 0; i < max; i++) {
                SpringLayout.Constraints cons = layout.getConstraints(
                                                parent.getComponent(i));
                cons.setWidth(maxWidthSpring);
                cons.setHeight(maxHeightSpring);
            //Then adjust the x/y constraints of all the cells so that they
            //are aligned in a grid.
            SpringLayout.Constraints lastCons = null;
            SpringLayout.Constraints lastRowCons = null;
            for (int i = 0; i < max; i++) {
                SpringLayout.Constraints cons = layout.getConstraints(
                                                     parent.getComponent(i));
                if (i % cols == 0) { //start of new row
                    lastRowCons = lastCons;
                    cons.setX(initialXSpring);
                } else { //x position depends on previous component
                    cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST),
                                         xPadSpring));
                if (i / cols == 0) { //first row
                    cons.setY(initialYSpring);
                } else { //y position depends on previous row
                    cons.setY(Spring.sum(lastRowCons.getConstraint(SpringLayout.SOUTH),
                                         yPadSpring));
                lastCons = cons;
            //Set the parent's size.
            SpringLayout.Constraints pCons = layout.getConstraints(parent);
            pCons.setConstraint(SpringLayout.SOUTH,
                                Spring.sum(
                                    Spring.constant(yPad),
                                    lastCons.getConstraint(SpringLayout.SOUTH)));
            pCons.setConstraint(SpringLayout.EAST,
                                Spring.sum(
                                    Spring.constant(xPad),
                                    lastCons.getConstraint(SpringLayout.EAST)));
        /* Used by makeCompactGrid. */
        private static SpringLayout.Constraints getConstraintsForCell(
                                                    int row, int col,
                                                    Container parent,
                                                    int cols) {
            SpringLayout layout = (SpringLayout) parent.getLayout();
            Component c = parent.getComponent(row * cols + col);
            return layout.getConstraints(c);
         * Aligns the first <code>rows</code> * <code>cols</code>
         * components of <code>parent</code> in
         * a grid. Each component in a column is as wide as the maximum
         * preferred width of the components in that column;
         * height is similarly determined for each row.
         * The parent is made just big enough to fit them all.
         * @param rows number of rows
         * @param cols number of columns
         * @param initialX x location to start the grid at
         * @param initialY y location to start the grid at
         * @param xPad x padding between cells
         * @param yPad y padding between cells
        public static void makeCompactGrid(Container parent,
                                           int rows, int cols,
                                           int initialX, int initialY,
                                           int xPad, int yPad) {
            SpringLayout layout;
            try {
                layout = (SpringLayout)parent.getLayout();
            } catch (ClassCastException exc) {
                System.err.println("The first argument to makeCompactGrid must use SpringLayout.");
                return;
            //Align all cells in each column and make them the same width.
            Spring x = Spring.constant(initialX);
            for (int c = 0; c < cols; c++) {
                Spring width = Spring.constant(0);
                for (int r = 0; r < rows; r++) {
                    width = Spring.max(width,
                                       getConstraintsForCell(r, c, parent, cols).
                                           getWidth());
                for (int r = 0; r < rows; r++) {
                    SpringLayout.Constraints constraints =
                            getConstraintsForCell(r, c, parent, cols);
                    constraints.setX(x);
                    constraints.setWidth(width);
                x = Spring.sum(x, Spring.sum(width, Spring.constant(xPad)));
            //Align all cells in each row and make them the same height.
            Spring y = Spring.constant(initialY);
            for (int r = 0; r < rows; r++) {
                Spring height = Spring.constant(0);
                for (int c = 0; c < cols; c++) {
                    height = Spring.max(height,
                                        getConstraintsForCell(r, c, parent, cols).
                                            getHeight());
                for (int c = 0; c < cols; c++) {
                    SpringLayout.Constraints constraints =
                            getConstraintsForCell(r, c, parent, cols);
                    constraints.setY(y);
                    constraints.setHeight(height);
                y = Spring.sum(y, Spring.sum(height, Spring.constant(yPad)));
            //Set the parent's size.
            SpringLayout.Constraints pCons = layout.getConstraints(parent);
            pCons.setConstraint(SpringLayout.SOUTH, y);
            pCons.setConstraint(SpringLayout.EAST, x);
    }I know this is a lot but when I have tried to put out the portion where I belived the problem to be, didnt work, people couldent help, so here it is all of it.

    it wouldn't run for me, until I changed these lines
    contentPane.add( title1 );
    contentPane.add( title2 );
    contentPane.add( title3 );
    contentPane.add( title4 );
    SpringLayout layout = new SpringLayout();
    contentPane.setLayout(layout);
    to these
    contentPane.getContentPane().add( title1 );
    contentPane.getContentPane().add( title2 );
    contentPane.getContentPane().add( title3 );
    contentPane.getContentPane().add( title4 );
    SpringLayout layout = new SpringLayout();
    contentPane.getContentPane().setLayout(layout);
    then it worked OK, smaller frame on top (the one with the info), larger frame behind.
    both above all other windows
    made it into a .jar file (in case IDE influenced above) and ran the same way

  • Need Help With Simple ABAP Code

    Hello,
    I'm loading data from a DSO (ZDTBMAJ) to an Infocube (ZCBRAD06). I need help with ABAP code to some of the logic in Start Routine. DSO has 2 fields: ZOCTDLINX & ZOCBRDMAJ.
    1. Need to populate ZOCPRODCD & ZOCREFNUM fields in Infocube:
        Logic:-
        Lookup /BI0/PMATERIAL, if /BIC/ZOCBRDMAJ = /BIC/OIZOCBRDMAJ
        then /BIC/ZOCPRODCD = ZOCPRODCD in Infocube
               /BIC/ZOCREFNUM = ZOCREFNUM in Infocube         
    2. Need to populate 0G_CWWTER field in Infocube:
        Logic:
        Lookup /BIC/PZOCTDLINX, if /BIC/ZOCTDLINX = BIC/OIZOCTDLINX
        then G_CWWTER = 0G_CWWTER in Infocube.
    I would need to read single row at a time.
    Thanks!

    I resolved it.

  • Need help with pie chart code

    I am new to Java and am having problems and I am in need of some help. I have written the code for my Mortgage Calculator but do not know how to get my chart to work. I found an example of the chart code in my text book but I am not sure if I wrote it wrong. When I run the MortCalc code it compiles but the Pie Chart code won't. I tried to run the chart code by itself but it prints out another calculator. My question is 1.) Is my chart code written wrong? and 2.) How do i enter it into my MortCalc code so that I get my chart?
    **Below I have included the assignment(so you know what I am doing exactly) and below that the pie chart code just in case you have questions. Thanks for any advice you can give.
    **If you need the rest of the code I can post it too. It was too long to post with the pie chart code.
    Assignment:
    Write the program in Java(w/ a GUI) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage adn the user's selection from a menu of availible mortgage loans:
    --7 yrs @ 5.35%
    --15 yrs @ 5.5%
    --30 yrs @ 5.75%
    Use an array for the mortgage data for the different loans. Read the interst rates to fill the array from a sequential file. Display the mortgage payment amount followed by the loan balance and interest paid for each payment over the term of the loan. Add graphics in the form of a chart.Allow the user to loop back and enter a new amount and make a new selection of quit. Please insert comments in the program to document the program.
    CODE:
    import java.awt.Color;
    import java.awt.Graphics2D;
    import java.awt.Rectangle;
    //Class to hold a value for a slice
    public class PieValue {
    double value;
    Color color;
    public PieValue(double value, Color color) {
    this.value = value;
    this.color = color;
    // slices is an array of values that represent the size of each slice.
    public void drawPie(Graphics2D g, Rectangle area, PieValue[] slices) {
    // Get total value of all slices
    double total = 0.0D;
    for (int i=0; i<slices.length; i++) {
    total += slices.value;
    // Draw each pie slice
    double curValue = 0.0D;
    int startAngle = 0;
    for (int i=0; i<slices.length; i++) {
    // Compute the start and stop angles
    startAngle = (int)(curValue * 360 / total);
    int arcAngle = (int)(slices[i].value * 360 / total);
    // Ensure that rounding errors do not leave a gap between the first and last slice
    if (i == slices.length-1) {
    arcAngle = 360 - startAngle;
    // Set the color and draw a filled arc
    g.setColor(slices[i].color);
    g.fillArc(area.x, area.y, area.width, area.height, startAngle, arcAngle);
    curValue += slices[i].value;

    // Draw each pie slice
    double curValue = 0.0D;
    int startAngle = 0;
    for (int i=0; i<slices.length; i+) {
    // Compute the start and stop angles
    startAngle = (int)(curValue 360 / total);
    int arcAngle = (int)(slices.value * 360 / total);Look here and i think you will find some syntax errors.
    Count the brackets.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • I need help activating my redemption code.

    I need help activating my redemption code

    Hello Joe,
    as an addition: please have a look there Redemption Code Help and if necessary and for further questions click through (Still need help? Contact us.) >>>
    http://helpx.adobe.com/contact.html and if "open" please use chat, I had the best experiences. I quote from Adobe's employee Preran: The chat button is activated as soon as there is an agent available to help.
    Good luck!
    Hans-Günter

  • Need help embedding mailchimp subscription code into dreamweaver.

    so I created my page in edge animate, and then I brought it over to adobe dreamweaver, and I dont know where or how to place my embeded mailchimp code? 
    <!-- Begin MailChimp Signup Form -->
    <link href="//cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
    <style type="text/css">
              #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif;  width:360px;}
              /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
                 We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
    </style>
    <div id="mc_embed_signup">
    <form action="http://kandied.us3.list-manage.com/subscribe/post?u=4525b320bd81872705a48ea05&id=4743a970b 1" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
              <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
        <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
        <div style="position: absolute; left: -5000px;"><input type="text" name="b_4525b320bd81872705a48ea05_4743a970b1" value=""></div>
              <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
    </form>
    </div>
    <!--End mc_embed_signup-->
    I keep trying to add it to it, but I either get noting or just the subscription box. does this happen due to my edge animate project?

    Ben Thank you so much for your reply! It helped me read the code and made me understand it better. I decided to make my own subscription box by making a symbol "Subscription" and inside this i created two more symbols called "Textbox" and "Submittbutton". I tried putting in part of the code from above under the div id, but it kept creating the whole text box behind the symbols in dreamweaver. How would you suggest I embed the code from above into my created submission box below?
             <div id="Stage_Center2_Subscription">
                    <div id="Stage_Center2_Subscription_subscribe"></div>
                    <div id="Stage_Center2_Subscription_Submittbutton">
                        <div id="Stage_Center2_Subscription_Submittbutton_Submitbutton">
                            <div id="Stage_Center2_Subscription_Submittbutton_Submitbutton_RoundRect2"></div>
                        </div>
                        <div id="Stage_Center2_Subscription_Submittbutton_text">
                            <div id="Stage_Center2_Subscription_Submittbutton_text_Text">Join</div>
                        </div>
                    </div>
                    <div id="Stage_Center2_Subscription_Textbox">
                        <div id="Stage_Center2_Subscription_Textbox_textbox">
                            <div id="Stage_Center2_Subscription_Textbox_textbox_RoundRect"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    </html>
    Thank you for taking the time to look at my question! I really appreciate it!
    Kyle

  • Need help on Modifying Jsp Code to establish relationships in iStore.

    I am currently working on iStore an internet enabled product
    from Oracle.
    In iStore one can establish relationships between products like
    cross sell , complimentary, substitute, conflict etc. However at
    the moment only one relationship works i.e: Related. This is
    because this is a bug in iStore. Only the relationship Related
    is defined in the jsp. We have been asked to modify the jsp
    ibeCCtdItemDetail.jsp
    Please find pasted below the jsp which only had the arrays for
    related i.e: relitems and service i.e service have added the
    array complimentary to establish such a relationship and pasted
    the relitems code once again and changed relitems to
    complimentary. I am stuck up on this since the past 2 weeks i
    would appreciate if anybody could help.
    <%@include file="jtfincl.jsp" %>
    <!-- $Header: ibeCCtdItemDetail.jsp 115.24 2001/06/16 15:21:05
    pkm ship $ -->
    <%--
    =================================================================
    ========
    | Copyright (c)2000 Oracle Corporation, Redwood Shores, CA
    | All rights reserved.
    +================================================================
    ===========
    |
    | FILE
    | ibeCCtdItemDetail.jsp - Item Detail display
    |
    | DESCRIPTION
    | Displays Item Detail page. Item's description, long
    description, large
    | image, flexfields, available services, and related items
    are displayed.
    | The list price and best price (selling price) for each of
    the Item's
    | available units of measure is displayed. Displays Add to
    Cart,
    | Express Checkout, Configure buttons (if appropriate).
    |
    | PARAMETERS (SOURCE)
    | party Id IN (RequestCtx) - user's party
    id
    | account Id IN (RequestCtx) - user's
    account id
    | currency code IN (RequestCtx) - currency code
    | item IN (URL) - Item ID
    | section IN (URL) - section ID of
    section we are
    | coming from
    (optional)
    | item IN (pageContext) - Item ID
    | section IN (pageContext) - Section ID
    | qty IN (pageContext) - Quantity
    entered by user
    | uom IN (pageContext) - UOM selected
    by user
    | errorMsg IN (pageContext) - error message
    from buy
    | routing page
    | * pageContext attributes for "item" and "section" are used
    when the URL
    | does not contain valid values for "item" and "section"
    (such as when an
    | error occurred in the buy routing page and the request is
    forwarded
    | back to this page)
    |
    | oneclick_obj OUT (pageContext) - OneClick
    object containing
    | user's
    Express Checkout
    | preferences
    | postingID OUT (pageContext) - Integer
    posting Id, for
    | iMarketing
    integration
    | itemIDs OUT (pageContext) - int[] itemIDs
    on the page
    | (for use by
    postings)
    | numRequested OUT (pageContext) - Integer
    number of postings,
    | for
    iMarketing integration
    | random OUT (pageContext) - Boolean
    whether to randomize
    | posting
    retrieved, for
    | iMarketing
    integration
    | type OUT (HTML form) - "single" (1
    item)
    | item OUT (HTML form) - Item ID
    | refpage OUT (HTML form) -
    "ibeCCtdItemDetail.jsp" plus any
    | parameters
    needed to return
    | to this page
    in case of error.
    | uom OUT (HTML form) - UOM code
    selected by user
    | qty OUT (HTML form) - quantity
    entered by user
    | Add to Cart.x OUT (HTML form) - user clicks
    Add to Cart
    | 1-Click.x OUT (HTML form) - user clicks
    Express Checkout
    | Configure.x OUT (HTML form) - user clicks
    Configure
    |
    | OBJECTS REFERENCED
    | oracle.apps.ibe.catalog.Item
    | oracle.apps.ibe.order.OneClick
    |
    | APIs REFERENCED
    | Item.getItemID() - get Item ID
    | Item.getDescription() - get item description
    | Item.getLongDescription() - get item long description
    | Item.isConfigurable() - whether item has
    configuration UI set up
    | Item.getFlexfields() - get Item flexfield
    prompts and values
    | Item.getRelatedItems() - get related items and
    service items
    | Item.getMediaFileName() - get media based on
    display context
    | OneClick.loadSettingFrDB() - load Express Checkout
    settings for
    | current user
    |
    | JSPs REFERENCED
    | ibeCCtpPostingI.jsp - set iMarketing
    parameters (include)
    | ibeCCtpSetItem.jsp - retreive and set item
    information (include)
    | ibeCCtpItmDspRte.jsp - Item display routing
    page (link)
    | ibeCCtpBuyRoute.jsp - Buy routing
    page (form POST)
    | ibeCCtdSctPath.jsp - Path Traversed
    Display (include)
    | ibeCXpdShowTag.jsp - Express Checkout Tag
    Area (include)
    | ibapstng.jsp - iMarketing integration
    page (include)
    |
    | ADDITIONAL NOTES
    | iMarketing posting ID can be changed by editing file
    ibeCCtpPostingI.jsp
    |
    | HISTORY
    | 08/01/2000 auyu Created.
    | 04/09/2001 auyu Added compile-time include for retrieving
    item
    | information
    |
    +================================================================
    =======--%>
    <%@page import="oracle.apps.ibe.order.*" %>
    <%@page import="oracle.apps.ibe.catalog.*" %>
    <%@page import="oracle.apps.ibe.store.*" %>
    <%@page import="oracle.apps.jtf.displaymanager.*" %>
    <%@page import="oracle.apps.jtf.base.Logger" %>
    <%@page import="oracle.apps.jtf.minisites.*" %>
    <%@include file="ibeCZzpHeader.jsp" %>
    <%@page import="oracle.jdbc.driver.*" %>
    <%@page import="java.sql.*" %>
    <%-- declaration --%>
    <%!
    /* Retrieve parent section ids for a given item.
    * int itemId - Item whose parent section ids will be retrieved
    int getParentSectionId(int itemId)
    int parentSectionId = -1;
    Connection conn = null;
    OraclePreparedStatement stmt = null;
    ResultSet rs = null;
    try {
    BigDecimal minisiteId = RequestCtx.getMinisiteId();
    conn = TransactionScope.getConnection();
    StringBuffer sql = new StringBuffer(400);
    sql.append("select jdsi.section_id ");
    sql.append("from jtf_dsp_section_items jdsi, ");
    sql.append("jtf_dsp_msite_sct_items jdmsi ");
    sql.append("where jdsi.inventory_item_id = ? ");
    sql.append("and jdsi.section_item_id =
    jdmsi.section_item_id ");
    sql.append("and jdmsi.mini_site_id = ? ");
    sql.append("and nvl(jdsi.start_date_active, sysdate) <=
    sysdate ");
    sql.append("and nvl(jdsi.end_date_active, sysdate) >=
    sysdate ");
    sql.append("and nvl(jdmsi.start_date_active, sysdate) <=
    sysdate ");
    sql.append("and nvl(jdmsi.end_date_active, sysdate) >=
    sysdate");
    stmt = (OraclePreparedStatement)conn.prepareStatement
    (sql.toString());
    stmt.setInt(1, itemId);
    stmt.setInt(2, minisiteId.intValue());
    stmt.defineColumnType(1, Types.INTEGER);
    rs = stmt.executeQuery();
    if (rs.next())
    parentSectionId = rs.getInt(1);
    } catch (Exception e1) {
    parentSectionId = -1;
    IBEUtil.log("ibeCCtdItemDetail.jsp",
    "Caught exception while retrieving parent
    section id");
    IBEUtil.log("ibeCCtdItemDetail.jsp", e1.getMessage());
    } finally
    try { if (rs != null) rs.close(); } catch (Exception e2) {}
    try { if (stmt != null) stmt.close(); } catch (Exception
    e2) {}
    try {
    if (conn != null) TransactionScope.releaseConnection
    (conn);
    } catch (Exception e2) {}
    return parentSectionId;
    %>
    <%-- end declaration --%>
    <%@include file="ibeCCtpSetItem.jsp"%>
    <%
    The compile-time inclusion of ibeCCtpSetItem.jsp will declare
    and set
    the following variables:
    boolean bItemLoaded - whether section was
    loaded
    Item lItem - Item
    boolean bItemCanBeOrdered - whether item can be
    ordered
    String[] uomCodes - Item's UOM Codes
    Vector itemSellPriceDisplayVec - vector containing
    item's selling
    prices in formatted
    strings
    Vector itemListPriceDisplayVec - vector containing
    item's list
    prices in formatted
    strings
    int nPriceDefined - number of prices
    defined for the item
    Perform the following actions:
    Set "itemIds" in the PageContext.REQUEST_SCOPE
    Set "item" in PageContext.REQUEST_SCOPE
    Set "section" in PageContext.REQUEST_SCOPE
    MessageManagerInter lMsgMgr =
    Architecture.getMessageManagerInstance();
    pageContext.setAttribute("_pageTitle",
    lMsgMgr.getMessage
    ("IBE_PRMT_CT_PRODUCT_DETAILS"),
    PageContext.REQUEST_SCOPE);
    %>
    <%@ include file="ibeCCtpPostingI.jsp" %>
    <%@ include file="ibeCZzdTop.jsp" %>
    <%@ include file="ibeCZzdMenu.jsp" %>
    <%
    if (bItemLoaded)
    OneClick lOneClickObj;
    String xprTagArea = "", confirmXpr = "";
    String lBuyRoutePage;
    String lSectionPathPage = "";
    int sectid = 0;
    Item[] services = new Item[0];
    Item[] relItems = new Item[0];
    Item[] complimentary = new Item[0];
    ItemFlexfield[] itemFlexfields = new ItemFlexfield[0];
    String lItemImage = "", lItemAddtlInfoFile = "";
    StringBuffer lRef = new StringBuffer("ibeCCtdItemDetail.jsp?
    item=");
    String qty = "", userSelUOM = "";
    String errorMsg = "";
    //--------------- load express checkout preferences ---------
    if (IBEUtil.useFeature("IBE_USE_ONE_CLICK"))
    xprTagArea = DisplayManager.getTemplate
    ("STORE_XPR_TAG_AREA").getFileName();
    if (xprTagArea == null)
    xprTagArea = "";
    confirmXpr = lMsgMgr.getMessage("IBE_PRMT_EXPR_CONFIRM");
    if (RequestCtx.userIsLoggedIn()) {
    //initialize OneClick if user is logged in
    BigDecimal partyId = RequestCtx.getPartyId();
    BigDecimal accountId = RequestCtx.getAccountId();
    lOneClickObj = new OneClick();
    lOneClickObj.loadSettingsFrDB(partyId, accountId);
    } // end user express checkout
    //------------ set "section", lSectionPathPage --------------
    String lSectionId = IBEUtil.nonNull(request.getParameter
    ("section"));
    if (lSectionId.equals(""))
    lSectionId =
    IBEUtil.nonNull((String)pageContext.getAttribute
    ("section", PageContext.REQUEST_SCOPE));
    if(IBEUtil.useFeature("IBE_USE_SECTION_PATH"))
    lSectionPathPage = DisplayManager.getTemplate
    ("STORE_CTLG_SCT_PATH").getFileName();
    try {
    sectid = Integer.parseInt(lSectionId);
    pageContext.setAttribute("section", String.valueOf
    (sectid), PageContext.REQUEST_SCOPE);
    } catch (NumberFormatException e) { }
    if(lSectionPathPage == null)
    lSectionPathPage = "";
    lBuyRoutePage = DisplayManager.getTemplate
    ("STORE_CTLG_BUY_PROCESS_ROUTE").getFileName();
    /* if error and forwarded back to this page, get values
    selected by user */
    qty = IBEUtil.nonNull((String)pageContext.getAttribute
    ("qty", PageContext.REQUEST_SCOPE));
    if (qty.equals(""))
    qty = "1";
    userSelUOM = IBEUtil.nonNull((String)pageContext.getAttribute
    ("uom", PageContext.REQUEST_SCOPE));
    errorMsg = IBEUtil.nonNull((String) pageContext.getAttribute
    ("errorMsg", PageContext.REQUEST_SCOPE));
    //set ref for returning to this page in case of error
    lRef.append(lItem.getItemID());
    if (sectid > 0)
    lRef.append("&section=");
    lRef.append(sectid);
    /* Get Bin Open and Bin Close Images */
    String binOpenImg = "", binCloseImg = "";
    try {
    Media binOpenMedia = DisplayManager.getMedia
    ("STORE_BIN_OPEN_IMAGE", true);
    if (binOpenMedia != null)
    binOpenImg = binOpenMedia.getFileName();
    } catch (MediaNotFoundException mnfe) {}
    if (binOpenImg == null)
    binOpenImg = "";
    try {
    Media binCloseMedia = DisplayManager.getMedia
    ("STORE_BIN_CLOSE_IMAGE", true);
    if (binCloseMedia != null)
    binCloseImg = binCloseMedia.getFileName();
    } catch (MediaNotFoundException mnfe) {}
    if (binCloseImg == null)
    binCloseImg = "";
    /* Get images, additional info, flexfields, related items,
    service items */
    lItemImage = lItem.getMediaFileName
    ("STORE_PRODUCT_LARGE_IMAGE");
    lItemAddtlInfoFile = lItem.getMediaFileName
    ("STORE_PRODUCT_ADDTL_INFO");
    // check for defaulting
    String defaultFromSection = "Y";
    if ("Y".equals(defaultFromSection))
    if (lItemImage == null || lItemAddtlInfoFile == null)
    try {
    int parentSectionId = getParentSectionId
    (lItem.getItemID());
    Section parentSection = Section.load(parentSectionId);
    if (lItemImage == null)
    lItemImage = parentSection.getMediaFileName
    ("STORE_SECTION_SMALL_IMAGE");
    if (lItemAddtlInfoFile == null)
    lItemAddtlInfoFile = parentSection.getMediaFileName
    ("STORE_SECTION_ADDTL_INFO");
    } catch (Exception e) {}
    itemFlexfields = lItem.getFlexfields();
    try {
    services = lItem.getRelatedItems("SERVICE");
    } catch (ItemNotFoundException e) {}
    try {
    relItems = lItem.getRelatedItems("RELATED");
    } catch (ItemNotFoundException e) {}
    try {
    complimentary = lItem.getRelatedItems("COMPLIMENTARY");
    } catch (ItemNotFoundException e) {}
    %>
    <!-- body section -----------------------------------------------
    ------------->
    <table border="0" width="100%">
    <%
    if (IBEUtil.showPosting()) {
    %>
    <!--------- iMarketing integration ----------------->
    <tr><td colspan="4" align="center">
    <% try {
    %>
    <jsp:include page="ibapstng.jsp" flush="true" />
    <% } catch (Throwable e) {
    IBEUtil.log("ibeCCtdItemDetail.jsp", "iMarketing error",
    Logger.ERROR);
    %>
    </td></tr>
    <% } //end iMarketing installed
    %>
    <tr><td> </td>
    <%
    if(!lSectionPathPage.equals(""))
    %>
    <td colspan="4" class="smallLink">
    <jsp:include page="<%=lSectionPathPage%>" flush="true" />
    </td>
    <% }
    %>
    </tr>
    <tr><td valign="top">   </td>
    <!-- center column ------------------------------------------
    ------------->
    <td valign="top" width="70%">
    <table border="0" cellpadding="0" cellspacing="0">
    <tr><td colspan="3">
    <span class="pageTitle"><%=lItem.getDescription()%
    </span></td></tr>
    <tr>
    <% if (lItemImage != null) {
    %>
    <td valign="TOP"><img src="<%=lItemImage%>"></td>
    <td valign="TOP" colspan="2"><%
    =lItem.getLongDescription()%></td>
    <% } else {
    %>
    <td valign="TOP" colspan="3"><%
    =lItem.getLongDescription()%></td>
    <% }
    %>
    </tr>
    <% if (lItemAddtlInfoFile != null) {
    %>
    <tr><td colspan="3"><br>
    <jsp:include page="<%=lItemAddtlInfoFile%>"
    flush="true" />
    </td></tr>
    <% }
    %>
    <tr><td colspan="3"><br></td></tr>
    <%
    for (int i=0; i < itemFlexfields.length; i++)
    String prompt = itemFlexfields.getPrompt();
    String value = itemFlexfields[i].getValue();
    if (value != null && !value.equals(""))
    %>
    <tr>
    <td align="LEFT" width="20%">
    <span class="sectionHeader2"><%=prompt%
       </span></td>
    <td align="LEFT" colspan="2" width="80%"><%=value%
    </td></tr>
    <% }
    if (services.length > 0)
    %>
    <tr><td colspan="3"><br></td></tr>
    <tr><td align="RIGHT" class="sectionHeader1" width="20%">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_WARRANTIES")%>
    </td>
    <td colspan="2" align="left" class="sectionHeaderBlack"
    width="80%"><hr>
    </td></tr>
    <%
    for(int i=0; i < services.length; i++)
    %>
    <tr>
    <td valign="TOP" class="sectionHeaderBlack"
    width="20%"> </td>
    <td align="left" colspan="2" valign="TOP" width="80%">
    <span class="sectionHeaderBlack">
    <A HREF="<%= DisplayManager.getURL
    (STORE_CTLG_ITM_ROUTE", "item=" + services[i.getItemID()) %>">
    <%=services.getDescription()%></A>
    </span>
    <%=services[i].getLongDescription()%>
    </td>
    </tr>
    <tr>
    <td colspan="3" class="sectionHeaderBlack"> </td>
    </tr>
    <% } //end loop through services
    } // end if services.length > 0
    if (relItems.length > 0) {
    %>
    <tr><td colspan="3"><br></td></tr>
    <tr>
    <td align="RIGHT" class="sectionHeader1" width="20%">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_REL_PRODUCTS")%>
    </td>
    <td align="left" colspan="2" class="sectionHeaderBlack"
    width="80%"><hr></td>
    </tr>
    <%
    for(int i=0; i < relItems.length; i++)
    %>
    <tr>
    <td valign="TOP" class="sectionHeaderBlack"
    width="20%"> </td>
    <td colspan="2" align="left" valign="TOP"
    width="80%">
    <span class="sectionHeaderBlack">
    <A HREF="<%= DisplayManager.getURL
    ("STORE_CTLG_ITM_ROUTE", "item=" + relItems[i].getItemID()) %>">
    <%=relItems[i].getDescription()%></A>
    </span>
    <%=relItems[i].getLongDescription()%>
    </td>
    </tr>
    <tr>
    <td colspan="3" align="RIGHT"
    class="sectionHeaderBlack"> </td>
    </tr>
    <% } // end loop through related items
    } // end if relItems.length > 0
    %>
    </table>
    </td>
    <%if (complimentary.length > 0) {
    %>
    <tr><td colspan="3"><br></td></tr>
    <tr>
    <td align="RIGHT" class="sectionHeader1" width="20%">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_REL_PRODUCTS")%>
    </td>
    <td align="left" colspan="2" class="sectionHeaderBlack"
    width="80%"><hr></td>
    </tr>
    <%
    for(int i=0; i < complimentary.length; i++)
    %>
    <tr>
    <td valign="TOP" class="sectionHeaderBlack"
    width="20%"> </td>
    <td colspan="2" align="left" valign="TOP"
    width="80%">
    <span class="sectionHeaderBlack">
    <A HREF="<%= DisplayManager.getURL
    ("STORE_CTLG_ITM_ROUTE", "item=" + complimentary[i].getItemID())
    %>">
    <%=complimentary[i].getDescription()%></A>
    </span>
    <%=complimentary[i].getLongDescription()%>
    </td>
    </tr>
    <tr>
    <td colspan="3" align="RIGHT"
    class="sectionHeaderBlack"> </td>
    </tr>
    <% } // end loop through related items
    } // end if complimentary.length > 0
    %>
    </table>
    </td>
    <!-- right column -------------------------------------------
    ------------->
    <td valign="top" width="20%">
    <table border="0" cellpadding="0" cellspacing="0">
    <tr><td>
    <table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <% if (! binOpenImg.equals("")) {
    %>
    <td><img src="<%=binOpenImg%>"></td>
    <% }
    %>
    <td nowrap class="binHeaderCell" width="100%">
    <%
    if (!lItem.isConfigurable()) {
    %>
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_2_WAYS_TO_SHOP")%>
    <% } else {
    %>
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_CONFIG_PRODUCT")%>
    <% }
    %>
    </td>
    <% if (! binCloseImg.equals("")) {
    %>
    <td><img src="<%=binCloseImg%>"></td>
    <% }
    %>
    </tr>
    </table>
    </td></tr>
    <tr><td class="binColumnHeaderCell">
    <table border="0" cellspacing="1" width="100%">
    <tr><td class="binContentCell" align="CENTER">
    <% /////////////////////////////// error
    messages //////////////////////////////
    if (!errorMsg.equals("")) {
    %>
    <table><tr><td align="center" class="errorMessage">
    <%=errorMsg%>
    </td></tr></table>
    <% }
    /////////////////////////////// display
    form //////////////////////////////////%>
    <!--Javascript for express checkout confirmation-->
    <script language="JavaScript">
    function get_confirmation(form)
    if (confirm("<%=confirmXpr%>" ) ) {
    form.tmpx.name = '1-Click.x';
    form.tmpy.name = '1-Click.y';
    form.submit();
    return true;
    else
    return false;
    </script>
    <form method=POST action="<%=lBuyRoutePage%>">
    <input type=hidden name="type" value="single">
    <input type=hidden name="item" value="<%=lItem.getItemID()%
    "><input type=hidden name="refpage" value="<%=lRef.toString
    ()%>">
    <INPUT TYPE="HIDDEN" NAME="tmpx" VALUE="100">
    <INPUT TYPE="HIDDEN" NAME="tmpy" VALUE="100">
    <%= RequestCtx.getSessionInfoAsHiddenParam() %>
    <%
    if ( ! lItem.isConfigurable())
    { // display prices
    %>
    <table>
    <tr><td align ="left" nowrap>
    <span class="sectionHeaderBlack">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_LIST_PRICE_COLON")%>
    </span>
    </td>
    <%
    for (int i=0; i < uomCodes.length && i <
    itemListPriceDisplayVec.size(); i++)
    if (uomCodes[i] != null && uomCodes[i].equals
    (lItem.getPrimaryUOMCode()))
    if (itemListPriceDisplayVec.elementAt(i) != null &&
    !itemListPriceDisplayVec.elementAt(i).equals(""))
    %>
    <td align="right">
    <%=itemListPriceDisplayVec.elementAt(i)%
       <%=lItem.getPrimaryUOM()%></td>
    <% } else {
    %>
    <td>   </td>
    <% }
    break;
    } // end primary uomcode
    } // end loop through uoms and list price
    %>
    </tr>
    <tr><td align="left" nowrap>
    <span class="sectionHeaderBlack">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_YOUR_PRICE_COLON")%>
    </span>
    </td>
    <td>
    <% // display selling price for each uom
    if (nPriceDefined > 1) {
    //prices defined for multiple UOMs for the item
    %>
    <select name = "uom">
    <%
    //--------- loop through uoms and prices ------------------
    for (int i=0; i < itemSellPriceDisplayVec.size() && i <
    uomCodes.length; i++)
    if (itemSellPriceDisplayVec.elementAt(i) != null &&
    !itemSellPriceDisplayVec.elementAt(i).equals(""))
    boolean bSelectUom = false;
    if (uomCodes[i] != null && uomCodes[i].equals
    (lItem.getPrimaryUOMCode()))
    bSelectUom = true;
    if (bSelectUom)
    %>
    <option value="<%=uomCodes[i]%>" SELECTED>
    <% } else {
    %>
    <option value="<%=uomCodes[i]%>">
    <% }
    %>
    <%=itemSellPriceDisplayVec.elementAt(i)%
       <%=IBEUtil.nonNull(lItem.getUOM(uomCodes))%
    <%
    } // end current uom has price
    } //end loop i through uoms and prices
    %>
    </select>
    <% //end more than 1 UOM with price defined for the item
    } else {
    if (nPriceDefined == 0) { //multiple UOMs, none with
    price defined
    %>
    <input type=hidden name="uom" value="<%
    =lItem.getPrimaryUOMCode()%>">
    <% } else { // 1 UOM with price defined
    String formatSellPrice = "";
    String uomWithPrice = "";
    for (int i=0; i < uomCodes.length && i <
    itemSellPriceDisplayVec.size(); i++)
    if (itemSellPriceDisplayVec.elementAt(i) != null &&
    !itemSellPriceDisplayVec.elementAt(i).equals(""))
    formatSellPrice = (String)
    itemSellPriceDisplayVec.elementAt(i);
    uomWithPrice = uomCodes;
    break;
    %>
    <input type=hidden name="uom" value="<%=uomWithPrice%>">
    <%=formatSellPrice%>   <%=IBEUtil.nonNull
    (lItem.getUOM(uomWithPrice))%>
    <% } //end 1 UOM with price defined
    } // end display selling prices
    %>
    </td></tr></table> <%-- end table for the price --%>
    <% } // end non-configurable item
    if (bItemCanBeOrdered)
    // show quantity and buttons only if item can be ordered
    %>
    <p><%=lMsgMgr.getMessage("IBE_PRMT_CT_QUANTITY")%>
    <input type="TEXT" name="qty" size="3" maxlength="20"
    value="<%=qty%>">
    </p>
    <% if (lItem.isConfigurable()) {
    %>
    <p>
    <input type=hidden name="uom" value="<%
    =lItem.getPrimaryUOMCode()%>">
    <input type=submit name="Configure.x"
    value="<%=lMsgMgr.getMessage("IBE_PRMT_CT_CONFIGURE")%
    "></p>
    <% } else {
    %>
    <p>
    <input type=submit name="Add to Cart.x"
    value="<%=lMsgMgr.getMessage
    ("IBE_PRMT_ADD_TO_CART_PRMT_G")%>">
    </p>
    <%
    if (!xprTagArea.equals(""))
    %>
    <p><%=lMsgMgr.getMessage("IBE_PRMT_CT_OR")%></p>
    <p><jsp:include page="<%=xprTagArea%>"
    flush="true" /></p>
    <% }
    } // end item can be ordered
    %>
    <br>
    </form>
    </td></tr></table> <%-- end table for bin content and
    header --%>
    </td></tr></table>
    <p> </p>
    <p> </p>
    </td></tr></table> <%-- end page table --%>
    <% } // end item loaded
    %>
    <%@ include file="ibeCZzdBottom.jsp" %>
    <!-- ibeCCtdItemDetail.jsp end -->

    my bad...didnt think anyone was gonna come in ...lol......nothing populates in the second drop down...I was thinking of making a separate page and just pass the parameter in, bu i never used jsp include.....any suggestions on how to get this thing working??

  • Need help in creating process codes

    Hi All,
    I need to create some message type and assign it to some idoc type , and i need to create process code and inbound function module for this.
    Can some one please help me in this regard.
    Thanks ,
    Hem

    hi
    CATSDB CUSTOM IDOC TRANSFERMATION BETWEEN 2 DIFFERENT APPLICATION SERVERS
    For this scenario Client 800 of application server SAPADM is the Sender and client 800 of application server SAP-REMOTE is the Receiver
    1. Creating Logical Systems
    o       Login using 800 client
    o       Go to T. Code SALE
    o       Expand Sending and Receiving Systems
    o       Expand Logical Systems
    o       Click on Define Logical System
    o       Click on New Entries
    o       Create CATSSENDER, ECC Logical Systems
    o       Save and come back
    o       Assign the CATSSENDER Logical System to client 800 of Application Server SAPADMAssign the ECC Logical System to client 800 of Application Server SAP-REMOTE
    2. Creating the RFCs
    o       Go to T. Code SM59
    o       Expand R/3 Connections
    o       Enter RFC Name as CATSSENDER
    o       Connection Type as 3
    o       Language as EN
    o       Client as 800
    o       User as SAPUSER
    o       Password as YESV13
    o       Target host as SAPADM
    o       Click on Remote logon button to test the RFC
    o       Enter RFC Name as ECC
    o       Connection Type as 3
    o       Language as EN
    o       Client as 800
    o       User as SAPUSER               
    o       Password as YESV123
    o       Target host as SAPADM                                                                               
    o       Click on Remote logon button to test the RFC
    3. Creating the Message Type
    o       Go to T. Code WE81
    o       Click on change, continue
    o       Click on New Entries button
    o       Give message type as ZCATSTIME and description
    o       Save and back
    4. Creating the Segment
    o       Go to T. Code WE31
    o       Give segment name as ZSEGMENTTIME
    o       Enter Short Text
    o       Enter the Field Name and Data Element in the text boxes
    o       Save, continue,
    o       Click on Edit -> Set Release
    5. Creating the Basic IDOC Object
    o       Go to T. code WE30
    o       Give obj. name as ZTIMEIDOC
    o       Click on create
    o       Select create new radio button, give description and continue
    o       Select the IDOC obj name and click on create button
    o       Enter the segment name which is create earlier
    o       Select the check box if you want to make the segment mandatory
    o       Enter 1 in minimum number 99999 in maximum number, continue
    o       Save and backo       Click on Edit -> Set Release
    6. Creating Customer Distribution Model
    o       Go to T. Code BD64
    o       Click on change and Create model view button
    o       Enter the short text and Technical name as CATSSENDER
    o       Select the model and click on Add Message Type Button
    o       Give the Sender as CATSSENDER,
    o       Receiver as ECC,
    o       Message Type as ZCATSTIME
    o       Select the model view & click on Environment -> Generate Partner Profiles
    o       Select Transfer IDOC Immediately and Trigger Immediately radio buttons
    o       Click on Execute
    o       You should get a list in green color which means it executed successfully.
    o       Back to main screen, select the model view
    o       Click Edit->Model view->Distribute
    o       Click on continueo     
    You should get a list saying model view is distributed successfully.
    7. Checking the Port
    o       Go to T. Code WE21
    o       Expand Transactional RFC
    o       Find the port from the list which is created using BD64 for ECC (Receiving system) RFC Destination.
    8. Checking the Partner Profiles.
    o       Go to T. Code WE20
    o       Expand Partner Type LS
    o       Select the Partner profile ECC
    o       Double click on Message Type ZCATSTIME in Outbound parmtrs.
    o       Check Receiver Port is assigned correctlyo     
    Check the Basic type as your Basic IDOC object.
    9. Assigning the Message Type to Basic IDOC Object
    o       Go to T. Code WE82
    o       Click on Change & continue, New Entries button
    o       Give the Message type as ZCATSTIME
    o       Give Basic Type as ZTIMEIDOC
    o       Release as 4.6C
    o       Save and back10. Creating Inbound Function Module (Posting Program)
    o       Go to T. Code SE37
    o       Create a function Module ZCATSDB_TIMESHEET_SURESH
    o       Set the Processing type as Remote Enabled Module and mode as start immed, in Attributes Tab.   
    o       Import Parameters
              P_WORKDATE                    LIKE               CATSDB-WORKDATE
              P_COUNTER                        LIKE               CATSDB-COUNTER
              P_LSTAR                               LIKE               CATSDB-LSTAR
    o       Export Parameters
    o       Tables 
                 S_PERNR                      LIKE           ZCATSPERNR
    [PERNR is select option parameters in ZCUSTOMIDOC report program so that it should be passed to function module ZCATSDB_TIMESHEET_SURESH in tables section. And also in tables section we used ZCATSPERNR, which is a global structure, which contains four fields as
    Ø     SIGN
    Ø     OPTION
    Ø     LOW
    Ø     HIGH]
    o       Exceptions
    o       Source Code
    FUNCTION zcatsdb_timesheet_suresh.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(P_WORKDATE) LIKE  CATSDB-WORKDATE
    *"     VALUE(P_COUNTER) LIKE  CATSDB-COUNTER
    *"     VALUE(P_LSTAR) LIKE  CATSDB-LSTAR
    *"  TABLES
    *"      S_PERNR STRUCTURE  ZCATSPERNR
      TABLES: catsdb, edidc, edidd. " using structures of catsdb, edidc, edidd
      CONSTANTS: c_doctyp TYPE edidc-idoctp VALUE 'ZTIMEIDOC',  " idoc type
                 c_segnam TYPE edidd-segnam VALUE 'ZSEGMENTTIME',   "segment type
                 c_mestyp TYPE edidc-mestyp VALUE 'ZCATSTIME'.   " message type
    *001 comment begin
         creating internal tables with out header lines for catsdb, edidc, edidd and also
    -           work areas
    *001 comment end
      DATA: it_edidc  TYPE edidc OCCURS 0,    "  control internal table with out header line
            it_edidd  TYPE edidd OCCURS 0, " data internal table with out header line
            wa_catsdb TYPE it_catsdb1,  " work area for it_catsdb internal table
            wa_edidc  TYPE edidc,  " work area for it_edidc internal table
            wa_edidd  TYPE edidd,  " work area for it_edidd internal table
            wa_zsegmenttime TYPE zsegmenttime, " work area for zsegment internal table
            v_occmax  TYPE idocsyn-occmax,
            v_nbseg   TYPE i.
      CLEAR wa_catsdb. " clears work area of catsdb
      CLEAR wa_edidc.  " clears edidc work area
    *002  comment begin
    Save the message type and the basic IDoc type in the control segment.
    *002 comment end
      MOVE c_mestyp TO wa_edidc-mestyp. " assigning custom message type to edidc workarea
      MOVE c_doctyp TO wa_edidc-idoctp. " assigning custom idoc type to edidc workarea
    *003 comment begin
    Retrieve the maximum number of segments in the basic IDoc type.
    *003 comment end
      SELECT MIN( occmax ) FROM idocsyn INTO v_occmax WHERE idoctyp EQ c_doctyp AND segtyp EQ c_segnam.
    *004 comment begin
    Save the whole CATSDB table content in the IT_ZCATSDB internal table.
    *004 comment end
      SELECT pernr workdate lstar counter FROM catsdb INTO CORRESPONDING FIELDS OF TABLE it_catsdb WHERE pernr IN s_pernr AND workdate EQ p_workdate.
    *005 comment begin
    Create a data segment for each line of IT_ZCATSDB.
    *005 comment end
      IF sy-subrc EQ 0.
        LOOP AT it_catsdb INTO wa_catsdb WHERE pernr IN s_pernr.
          MOVE-CORRESPONDING wa_catsdb TO wa_zsegmenttime.
          CLEAR wa_edidd.
          MOVE c_segnam TO wa_edidd-segnam.
          MOVE wa_zsegmenttime TO wa_edidd-sdata.
          APPEND wa_edidd TO it_edidd.
          CLEAR wa_catsdb.
          CLEAR wa_zsegmenttime.
        ENDLOOP.
      ELSE.
        MESSAGE 'NO DATA FOUND FOR GIVEN SELECTION' TYPE 'I'.
      ENDIF.
    *006 comment begin
    Count the number of data segments.
    *006 comment end
      DESCRIBE TABLE it_edidd LINES v_nbseg.
    *007 comment begin
    If the number of data segments exceeds the maximum allowed number,then display an error message.
    *007 comment end
      IF v_nbseg GT v_occmax.
        MESSAGE  'IDOC ERROR Message' TYPE 'E000'.
      ENDIF.
      CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE' " for creating an catsdb idoc
      EXPORTING
      master_idoc_control = wa_edidc
    OBJ_TYPE = ''
    CHNUM = ''
      TABLES
      communication_idoc_control = it_edidc
      master_idoc_data = it_edidd
      EXCEPTIONS
      error_in_idoc_control = 1
      error_writing_idoc_status = 2
      error_in_idoc_data = 3
      sending_logical_system_unknown = 4
      OTHERS = 5
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
         WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    ENDFUNCTION.
    Save, check and activate
    111. Assigning the Inbound Function Module to Basic Type & Message Type
    o       Go to T. Code WE57
    o       Click on change, continue, continue and New Entries Button
    o       Enter the Module as ZCATSDB_TIMESHEET_SURESH Type as "F"
    o       Basic Type as ZTIMEIDOC
    o       Message Type as ZCATSTIME
    o       Direction as 2
    o       Save and back
    Now Login in 800 client of Application Server SAP-REMOTE
    12. Assigning the Inbound Function Module in ALE Table
    o       Go to T. Code BD51
    o       Click on continue, New Entries button
    o       Give the Inbound Function Module ZCATSDB_TIMESHEET_SURESH
    o       Give Input t. as 0 (zero)
    o       Save and back13. Creating Process Code
    o       Go to T. Code WE42
    o       Click on Change, New Entries Button
    o       Give Process Code name as ZCATSDB, give Description & Save
    o       Select Processing with ALE Services Radio button
    o       Select Processing by Function Module Radio button
    o       Click the ALE Table (arrow Icon) in Identification
    o       Give the Function Module Name ZIDOC_INPUT_ZBAPI_STUD_MAS
    o       Give maximum number of repeats 0
    o       Save and back, back
    o       Select the process code from the list & click on Logical Messages Icon
    o       Give the Message Type as ZCATSTIME
    o       Save & Back, Save & Back, Save & Back
    14. Changing the Customer Distribution model in receiving system
    o       Go to T. Code BD64
    o       Click on change and Create model view button
    o       Enter the short text and Technical name as CATSECC
    o       Select the model view & click on Environment -> Generate Partner Profiles
    o       Select Transfer IDOC Immediately and Trigger Immediately radio buttonso       Click on Execute You should get a list in green color which means it executed successfully.15. Assigning the Process Code to Message Type in Receiving System
    o       Go to T. Code WE20
    o       Expand Partner Type LS
    o       Select the Partner Profile CATSSENDER
    o       Double click on Message Type ZCATSTIME in Inbound parmtrs.
    o       Give the Process Code as ZCATSDB
    o       Click on Trigger Immediately Radio button
    o       Save & Back
    Save & Back
    16. Creating the Selection Program (Outbound Program)
    -         Login in client 800.
    -         Go to T. Code SE38
    -         Create a Report Program as ZCUSTOMIDOC with the following code
    REPORT ZCUSTOMIDOC
           NO STANDARD PAGE HEADING.
    TABLES:catsdb. " using structure of cats db table
    *000 comment begin
         this selection screen contains one select option and one parameter
    *000 comment end
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS pernr FOR catsdb-pernr.
    PARAMETER: workdate LIKE catsdb-workdate,
              LSTAR like catsdb-LSTAR,
              COUNTER like catsdb-counter.
    SELECTION-SCREEN: END OF BLOCK b1 .
    DATA: wa_val TYPE i.
    wa_val = pernr-high - pernr-low.
    *001 comment begin
          calling custom function module
    *001 comment end
    CALL FUNCTION 'ZCATSDB_TIMESHEET_SURESH'
      EXPORTING
        p_workdate = workdate " passing workdate parameter
        p_LSTAR = LSTAR
        p_counter = counter
      TABLES
        s_pernr    = pernr. " passing pernr select option
    IF sy-subrc EQ 0.
      MESSAGE i000(zaluri) WITH 'IDOCS CREATED FOR EMPLOYEES BETWEEN' pernr-low ' AND ' pernr-high .
    MESSAGE i000(zaluri) WITH   'IDOCS CREATED FOR EMPLOYEES BETWEEN' PERNR-LOW 'TO' PERNR-HIGH.
    gives information message if idocs are created for given  employees
    ELSE.
      MESSAGE e000(zaluri) WITH 'NO IDOCS CREATED FOR EMPLOYEES' pernr-low  'TO' pernr-high. " gives error message
    " if idoc is not created
    17. Transferring the CATSDB records from sender Application Server SAPADM   to  receiver Application Server SAP-REMOTE
    -         Execute Report Program ZCUSTOMIDOC
    -         Give the Range of PERSONNEL NO'S, Date, Activity Type, Counter to Transfer
    -         Give Message Type as ZCATSTIME
    -         Give Receiver Logical system as ECC
    -         Execute
    -         You should get the IDOC Number
    -         Take the IDOC Number and go to T. Code WE05 & Execute
    -         In Outbox you can see the IDOC Status
    -         Select the status record in left side window
    -         Double click on the Status record in right side window-         You can see the Control Record, Data Record and Status Records for that IDOC
    If the ICON is green and the status code is 3, it means the IDOC is passed to PORT Successfully
    18. SENDING IDOCS FROM APPLICATION SERVER SAPADM
    TO APPLICATION SERVER SAP-REMOTE USING WEDI
    -         Go to T. Code WEDI & execute or T. Code WE19
    -         Give idoc number it is generated recently
    -         Continue & double click on segment to view data in segment
    -         Click on EDIDC to give port, partner no, message type, partner
    type of receiver. [For sender no need to give any port no leave it as
    blank]
    -         Click on Standard Outbound Processing button and click continue
    -         You will get a message as idocs successfully transferred
    Now Login in Receiver 800 client
    -         Go to T. Code WE05 & Execute
    -         You can see the status record in left side window
    -         If the status no is 53 and color is green, it means the IDOC is posted to Application successfully.
    -         You can see the Log Information by double clicking on the status record in right side window.
    -         Now in left side window, you can see the Control Record, Data Record & Status Record of the IDOC
    -         Now go to T. Code SE16
    -         Give the table name CATSDB & press F7
    -         See the contents of the table
    -         The table is updated with the catsdb records transferred from 800 client with our selection program.
    regards
    Nagesh.Paruchuri

Maybe you are looking for