Need help in ABAP code

Hi All,
I have the data like this and ABC line is the primary object, Inline is the attribute.
ABC Line                                                                       Inline
GH04                    1001
OI04                    1031
OU04                    1002
OU05                                                                            1002
My requirement is like in the report. I have to use the Inline and restrict with the data when I restrict with 1001, 1031 and 1002. But it has to consider 1001, 1031 and 1002 which starts with only OU*. I donu2019t require all ABC lines.
I tried to write the code but I couldnu2019t.
Can any one give the code please?
Thanks
Sravani

if the ABC line item is OU* then you need to display 1001 and 1031 else you want display all the items
I m right???
reach me at
Edited by: shanthi bhaskar on Apr 15, 2010 5:20 PM

Similar Messages

  • Need help in ABAP code to Enhance the Extract Structure ?????

    Hi all,
        I want to enhance the extract structure to get KBETR & KBRUE fields of KONP table since it didn’t allow me to add those fields while creating the generic extractor because of currency key problems. I want to read all KONP records into internal table with KNUMH (Key). Next, I want to fill them into ZZKBETR & ZZKBRUE of Extract Structure ZOXUR40065 in loop.
    DATA:
      i_t_zrebate like ZOXUR40065 occurs 0 with header line,
      reb_tabix like sy-tabix.
    TABLES: KONP.
      Could you please help me in completing the ABAP code?
    Thanks,
    Venkat.

    Hello Manga,
        I have included the following code in ZXRSAU01:
    WHEN 'ZREBATE'.
    PERFORM ZREBATE_EXIT TABLES C_T_DATA.
    After Double click on ZREBATE_EXIT on perform statement, it created ZXRSAF01 include and the following code is added in it:
    FORM ZREBATE_EXIT TABLES FP_C_T_DATA STRUCTURE ZOXUR40065.
    DATA:
    i_t_zrebate like ZOXUR40065 occurs 0 with header line,
    reb_tabix like sy-tabix.
    FIELD-SYMBOLS: <l_c_t_data> TYPE ZOXUR40065.
    LOOP AT fp_c_t_data ASSIGNING <l_c_t_data>.
    reb_tabix = sy-tabix.
    select single KBETR KBRUE
    into (<l_c_t_data>-ZZKBETR,
    <l_c_t_data>-ZZKBRUE,
    from KONP
    where KNUMH eq <l_c_t_data>-KNUMH.
    if sy-subrc eq 0.
    MODIFY fp_c_t_data FROM <l_c_t_data> INDEX reb_tabix.
    endif.
    CLEAR:reb_tabix.
    ENDLOOP.
    ENDFORM.
    When I tried to Activate this ZXRSAF01 include, it fails with 'The FORM "ZREBATE_EXIT" does not exist'.
      Should it be FP_C_T  or P_C_T? I found P_C_T in ZXRSAF01 include.
      What is wrong with it, please ?
       Can't I add this whole code in main include ZXRSAU01itself?
      The Extractor ZREBATE is based on KONA, KONH & KONP tables. This Extractor and KONA table have the same 4000 records and KONP has 13000 records. I want to extract KBERT & KBRUE from KONP.
       Thanks in advance.
    Regards,
    Venkat

  • Need help for ABAP CODE

    hi,
    i need to reload the master data without FM, i put the comments on fm and relaod the data, now i having a problem, loading process is slow now as compair to before, when i was using with FM.i checked the manage of infoObject, it is show 1123455 records in "transfer" column and 0 record in "added" column, below is the start routine,
    Please help me to fix that problem
    IF NOT DATAPAK[] IS INITIAL.
        LOOP AT DATAPAK INTO S_DATAPAK.
          CLEAR V_INDEX.
          V_INDEX = SY-TABIX.
         IF S_DATAPAK-/BIC/ABRETPRI CO ' 0123456789.'.
           CLEAR: V_AMOUNT, V_PRC.
          V_AMOUNT = S_DATAPAK-/BIC/ABRETPRI.
          CALL FUNCTION 'RSAR_CURRENCY_CONVERT'
          EXPORTING
          I_CURRENCY = S_DATAPAK-CURRENCY
          CHANGING
          C_AMOUNT   = V_AMOUNT.
         V_PRC = V_AMOUNT.
         S_DATAPAK-/BIC/ABRETPRI = V_PRC.
        ENDIF.
    IF S_DATAPAK-/BIC/ABBLNKFLG IS INITIAL.
            S_DATAPAK-/BIC/ABBLNKFLG = 'N'.
          ENDIF.
    TRANSLATE S_DATAPAK-/BIC/ABSZRANGE TO UPPER CASE
    IF S_DATAPAK-CURRENCY IS INITIAL.
          S_DATAPAK-CURRENCY = S_DATAPAK-WHLPRCCURR.
    MODIFY DATAPAK FROM S_DATAPAK INDEX V_INDEX TRANSPORTING
         /BIC/ABRETPRI /BIC/ABWHLPRCE /BIC/ABBLNKFLG
         ENDIF.
    *ENDLOOP.
      ENDIF
    Thanks

    You need not use start routine to achieve this. Instead you can write transfer routines/formulas for those fields in UR.

  • Need help in transcation code ime0

    I need help in transaction code ime0. I mean to say what is this TCode doing? What different Drill-down program means? Where I can use this report?
    Regards,
    Subhasish

    Hi
    Please check the link for help
    <a href="http://help.sap.com/saphelp_47x200/helpdata/EN/5c/8db33f555411d189660000e829fbbd/frameset.htm">CA - Drilldown Reporting</a>
    Hope it helps
    Anirban

  • I need help with this code error "unreachable statement"

    the error_
    F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
    int index;
    ^
    F:\Java\Projects\Tools.java:71: missing return statement
    }//end delete method
    ^
    F:\Java\Projects\Tools.java:86: missing return statement
    }//end getrecod
    ^
    3 errors
    import java.util.*;
    import javax.swing.*;
    import java.awt.*;
    public class Tools//tool class
    private int numberOfToolItems;
    private ToolItems[] toolArray = new ToolItems[10];
    public Tools()//array of tool
    numberOfToolItems = 0;
    for(int i = 0; i < toolArray.length; i++)//for loop to create the array tools
    toolArray[i] = new ToolItems();
    }//end for loop
    }//end of array of tools
    public int search(int id)//search mehtod
    int index = 0;
    while (index < numberOfToolItems)//while and if loop search
    if(toolArray[index].getID() == id)
    return index;
    else
    index ++;
    }//en while and if loop
    return -1;
    }//end search method
    public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
    if(numberOfToolItems >= toolArray.length)
    return 0;
    int index;
    index = search(id); <-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------HERE
    if (index == -1)
    toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
    numberInStock ++;
    return 1;
    }//end if index
    }//end if toolitem array
    return -1;
    }//end insert method
    public int delete(/*int id*/)//delete method
    }//end delete method
    public void display()//display method
    for(int i = 0; i < numberOfToolItems; i++)
    //toolArray.display(g,y,x);
    }//end display method
    public String getRecord(int i)//get record method
    // return toolArray[i].getName()+ "ID: "+toolArray[i].getID()
    }//end getrecod
    }//end class
    Edited by: ladsoftware on Oct 9, 2009 6:08 AM
    Edited by: ladsoftware on Oct 9, 2009 6:09 AM
    Edited by: ladsoftware on Oct 9, 2009 6:10 AM
    Edited by: ladsoftware on Oct 9, 2009 6:11 AM

    ladsoftware wrote:
    Subject: Re: I need help with this code error "unreachable statement"
    F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
    int index;
    ^
    F:\Java\Projects\Tools.java:71: missing return statement
    }//end delete method
    ^
    F:\Java\Projects\Tools.java:86: missing return statement
    }//end getrecod
    ^
    3 errorsThe compiler is telling you exactly what the problems are:
    public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
    if(numberOfToolItems >= toolArray.length)
    return 0; // <<== HERE you return, so everyting in the if block after this is unreachable
    int index;
    index = search(id);  //< -----------------------------------------------------------------------------------------------------------------HERE
    if (index == -1)
    toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
    numberInStock ++;
    return 1;
    }//end if index
    }//end if toolitem array
    return -1;
    }//end insert method
    public int delete(/*int id*/)//delete method
    // <<== HERE where is the return statement?
    }//end delete method
    public String getRecord(int i)//get record method
    // return toolArray.getName()+ "ID: "+toolArray[i].getID() <<== HERE you commented out the return statement
    }//end getrecod
    }//end class

  • I need help with my code..

    hi guys. as the subject says I need help with my code
    the Q for my code is :
    write a program that reads a positive integer x and calculates and prints a floating point number y if :
    y = 1 ? 1/2 + 1/3 - ? + 1/x
    and this is my code
       This program that reads a positive integer x and calculates
       and prints a floating point number y if :
                 y = 1 - 1/2 + 1/3 - ? + 1/x
       import java.util.Scanner; // program uses class Scanner
        class Sh7q2
           // main method begins execution of Java application
           public static void main( String args[] )
          // create Scanner to obtain input from command window
             Scanner input = new Scanner( System.in );
             int i = 1; // i is to control the loop
             int n = 2; // n is suppose to control the number sign
             int x; // a positive integer entered by the user
             int m;
             System.out.println("Enter a positive integer");
             x = input.nextInt();
             do
                m = (int) Math.pow( -1, n)/i;
                System.out.println(m);
                   n++;
                   i++;
             while ( m >= 1/x );
          } // end method main
       } // end class Sh7q2 when I compile it there is no error
    but in the run it tells me to enter a positive integer
    suppose i entered 5
    then the result is 1...
    can anyone tell me what's wrong with my code

       This program that reads a positive integer x and calculates
       and prints a floating point number y if :
                 y = 1 - 1/2 + 1/3 - ? + 1/x
       import java.util.Scanner; // program uses class Scanner
        class Sh7q2
           // main method begins execution of Java application
           public static void main( String args[] )
          // create Scanner to obtain input from command window
             Scanner input = new Scanner( System.in );
             int i = 1; // i is to control the loop
             int n = 1; // n is suppose to control the number sign
             int x; // a positive integer entered by the user
             double m;
             int a = 1;
             double sum = 0;
             System.out.println("Enter a positive integer");
             x = input.nextInt();
             for ( i = 1; a <= x; i++)
                m =  Math.pow( -1, n+1)/i;
                sum  = sum + m;
                n++;
                a++;
             System.out.print("y = " + sum);
          } // end method main
       } // end class Sh7q2is it right :S

  • Need help in ABAP coding in start routine

    Hi,
    I have a requriement like
    -To take the value of month which is an attribute of category(info Object) for which category value is 1. I need to apply the month obtained as the filter to another info object. I have opted to write this ABAP code in start routine. Can anyone guide me on this code.
    Thanks in advance.

    do you not have an abap-er at your disposal? i don't imagine this to be quick & dirty that can be written without access to your system! some analysis work may also be required before the actual coding can be done...so I wouldn't post the entire functional spec (business requirement) here hoping for a solution; that would be too weird.
    Regards.

  • Need help in ABAP.

    HI gurus,
    I AM KISHORE i am SD consultant.here my client is asking to create some programmes. i need help in simple programmes so that as per that i can change the fiels as per my requirement.
          i am in real big problem now .i know these are very simple programmes but i don't know ABC of programming.
    can some one help me in this regard.  this ABAP help is needed for me only for some time.
    the requirement:  
    create program which will produce list with:
       Materia number; Material description ; Valuation class, Standard price with curency and unit.
    Select conditions:
       Material number,
       Plant,
       Material type                                as mandatory
       Material Group                              as mandatory,
       LP/KD/MIP  (LABOR)                    as mandatory,
       Replenishment strategy (TEMPB)   as mandatory,
       Valuation class,
       Flag for deletion-Client Level  with initial value <> ‘X’  (only materials without flag for deletion)
    Simple List is enough
    reagrds
    kishore

    Hi
    Eventhough i cant fullfill your complete requirement. I'm giving u a report performed by me in which most of the fields are covered ask any of abaper to make modifications in this report and change it to accordingly ur requirement. I think it will solve 80% of ur work
    * tables
    TABLES: ekko,ekbe,ekpo,ekkn,konh,konv,esll,ekbz,rseg,lfa1,j_1ipart1,
    j_1igrxref.
    TYPE-POOLS: slis.
    *data definituon
    DATA:
          wa_ekko LIKE ekko,
          wa_ekbe LIKE ekbe,
          wa_ekkn LIKE ekkn,
          wa_konp LIKE konp,
          wa_ekpo LIKE ekpo,
          wa_rbkp LIKE rbkp,
          wa_j_1ipart1 LIKE j_1ipart1,
          wa_j_1igrxref LIKE j_1igrxref,
          wa_rseg LIKE rseg OCCURS 0 WITH HEADER LINE.
    DATA: ws_vakey LIKE konh-vakey,
          ws_kbetr LIKE konp-kbetr,
          ws_kbetr1 LIKE konp-kbetr,
          ws_kbetr2 LIKE konp-kbetr,
          ws_ecs LIKE j_1igrxref-ecs,
          ws_ebelp LIKE ekbz-ebelp,
          ws_ebeln LIKE ekko-ebeln,
          ws_belnr LIKE ekbe-belnr,
          ws_beznk LIKE  rbkp-beznk,
          ws_wrbtr_f LIKE ekbz-wrbtr,
          ws_rmwwr LIKE rbkp-rmwwr,
          ws_rbkp_benz.
    *internal tables
    DATA: BEGIN OF int_outtab OCCURS 0,
          lifnr      LIKE ekko-lifnr,               " vend no
          name1      LIKE lfa1-name1,               " vend name
          werks      LIKE ekpo-werks,               "  plant
          ebeln      LIKE ekko-ebeln,               " po no
          knumv      LIKE ekko-knumv,
          ebelp      LIKE ekbe-ebelp,
          matnr      LIKE ekpo-matnr,               " mat no
          txz01      LIKE ekpo-txz01,               " mat desceiption
          kostl      LIKE ekkn-kostl,               " cost center
          ps_psp_pnr LIKE ekkn-ps_psp_pnr,          " WBS element
          netwr      LIKE ekpo-netwr,
          " basic value           (po)
          kbetr      LIKE konp-kbetr,
          " excise value          (po)
          kwert_i    LIKE konv-kwert,
          " insurance value       (po)
          kwert_f    LIKE konv-kwert,
          " frieght value         (po)
          kwert_t    LIKE konv-kwert,
          " vat/tax value         (po)
          kwert_o    LIKE konv-kwert,
          " others                (po)
          kwert_total LIKE konv-kwert,
          " total                 (po)
          ecs        LIKE j_1igrxref-ecs,
          " excise                (ap)
          wmwst1     LIKE   rbkp-wmwst1,
          " tax amount            (ap)
          wrbtr_f       TYPE ekbz-wrbtr,
          " freight               (ap)
          wrbtr       TYPE ekbz-wrbtr,
          beznk      LIKE    rbkp-beznk,
          " Unplanned cost        (ap)
          refwr_g    TYPE  ekbe-refwr,
          " gross                 (ap)
          rmwwr   LIKE  rbkp-rmwwr,
          "  Actual Invoice Total (ap)
          buzei      LIKE ekbz-buzei,               "item for material doc
          gjahr      LIKE ekbe-gjahr,
          tax        LIKE ekbe-wrbtr,                " tax (ap)
          actual_total LIKE ekbe-wrbtr,
    *      belnr      LIKE rseg-belnr,
           belnr     LIKE ekbe-belnr,
          vakey      LIKE konh-vakey,
          cpudt      LIKE ekbe-cpudt,
          budat      LIKE ekbz-budat,
          belnr_ekbz LIKE ekbz-belnr,              "to get excise value
    *      aedat     LIKE ekpo-aedat,
          bedat   LIKE ekko-bedat,
          waers     LIKE lfm1-waers,               " currency
          END OF int_outtab.
    DATA:   int_konv LIKE konv OCCURS 0 WITH HEADER LINE,
    *        int_ekbe LIKE ekbe OCCURS 0 WITH HEADER LINE,
            int_ekbz LIKE ekbz OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF int_konh OCCURS 0,
          knumh LIKE konh-knumh,
          kschl LIKE konh-kschl,
          vakey LIKE konh-vakey,
          END OF int_konh.
    DATA: BEGIN OF int_konp OCCURS 0,
          knumh LIKE konp-knumh,
          kschl LIKE konp-kschl,
          kbetr LIKE konp-kbetr,
          END OF int_konp.
    DATA: BEGIN OF int_ekkn OCCURS 0,
          ebeln      LIKE ekkn-ebeln,
          ebelp      LIKE ekkn-ebelp,
          kostl      LIKE ekkn-kostl,
          ps_psp_pnr LIKE ekkn-ps_psp_pnr,
          END OF int_ekkn.
    DATA: BEGIN OF int_outtab1 OCCURS 0,
          exbed      LIKE j_1igrxref-exbed,
          ecs        LIKE j_1igrxref-ecs,
          END OF int_outtab1.
    DATA: BEGIN OF int_ekbe OCCURS 0,
          ebelp LIKE ekbe-ebelp,
          refwr LIKE ekbe-refwr,
          wrbtr LIKE ekbe-wrbtr,
          shkzg LIKE ekbe-shkzg,
          END OF int_ekbe.
    DATA: BEGIN OF int_total OCCURS 0,
          ebeln LIKE ekko-ebeln,
          ebelp LIKE ekbe-ebelp,
          actual_total LIKE ekbe-wrbtr,
          END OF int_total.
    DATA: BEGIN OF int_excise OCCURS 0,
          ebeln      LIKE ekko-ebeln,
          kbetr      LIKE konp-kbetr,
          END OF int_excise.
    DATA: BEGIN OF int_rseg OCCURS 0,
          ebeln LIKE rseg-ebeln,
          ebelp LIKE rseg-ebelp,
          lfbnr LIKE rseg-lfbnr,
          matnr LIKE rseg-matnr,
          lfgja LIKE rseg-lfgja,
          belnr LIKE rseg-belnr,
          ecs LIKE j_1igrxref-ecs,
          beznk      LIKE    rbkp-beznk,
          wrbtr_f    LIKE  ekbz-wrbtr,
          rmwwr LIKE rbkp-rmwwr,
          END OF int_rseg.
    DATA: BEGIN OF int_rbkp OCCURS 0,
          belnr LIKE  rbkp-belnr,
          beznk      LIKE    rbkp-beznk,
          rmwwr      LIKE    rbkp-rmwwr,
          tcode  LIKE rbkp-tcode,
          END OF int_rbkp.
    ****ALV list definintion
    DATA: ws_cat TYPE slis_t_fieldcat_alv ,
          int_cat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA: g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
          g_custom_container TYPE REF TO cl_gui_custom_container.
    *selection-screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 19(23) text-002.
    SELECT-OPTIONS: s_lifnr FOR ekko-lifnr obligatory.
    *PARAMETERS:p_lifnr LIKE ekko-lifnr  .
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 25(17) text-006.
    *PARAMETERS:p_ebeln LIKE ekko-ebeln obligatory.
    SELECT-OPTIONS:s_ebeln FOR ekko-ebeln .
    SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT 25(23) text-003.
    *PARAMETERS:p_ekorg LIKE ekko-ekorg.
    *SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT 25(20) text-004.
    *PARAMETERS:p_werks LIKE ekpo-werks obligatory.
    *SELECT-OPTIONS: S_werks FOR ekpo-werks obligatory.
    SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT 25(23) text-005.
    *SELECT-OPTIONS:s_bedat FOR ekko-bedat.
    *SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM field_catalog.
      PERFORM display_data.
    END-OF-SELECTION.
    *&      Form  get_data
    *       text
    FORM get_data.
    * start of Vender details
    ***vender no, vender name, po no,service/mat no, service/mat description
      SELECT  ekko~lifnr ekko~ebeln ekko~knumv ekko~bedat
              ekpo~werks ekpo~matnr ekpo~txz01 ekpo~werks
              ekpo~netwr
    *          ekpo~aedat
              ekbe~ebelp  ekbe~belnr
              lfa1~name1
      INTO    CORRESPONDING   FIELDS OF  TABLE int_outtab
      FROM ( ( ( ekko
               JOIN ekbe ON  ekbe~ebeln = ekko~ebeln AND
                             ekbe~vgabe = '2'       )
               JOIN ekpo ON ekpo~ebeln = ekko~ebeln   AND
                            ekpo~ebelp = ekbe~ebelp )
               JOIN lfa1 ON lfa1~lifnr = ekko~lifnr )
      WHERE
    *  ekko~lifnr  =  P_lifnr  AND
    *         ekko~ebeln IN  S_ebeln  AND
    **         ekpo~werks IN  S_werks AND
             ekbe~vgabe = '2'.
    ***WBS/Cost center
      SELECT  ebeln ebelp kostl ps_psp_pnr  FROM ekkn INTO int_ekkn
      FOR ALL ENTRIES IN int_outtab
      WHERE ebeln = int_outtab-ebeln AND
            ebelp = int_outtab-ebelp.
        APPEND int_ekkn.
      ENDSELECT.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln OR int_outtab-ebelp.
          LOOP AT int_ekkn WHERE ebeln = int_outtab-ebeln AND
                                 ebelp = int_outtab-ebelp.
            IF  int_ekkn-kostl <> ' '.
              MOVE int_ekkn-kostl TO int_outtab-kostl.
            ELSE.
              MOVE int_ekkn-ps_psp_pnr TO int_outtab-kostl.
              " int_outtab-ps_psp_pnr.
            ENDIF.
          ENDLOOP.
          MODIFY int_outtab.
        ENDON.
      ENDLOOP.
    *end of Vender details*****
    *******Start of calculation of PO
    *****Excise calculation of po
      LOOP AT int_outtab.
        CONCATENATE int_outtab-werks int_outtab-lifnr int_outtab-matnr INTO
        ws_vakey.
        MOVE ws_vakey TO int_outtab-vakey.
        MODIFY int_outtab.
      ENDLOOP.
      LOOP AT int_outtab.
    *    ON CHANGE OF int_outtab-ebeln OR int_outtab-vakey.
        ON CHANGE OF int_outtab-ebelp.
          SELECT knumh kschl vakey FROM konh INTO int_konh
    *        FOR ALL ENTRIES IN int_outtab
            WHERE vakey = int_outtab-vakey AND
                  datab <= int_outtab-bedat AND
                  datbi > int_outtab-bedat AND
                 ( kschl = 'JMOP' OR kschl = 'JEC1' ).
            SELECT knumh kschl kbetr FROM konp INTO int_konp
            WHERE  knumh = int_konh-knumh .
              IF  int_konp-kschl = 'JMOP'.
                ws_kbetr = int_konp-kbetr / 1000 * int_outtab-netwr.
                ws_kbetr1 = ws_kbetr.
              ENDIF.
              IF int_konp-kschl = 'JEC1'.
                ws_kbetr2 = int_konp-kbetr / 1000 * ws_kbetr1.
              ENDIF.
              ws_kbetr = ws_kbetr + ws_kbetr2.
            ENDSELECT.
          ENDSELECT.
        ENDON.
    *    ENDON.
        MOVE ws_kbetr TO int_outtab-kbetr.
        MODIFY int_outtab.
        CLEAR: ws_kbetr, ws_kbetr1, ws_kbetr2.
      ENDLOOP.
      LOOP AT int_outtab.
    *    ON CHANGE OF int_outtab-ebeln OR int_outtab-vakey.
        int_excise-kbetr =  int_outtab-kbetr.
        int_excise-ebeln =  int_outtab-ebeln.
        APPEND int_excise.
    *    ENDON.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln.
          LOOP AT int_excise WHERE ebeln = int_outtab-ebeln.
            ws_kbetr = ws_kbetr + int_excise-kbetr.
          ENDLOOP.
        ENDON.
        int_outtab-kbetr = ws_kbetr.
        MODIFY int_outtab.
        CLEAR ws_kbetr.
      ENDLOOP.
    ***** Insurance, Freight,Vat/ST, Other, Total***********
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp OR int_outtab-ebeln.
          CLEAR int_konv.
          SELECT * FROM konv INTO CORRESPONDING FIELDS OF int_konv
          WHERE knumv = int_outtab-knumv AND
                kposn = int_outtab-ebelp AND
              ( ( kschl <> 'RA00' )
                 AND ( kschl <> 'RA01' ) AND ( kschl <>  'RB00' )
                 AND ( kschl <> 'PBXX' ) AND ( kschl <>  'PB00' )
                 AND ( kschl <> 'RC00' ) AND ( kschl <>  'RL01' )
                 AND ( kschl <> 'ZC00' ) AND ( kschl <>  'ZA00' )
                 AND ( kschl <> 'ZA01' ) AND ( kschl <>  'HB01' )
                 AND ( kschl <> 'ZBED' ) AND ( kschl <>  'ZAED' )
                 AND ( kschl <> 'ZSED' ) AND ( kschl <>  'ZAE1' )
                 AND ( kschl <> 'ZSE1' ) AND ( kschl <>  'ZCEX' )
                 AND ( kschl <> 'ZPRO' ) AND ( kschl <>  'ZTRD' )
                 AND ( kschl <> 'ZPK4' ) AND ( kschl <>  'ZSTX' )
                 AND ( kschl <> 'ZASS' ) AND ( kschl <>  'ZJCD' )
                 AND ( kschl <>  'HB00') ).
            APPEND int_konv.
          ENDSELECT.
        ENDON.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp OR int_outtab-knumv.
          LOOP AT int_konv WHERE kposn = int_outtab-ebelp AND
                                 knumv = int_outtab-knumv.
    *                             lifnr = int_outtab-lifnr.
    ***** tax
            IF  ( ( int_konv-kschl = 'NAVS' ) OR ( int_konv-kschl = 'NAVM' )
              int_outtab-kwert_t = int_outtab-kwert_t + int_konv-kwert.
            ELSE.
    *****freight
              IF ( ( int_konv-kschl = 'FRA1' ) OR ( int_konv-kschl = 'FRB1'
                                              OR  ( int_konv-kschl = 'FRC1'
                int_outtab-kwert_f = int_outtab-kwert_f + int_konv-kwert.
              ELSE.
    *****insurance
                IF ( ( int_konv-kschl = 'ZGIN' )  OR ( int_konv-kschl =
                'ZIN2' ) ).
                  int_outtab-kwert_i =  int_outtab-kwert_i + int_konv-kwert.
                ELSE.
    ****others
                  IF NOT (    ( int_konv-kschl = 'NAVS' ) OR (
                  int_konv-kschl = 'NAVM' )
                           OR ( int_konv-kschl = 'FRA1' ) OR (
                           int_konv-kschl = 'FRB1' )
                           OR ( int_konv-kschl = 'FRC1' ) OR (
                           int_konv-kschl = 'ZGIN' )
                           OR ( int_konv-kschl = 'ZIN2' ) OR (
                           int_konv-kschl = 'RA00' )
                           OR ( int_konv-kschl = 'RA01' ) OR (
                           int_konv-kschl = 'RB00' )
                           OR ( int_konv-kschl = 'PBXX' ) OR (
                           int_konv-kschl = 'PB00' )
                           OR ( int_konv-kschl = 'RC00' ) OR (
                           int_konv-kschl = 'RL01' ) ).
                    int_outtab-kwert_o =   int_outtab-kwert_o  +
                    int_konv-kwert.
                  ENDIF.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDLOOP.
    ****total
          int_outtab-kwert_total =  int_outtab-kwert_t
                                    + int_outtab-kwert_f
                                    + int_outtab-kwert_i
                                    + int_outtab-kwert_o
                                  + int_outtab-netwr.
        ENDON.
        MODIFY int_outtab.
      ENDLOOP.
    ******End of calculation of PO
    *start of calculation for actual payment
    *****Excise
    sort int_outtab by ebelp ebeln.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp OR int_outtab-ebeln.
          SELECT * FROM rseg INTO CORRESPONDING FIELDS OF int_rseg
    *          FOR ALL ENTRIES IN int_outtab
                 WHERE ebeln = int_outtab-ebeln AND
                       ebelp = int_outtab-ebelp.
            APPEND int_rseg.
          ENDSELECT.
        ENDON.
      ENDLOOP.
      sort int_rseg by ebelp lfbnr matnr.
      LOOP AT int_rseg.
        ON CHANGE OF int_outtab-ebelp OR int_rseg-lfbnr OR int_rseg-matnr OR
        int_rseg-lfgja.
          SELECT * FROM j_1ipart1 INTO wa_j_1ipart1
          WHERE mblnr = int_rseg-lfbnr AND
                mjahr = int_rseg-lfgja AND
                matnr = int_rseg-matnr.
            ON CHANGE OF wa_j_1ipart1-mblnr OR wa_j_1ipart1-zeile.
              SELECT * FROM j_1igrxref INTO wa_j_1igrxref
               WHERE mblnr = wa_j_1ipart1-mblnr AND
                     zeile = wa_j_1ipart1-zeile.
                IF sy-subrc EQ 0.
                  ws_ecs = ws_ecs + wa_j_1igrxref-exbed + wa_j_1igrxref-ecs.
                ENDIF.
              ENDSELECT.
            ENDON.
          ENDSELECT.
        ENDON.
        MOVE ws_ecs TO int_rseg-ecs.
        MODIFY int_rseg TRANSPORTING ecs.
        CLEAR: ws_ecs.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln.
          LOOP AT int_rseg WHERE ebeln = int_outtab-ebeln.
            ws_ecs = ws_ecs + int_rseg-ecs.
          ENDLOOP.
        ENDON.
        MOVE ws_ecs TO int_outtab-ecs.
        MODIFY int_outtab TRANSPORTING ecs.
        CLEAR ws_ecs.
      ENDLOOP.
    ******unplanned costs and actual_invoice_total
      SORT int_rseg BY belnr.
      LOOP AT int_rseg .
        ON CHANGE OF int_rseg-belnr.
          SELECT  belnr beznk rmwwr tcode FROM rbkp INTO int_rbkp
          WHERE   belnr  = int_rseg-belnr .
            APPEND int_rbkp.
          ENDSELECT.
        ENDON.
      ENDLOOP.
      SORT int_rseg BY belnr.
      SORT int_rbkp BY belnr.
      LOOP AT int_rseg.
        ON CHANGE OF int_rseg-ebeln OR int_rseg-belnr.
          LOOP AT int_rbkp WHERE belnr = int_rseg-belnr.
            IF int_rbkp-tcode = 'MR8M'.
              int_rbkp-rmwwr = int_rbkp-rmwwr * ( - 1 ).
              int_rbkp-beznk = int_rbkp-beznk * ( - 1 ).
            ENDIF.
            ws_beznk =  ws_beznk + int_rbkp-beznk.
            ws_rmwwr =  ws_rmwwr + int_rbkp-rmwwr.
          ENDLOOP.
        ENDON.
        MOVE ws_beznk TO int_rseg-beznk.
        MOVE ws_rmwwr TO int_rseg-rmwwr.
        MODIFY int_rseg.
        CLEAR: ws_rmwwr, ws_beznk.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln.
          LOOP AT int_rseg WHERE ebeln = int_rseg-ebeln.
            ws_beznk =  ws_beznk + int_rseg-beznk.
            ws_rmwwr =  ws_rmwwr + int_rseg-rmwwr.
          ENDLOOP.
        ENDON.
        MOVE ws_beznk TO int_outtab-beznk.
        MOVE ws_rmwwr TO int_outtab-rmwwr.
        MODIFY int_outtab.
        CLEAR: ws_rmwwr, ws_beznk.
      ENDLOOP.
    *freight of actual payment
      sort int_rseg by belnr ebelp.
      LOOP AT int_rseg.
        ON CHANGE OF  int_rseg-belnr or int_rseg-ebelp..
          SELECT * FROM ekbz INTO CORRESPONDING FIELDS OF int_ekbz
          WHERE ebeln = int_rseg-ebeln AND
                belnr = int_rseg-belnr AND
                ebelp = int_rseg-ebelp AND
                vgabe = '2' .
            IF int_ekbz-shkzg = 'H'.
              int_ekbz-wrbtr = int_ekbz-wrbtr  * ( - 1 ).
            ENDIF.
            int_rseg-wrbtr_f = int_rseg-wrbtr_f + int_ekbz-wrbtr.
          ENDSELECT.
        ENDON.
        MODIFY int_rseg.
        CLEAR int_rseg-wrbtr_f.
      ENDLOOP.
      sort int_rseg by ebelp.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln OR int_outtab-ebelp.
          LOOP AT int_rseg WHERE ebeln = int_outtab-ebeln AND
                                 ebelp = int_outtab-ebelp.
            ws_wrbtr_f = ws_wrbtr_f + int_rseg-wrbtr_f.
          ENDLOOP.
        ENDON.
        MOVE ws_wrbtr_f TO int_outtab-wrbtr_f.
        MODIFY int_outtab TRANSPORTING wrbtr_f.
        CLEAR ws_wrbtr_f.
      ENDLOOP.
    **tax and gross amt of actual payment
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp OR int_outtab-ebeln.
        " or int_outtab-belnr.
          SELECT ebelp refwr wrbtr shkzg FROM ekbe INTO int_ekbe
          WHERE ebelp = int_outtab-ebelp AND
                ebeln = int_outtab-ebeln AND
                vgabe = '2' .
            IF int_ekbe-shkzg = 'H'.
              int_ekbe-refwr  = int_ekbe-refwr * ( - 1 ).
              int_ekbe-wrbtr  = int_ekbe-wrbtr * ( - 1 ).
            ENDIF.
            int_outtab-refwr_g = int_outtab-refwr_g +  int_ekbe-refwr.
            int_outtab-tax =  int_outtab-tax + ( int_ekbe-wrbtr -
            int_ekbe-refwr ).
          ENDSELECT.
        ENDON.
        MODIFY int_outtab.
        CLEAR int_outtab-refwr_g.
        CLEAR int_outtab-tax.
      ENDLOOP.
    ****total
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebelp  OR int_outtab-ebeln.
          int_outtab-actual_total =  int_outtab-actual_total
                                     + int_outtab-ecs
                                     + int_outtab-wrbtr_f
                                     + int_outtab-tax
                                     + int_outtab-beznk
                                     + int_outtab-refwr_g.
          int_total-actual_total =  int_outtab-actual_total.
          int_total-ebelp        = int_outtab-ebelp.
          int_total-ebeln        = int_outtab-ebeln.
          APPEND int_total.
        ENDON.
      ENDLOOP.
    *end of calculation for actaul payment
    *************Modification in internal table*****
      LOOP AT int_outtab.
        IF int_outtab-ebelp = ws_ebelp AND
           int_outtab-ebeln = ws_ebeln.
          int_outtab-netwr = 0.
          MODIFY int_outtab.
        ENDIF.
        ws_ebelp = int_outtab-ebelp.
        ws_ebeln = int_outtab-ebeln.
      ENDLOOP.
      LOOP AT int_outtab.
        IF int_outtab-netwr IS INITIAL.
          DELETE int_outtab INDEX sy-tabix.
        ENDIF.
      ENDLOOP.
      LOOP AT int_outtab.
        ON CHANGE OF int_outtab-ebeln.
          LOOP AT int_total WHERE ebeln = int_outtab-ebeln.
            int_outtab-actual_total =  int_outtab-actual_total
                                       + int_total-actual_total.
          ENDLOOP.
        ENDON.
        MODIFY int_outtab.
      ENDLOOP.
      LOOP AT int_outtab.
        SELECT SINGLE * FROM lfm1 INTO CORRESPONDING FIELDS OF int_outtab
        WHERE lifnr = int_outtab-lifnr.
        MODIFY int_outtab.
      ENDLOOP.
    ********** end of modification*********
    ENDFORM.                    "get_data
    *&      Form  field_catalog
    *       text
    FORM field_catalog.
    ***vender no
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'LIFNR'.
      int_cat-reptext_ddic  = 'Vender No'.
      APPEND int_cat TO ws_cat.
    *vender name
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'NAME1'.
      int_cat-reptext_ddic  = 'Vender Name'.
      APPEND int_cat TO ws_cat.
    ** PO No
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'EBELN'.
      int_cat-reptext_ddic  = 'PO No'.
      APPEND int_cat TO ws_cat.
    ** Mat No
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'MATNR'.
      int_cat-reptext_ddic  = 'Mat No'.
      APPEND int_cat TO ws_cat.
    ** Matdescription
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'TXZ01'.
      int_cat-reptext_ddic  = 'Mat description'.
      APPEND int_cat TO ws_cat.
    **WBS/Cost center
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KOSTL'.
      int_cat-reptext_ddic  = 'WBS/Cost center'.
      APPEND int_cat TO ws_cat.
    **Currency
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'WAERS'.
      int_cat-reptext_ddic  = 'Currency'.
      APPEND int_cat TO ws_cat.
    **Basic
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'NETWR'.
      int_cat-reptext_ddic  = 'Basic'.
      APPEND int_cat TO ws_cat.
    **Excise
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KBETR'.
      int_cat-reptext_ddic  = 'Excise'.
      APPEND int_cat TO ws_cat.
    **Insurance
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_I'.
      int_cat-reptext_ddic  = 'Insurance'.
      APPEND int_cat TO ws_cat.
    **Frieght
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_F'.
      int_cat-reptext_ddic  = 'Frieght'.
      APPEND int_cat TO ws_cat.
    **VAT/ST
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_T'.
      int_cat-reptext_ddic  = 'VAT/ST'.
      APPEND int_cat TO ws_cat.
    **Other
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_O'.
      int_cat-reptext_ddic  = 'Others'.
      APPEND int_cat TO ws_cat.
    **Total
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'KWERT_TOTAL'.
      int_cat-reptext_ddic  = 'Total'.
      APPEND int_cat TO ws_cat.
    ***Excise
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'ECS'.
      int_cat-reptext_ddic  = 'Excise'.
      APPEND int_cat TO ws_cat.
    *****Freight
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'WRBTR_F'.
      int_cat-reptext_ddic  = 'Freight'.
      APPEND int_cat TO ws_cat.
    *****Tax
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     =  'TAX'.
      int_cat-reptext_ddic  =  'Tax'.
      APPEND int_cat TO ws_cat.
    ***Unplanned Del Cost
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'BEZNK'.
      int_cat-reptext_ddic  = 'Unplanned Del Cost'.
      APPEND int_cat TO ws_cat.
    ****Gross
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'REFWR_G'.
      int_cat-reptext_ddic  = 'Gross'.
      APPEND int_cat TO ws_cat.
    **Total
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'ACTUAL_TOTAL'.
      int_cat-reptext_ddic  = 'Total'.
      APPEND int_cat TO ws_cat.
    **Actual Invoice Total
      int_cat-tabname       = 'INT_OUTTAB'.
      int_cat-fieldname     = 'RMWWR'.
      int_cat-reptext_ddic  = 'Actual Invoice Total'.
      APPEND int_cat TO ws_cat.
    ENDFORM.                    "field_catalog
    *&      Form  display_data
    *       text
    FORM display_data.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = 'Z_MM_TEST1'
          it_fieldcat        = ws_cat[]
        TABLES
          t_outtab           = int_outtab
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    ENDFORM.                    "display_data
    Reward for all helpfull answers
    Regards
    Pavan

  • Need Help on this Code Immediately

    Hi Friends,
    Iam very new to java.
    I have a Java Code that iam trying to Run. The Code Compiles fine but it fails on its 3rd Loop where it is trying to Run a report.
    I have the Code part that is errorring out. Can someone please look into the code and tell me if i need to make any changes to the Code.
    The Code when Executed gives an Error "The Client Did Something Wrong".
    Please Help Me!!!
          * Execute a report.
          *@param     path     This is the search path to the report.
          *@param     format     The array that contains the format options (PDF,HTML,etc...)
         public void executeReport(String path,String[] format)
              ParameterValue pv[] = new ParameterValue[]{};
              Option ro[] = new Option[3];
              RunOptionBoolean saveOutput = new RunOptionBoolean();
              RunOptionStringArray rosa = new RunOptionStringArray();
              RunOptionBoolean burstable = new RunOptionBoolean();
              // Define that the report to save the output.
              saveOutput.setName(RunOptionEnum.saveOutput);
              saveOutput.setValue(true);
              // What format do we want the report in: PDF? HTML? XML?
              rosa.setName(RunOptionEnum.outputFormat);
              rosa.setValue(format);
              // Define that the report can be burst.
              burstable.setName(RunOptionEnum.burst);
              burstable.setValue(true);
              // Fill the array with the run options.
              ro[0] = rosa;
              ro[1] = saveOutput;
              ro[2] = burstable;
              try
                   SearchPathSingleObject spSingle = new SearchPathSingleObject();
                   spSingle.setValue(path);
                   // Get the initial response.
                   AsynchReply res = reportService.run(spSingle,pv,ro);
                   // If it has not yet completed, keep waiting until it is done.
                   // In this case, we wait forever.
                   while (res.getStatus() != AsynchReplyStatusEnum.complete && res.getStatus() != AsynchReplyStatusEnum.conversationComplete)
                        res = reportService.wait(res.getPrimaryRequest(), new ParameterValue[]{}, new Option[]{});
                   reportService.release(res.getPrimaryRequest());
                   // Return the final response.
              catch (Exception e)
                   System.out.println(e);
         }

    Guess I was too late. Sorry
    Inestead of posting you need help on code immediately how about intest posting the particular topic that you are working on. It's quite doubtful that you would be here if you didn't have a question.

  • Need a small abap code

    Dear Friends,
    request your help in creating a small abap Logic.
    Business Case : loading data into 0sd_c03. an addition field product line (ZPRODLINE) has to be populated using Plant (WERKS) and division (SPART)
    Psuedo Logic :
    If division is '32' and plant is '4100'.
    Result = concatenate Plant & Division.
    Else.
    Result = division.
    ENDIF.
    could you pl. help me to write the abap code for the above.
    Regards
    Padmanabham

    Hi,
    In case if you are trying to write in 'Start Routine'  the would be similar to this:
    DATA : I_DATAPACKAGE LIKE DATA_PACKAGE,
             I_TABIX LIKE SY-TABIX.
    CLEAR: I_DATAPACKAGE, I_TABIX.
      LOOP AT DATA_PACKAGE INTO I_DATAPACKAGE.
        I_TABIX  = SY-TABIX.
        IF I_DATAPACKAGE-WERKS  EQ  '4100' AND
            I_DATAPACKAGE-DIVISION EQ  '32'.
           CONCATENATE
            I_DATAPACKAGE-WERKS I_DATAPACKAGE-DIVISION INTO
            I_DATAPACKAGE-<RESULT-FILED>.
          MODIFY DATA_PACKAGE INDEX I_TABIX.
        ENDIF.
      ENDLOOP.
    Hope this would help.
    Message was edited by:
            Nasiroddin Pattan

  • I need help in this code

    wazap guys ? long time not 2 see U :)
    i need help , this application that will follow is supposed to count the words lengths
    i.e if typed "I am poprage" the program will output :
    the word length the occurence
    1 1
    2 1
    3
    4
    5
    6
    7 1
    compile it & u will understand it.
    the problem is that it makes a table for each damen word
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    public class Application2 extends JFrame{
    private JLabel label;
    private JTextField field;
    private JTextArea area;
    private JScrollPane scroll;
    private int count;
    public Application2(){
    super("Application 2 / Word Length");
    Container c = getContentPane();
    c.setLayout(new FlowLayout());
    label = new JLabel("Enter The Text Here");
    c.add(label);
    field = new JTextField(30);
    field.addActionListener(
    new ActionListener(){
    public void actionPerformed(ActionEvent e){
    StringTokenizer s = new StringTokenizer(e.getActionCommand());
    count = s.countTokens();
    while(s.hasMoreTokens()){
    count--;
    pop(s.nextToken());
    c.add(field);
    area = new JTextArea(10,30);
    area.setEditable(false);
    c.add(area);
    scroll = new JScrollPane(area);
    c.add(scroll);
    setSize(500,500);
    show();
    public void pop (String s){
    String poprage = "";
    int count1 = 0;
    int count2 = 0;
    int count3 = 0;
    int count4 = 0;
    int count5 = 0;
    int count6 = 0;
    int count7 = 0;
    int count8 = 0;
    int count9 = 0;
    int count10 = 0;
    int count11 = 0;
    int count12 = 0;
    int count13 = 0;
    int count14 = 0;
    int count15 = 0;
    int count16 = 0;
    int count17 = 0;
    int count18 = 0;
    int count19 = 0;
    int count20 = 0;
    int count21 = 0;
    int count22 = 0;
    int count23 = 0;
    int count24 = 0;
    int count25 = 0;
    for(int i = 0; i < s.length(); i++){
    if(s.length() == 1) count1 += 1;
    else if(s.length() == 2) count2 += 1;
    else if(s.length() == 3) count3 += 1;
    else if(s.length() == 4) count4 += 1;
    else if(s.length() == 5) count5 += 1;
    else if(s.length() == 6) count6 += 1;
    else if(s.length() == 7) count7 += 1;
    else if(s.length() == 8) count8 += 1;
    else if(s.length() == 9) count9 += 1;
    else if(s.length() == 10) count10 += 1;
    else if(s.length() == 11) count11 += 1;
    else if(s.length() == 12) count12 += 1;
    else if(s.length() == 13) count13 += 1;
    else if(s.length() == 14) count14 += 1;
    else if(s.length() == 15) count15 += 1;
    else if(s.length() == 16) count16 += 1;
    else if(s.length() == 17) count17 += 1;
    else if(s.length() == 18) count18 += 1;
    else if(s.length() == 19) count19 += 1;
    else if(s.length() == 20) count20 += 1;
    else if(s.length() == 21) count21 += 1;
    else if(s.length() == 22) count22 += 1;
    else if(s.length() == 23) count23 += 1;
    else if(s.length() == 24) count24 += 1;
    else if(s.length() == 25) count25 += 1;
    poprage += "The Length\t"+"The Occurence\n"+
    "1\t"+count1+"\n"+
    "2\t"+count2+"\n"+
    "3\t"+count3+"\n"+
    "4\t"+count4+"\n"+
    "5\t"+count5+"\n"+
    "6\t"+count6+"\n"+
    "7\t"+count7+"\n"+
    "8\t"+count8+"\n"+
    "9\t"+count9+"\n"+
    "10\t"+count10+"\n"+
    "11\t"+count11+"\n"+
    "12\t"+count12+"\n"+
    "13\t"+count13+"\n"+
    "14\t"+count14+"\n"+
    "15\t"+count15+"\n"+
    "16\t"+count16+"\n"+
    "17\t"+count17+"\n"+
    "18\t"+count18+"\n"+
    "19\t"+count19+"\n"+
    "20\t"+count20+"\n"+
    "21\t"+count21+"\n"+
    "22\t"+count22+"\n"+
    "23\t"+count23+"\n"+
    "24\t"+count24+"\n"+
    "25\t"+count25+"\n";
    area.append(poprage);
    public static void main (String ar[]){
    Application2 a = new Application2();
    a.addWindowListener(
    new WindowAdapter(){
    public void windowClosing( WindowEvent e ){
    System.exit(0);
    can any one fix it ???????
    REGARDS.

    Okay, so I took a look at it, where you are having the problem is that your pop() method not only updated the count variable, but then displays the result each time you call it. and since you call it in the loop, guess what it will give you a "table" for each "damen word"...
    Any way, I was bored enough to "fix" the program and included comments as to what I did and the relative "why"...
    So here goes...
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    public class Application2 extends JFrame{
    private JLabel label;
    private JTextField field;
    private JTextArea area;
    private JScrollPane scroll;
    private int count;
    // moved these up here so that all methods in this class
    // can see and modify them, and more importantly so that they would not go
    // out of scope and end up zero'd out before we display the values
    // in the "table", once that done, then we can zero them out.
    // although an array would be better and easier to use... -MaxxDmg...
    private int count1 = 0;private int count2 = 0;
    private int count3 = 0;private int count4 = 0;
    private int count5 = 0;private int count6 = 0;
    private int count7 = 0;private int count8 = 0;
    private int count9 = 0;private int count10 = 0;
    private int count11 = 0;private int count12 = 0;
    private int count13 = 0;private int count14 = 0;
    private int count15 = 0;private int count16 = 0;
    private int count17 = 0;private int count18 = 0;
    private int count19 = 0;private int count20 = 0;
    private int count21 = 0;private int count22 = 0;
    private int count23 = 0;private int count24 = 0;
    private int count25 = 0;
    // end move int count variable declarations  - MaxxDmg...
    public Application2(){
    super("Application 2 / Word Length");
    Container c = getContentPane();
    c.setLayout(new FlowLayout());
    label = new JLabel("Enter The Text Here");
    c.add(label);
    field = new JTextField(30);
    field.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){
    String poprage = ""; // move this here, once pop() loop is done, then this string
    // will be constructed and displayed  - MaxxDmg...
    StringTokenizer s = new StringTokenizer(e.getActionCommand());
    count = s.countTokens();
    while(s.hasMoreTokens()){ // this is the "pop() loop" since it calls pop() to count the words - MaxxDmg...
    count--;
    pop(s.nextToken()); // runs pop which only increments the count variable as needed - MaxxDmg...
    }// end "pop() loop" - MaxxDmg...
    // string poprage constructed one pop() loop is done to display the proper results - MaxxDmg...
    poprage += "The Length\t"+"The Occurence\n"+"1\t"+count1+"\n"+
    "2\t"+count2+"\n" + "3\t"+count3+"\n" + "4\t"+count4+"\n" +
    "5\t"+count5+"\n" + "6\t"+count6+"\n" + "7\t"+count7+"\n" +
    "8\t"+count8+"\n" + "9\t"+count9+"\n" + "10\t"+count10+"\n" +
    "11\t"+count11+"\n" + "12\t"+count12+"\n" + "13\t"+count13+"\n" +
    "14\t"+count14+"\n" + "15\t"+count15+"\n" + "16\t"+count16+"\n" +
    "17\t"+count17+"\n" + "18\t"+count18+"\n" + "19\t"+count19+"\n" +
    "20\t"+count20+"\n" + "21\t"+count21+"\n" + "22\t"+count22+"\n"+
    "23\t"+count23+"\n" + "24\t"+count24+"\n" + "25\t"+count25+"\n";
    area.append(poprage);
    // end string construction and area update...  - MaxxDmg...
    // all int count variable set to 0 for next usage - MaxxDmg...
    count = 0;
    count1 = 0;count2 = 0;count3 = 0;count4 = 0;count5 = 0;
    count6 = 0;count7 = 0;count8 = 0;count9 = 0;count10 = 0;
    count11 = 0;count12 = 0;count13 = 0;count14 = 0;count15 = 0;
    count16 = 0;count17 = 0;count18 = 0;count19 = 0;count20 = 0;
    count21 = 0;count22 = 0;count23 = 0;count24 = 0;count25 = 0;
    // end count variable reset... - MaxxDmg...
    c.add(field);
    area = new JTextArea(10,30);
    area.setEditable(false);
    c.add(area);
    scroll = new JScrollPane(area);
    c.add(scroll);
    setSize(500,500);
    show();
    public void pop (String s){
    // now all this method does is increment the count variables - MaxxDmg...
    // which will eliminate the "making a table" for each "damen word" - MaxxDmg...
    if(s.length() == 1) count1 += 1;
    else if(s.length() == 2) count2 += 1;
    else if(s.length() == 3) count3 += 1;
    else if(s.length() == 4) count4 += 1;
    else if(s.length() == 5) count5 += 1;
    else if(s.length() == 6) count6 += 1;
    else if(s.length() == 7) count7 += 1;
    else if(s.length() == 8) count8 += 1;
    else if(s.length() == 9) count9 += 1;
    else if(s.length() == 10) count10 += 1;
    else if(s.length() == 11) count11 += 1;
    else if(s.length() == 12) count12 += 1;
    else if(s.length() == 13) count13 += 1;
    else if(s.length() == 14) count14 += 1;
    else if(s.length() == 15) count15 += 1;
    else if(s.length() == 16) count16 += 1;
    else if(s.length() == 17) count17 += 1;
    else if(s.length() == 18) count18 += 1;
    else if(s.length() == 19) count19 += 1;
    else if(s.length() == 20) count20 += 1;
    else if(s.length() == 21) count21 += 1;
    else if(s.length() == 22) count22 += 1;
    else if(s.length() == 23) count23 += 1;
    else if(s.length() == 24) count24 += 1;
    else if(s.length() == 25) count25 += 1;
    }// end modified pop() method - MaxxDmg...
    public static void main (String ar[]){
    Application2 a = new Application2();
    a.addWindowListener(
    new WindowAdapter(){
    public void windowClosing( WindowEvent e ){
    System.exit(0);
    }So read the comments, look at the code and compare it to the original. You will see why the original did not give you the results you wanted, while the fixed version will...
    - MaxxDmg...
    - ' He who never sleeps... '

  • Need help fixing my code...

    I'm currently working on a problem for school where you have to make a game called Pig.
    I worked on it but need help on fixing it because it won't work the way I want it to, and I'm not sure what the problem is.
    public class Pig
        public static void main (String[] args)
          int num1, num2, num3 = 0, num4, num5, num6 =0;
          String answer="y";
          PairOfDice die1 = new PairOfDice(); // die # 1
          PairOfDice die2 = new PairOfDice(); // die # 2
          while (num3 <= 100 || num6 <= 100)
          // rolls dice
          while (answer.equalsIgnoreCase("y"))
              num1 = die1.roll();
              num2 = die2.roll();
              if (num1 == 1 || num2 == 1) // when either face is 1
                {num3 = num3;
                 answer = "n";}
              else  
                if (num1 == 1 && num2 == 1) // when both faces are 1
                    {num3 = 0;
                     answer = "n";}
                else
                    num3 += num1 + num2; // sum of two faces
          System.out.println (num1 +" "+ num2); // shows both faces
          System.out.println (num3); // shows the sum of faces
          System.out.println ("Do you want to roll again? (y/n)");
          answer = Keyboard.readString();
          if (answer.equalsIgnoreCase("n"))
            answer = "1";
          while (answer.equalsIgnoreCase("1"))
              while (num6 <= 20)
                 num4 = die1.roll();
                 num5 = die2.roll();
                 if (num4 == 1 || num5 == 1) // when either face is 1
                     {num6 = num6;
                      answer = "2";}
                 else  
                    if (num4 == 1 && num5 == 1) // when both faces are 1
                        {num6 = 0;
                         answer = "2";}
                    else
                        num6 += num4 + num5; // sum of two faces
              System.out.println (num4 +" "+ num5); // shows both faces
              System.out.println (num6); // shows the sum of faces
              answer = "y";
          Here is my code. It runs okay, but when the dice rolls a 1, it doesn't jump to the next while loop. I need the program to go to the "while loop answer = 1" when the dice rolls a 1 from the "while loop answer = y". If you see my code, I did it by making the answer = "n" to make it jump to the next while loop. I'm sorry if my explanation is confusing. It's my first time asking for help here...
    You don't have to fix the code for me, as long as you tell me what I'm doing wrong.
    Please help me...Thank you for your help.
    Edited by: nakatsu on Nov 12, 2007 7:03 PM

    Hint: all your code does NOT have to be in one method. You have numerous loops some nested inside others. This is starting to get mighty messy and can be tidied up if you think about how you can break some of the code down into smaller chunks and place these into their own methods.
    while (answer.equalsIgnoreCase("1"))What other case is there?

  • Need help with WMI code that will send output to db

    'm new to WMI code writing, so I need some help with writing code that we can store on our server. I want this code to run when a user logs into their computer
    and talks to our server. I also want the code to:
    * check the users computer and find all installed patches
    * the date the patches were installed
    * the serial number of the users computer
    * the computer name, os version, last boot up time, and mac address
    and then have all this output to a database file. At the command prompt I've tried:
    wmic qfe get description, hotfixid
    This does return the patch information I'm looking for, but how do I combine that line of code with:
    wmic os get version, csname, serialnumber, lastbootuptime
    and
    wmic nicconfig get macaddress
    and then get all this to output to a database file?

    Thank you for the links. I checked out http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx and
    found lots of good information. I also found a good command that will print information to a text file.
    Basically what I'm trying to do is retrieve a list of all installed updates (Windows updates and 3rd party updates). I do like that the below code because it gives me the KB numbers for the Windows updates. I need this information so my IT co-workers &
    I can keep track of which of our user computers need a patch/update installed and preferably which patch/update. The minimum we want to know is which patches / updates have been installed on which computer. If you wondering why we don't have Windows automatic
    updates enable, that's because we are not allowed to.   
    This is my code so far. 
    #if you want the computer name, use this command
    get-content env:computername
    $computer = get-content env:computername
    #list of installed patches
    Get-Hotfix -ComputerName $computer#create a text file listing this information
    Get-Hotfix > 'C:\users\little e\Documents\WMI help\PowerShell\printOutPatchList.txt'
    I know you don't want to tell me the code that will print this out to a database (regardless if it's Access or SQL), and that's find. But maybe you can tell me this. Is it possible to have the results of this sent to a database file or do I need to go into
    SQL and write code for SQL to go out and grab the data from an Excel file or txt file? If I'm understanding this stuff so far, then I suspect that it can be done both ways, but the code needs to be written correctly for this to happen. If it's true, then which
    way is best (code in PowerShell to send information to SQL or SQL go get the information from the text file or Excel file)?

  • Need help with error code 150:30

    need help with finding out what error code 150:30 is and how to fix it

    See the following:
    Error 150:30 - Error "Licensing has stopped working" | Mac OS :
    http://helpx.adobe.com/x-productkb/global/error-licensing-stopped-mac-os.html

  • Syntax helper for ABAP code?

    Please, I would like to ask any of you ABAP developers with some expirience...is there any tool (inside or outside the Workbench) that can color the syntax of ABAP code... (the way it is done in some other IDEs like Visual Studio, JBuilder or even Ultra Edit...) ???

    There are some IDE external of SAP that do that. But .. I try it and don't like that.
    Ex : http://www.sapedit.com/
    Wait for next release, there will be some new stuff.
    Frédéric

Maybe you are looking for

  • How to install hp support assistant after changing hard drive on my HP Pavilion TouchSmart

    Hi All, I have recently upgraded my hard drive and install OS windows 8.1. All is well everything is working fine. But, to get latest drivers from HP, I want to install :hp support assistant " application. I try to download and install, it is startin

  • Blue screen hard disk dump AND memory dump

    I sent my toshiba satellite a215-s4767 to the repair depot for a screen replacement and since i got it back i have had 2 blue screen memory dumps and 1 hard disk dump blue screen(that was last night). I got it back on christmas eve so ive had it back

  • How to back up Home folder to Time Capsule using Backup in OS 10.4.11

    I'm new to Time Capsule, but just set up one that I was given, which does 802.11n wireless. No problem connecting to my Intel MacBook and Time Machine. HOWEVER, using Backup v 3.2 on a Dual G4 running OS 10.4.11 was not seamless. The Backup app (need

  • Missing characters, paste, show whats being typed

    hello When trying to enter my 63 character wpa key, I could not find this one " ` ", how do I get it on the iPod touch. To make things easy is it not possible to copy and paste from websites. When attempting to key in your wpa key, it it possible to

  • Import Silent video into Premiere

    I am making a simple video. I have one track of video of a speaker with the audio (separately recorded and replacing the audio that came from the video cam). And I am trying to lay on another video layer to cut in and out with the speaker. I screen r