With out collect statement

thanks for u r replys for cummulate the quantity.
but collect only will cumulate the quantity where non numeric values match. but my example contains numeric and non numeric unique fields.
what is the other solution for this.

What do you want it to look like afterwards.
Like this?
PLANT MATNR PERIOD LGORT QUAN MEINS
A001 03201780 03122004 AA01 10 EA
A003 03201782 03122004 AA02 10 EA
If so, the only way that this would make sense is if there is a 1 to 1 conversion from EA to LB.  If not, you will need to convert LB to EA and then collect them.  I believe someone has already suggested doin the conversion before COLLECT.
Regards,
Rich Heilman

Similar Messages

  • Help with a COLLECT statement.

    I had to make changes to some code and these changes required me to add some fields to an internal table.  Below is what the table looked like before I made any changes:
    DATA : BEGIN OF t_frgroup OCCURS 0,
        BEGIN CHANGE 02/11/03
            hazmat       TYPE c,
        END CHANGE 02/11/03
            mfrgr        LIKE lips-mfrgr,
            brgew        LIKE lips-brgew,
            lfimg        LIKE lips-lfimg,
            qtypal       LIKE w_nbr_palletsx,
            qtypce       LIKE w_nbr_palletsx,
            vstel        LIKE likp-vstel,
            no_cnvrt     TYPE c,
    END OF t_frgroup.
    This is what it looked like after I made the changes:
    DATA : BEGIN OF t_frgroup OCCURS 0,
        BEGIN CHANGE 02/11/03
            hazmat       TYPE c,
        END CHANGE 02/11/03
            mfrgr        LIKE lips-mfrgr,
            brgew        LIKE lips-brgew,
            lfimg        LIKE lips-lfimg,
            qtypal       LIKE w_nbr_palletsx,
            qtypce       LIKE w_nbr_palletsx,
            vstel        LIKE likp-vstel,
            no_cnvrt     TYPE c,
            matnr        TYPE lips-matnr,
            vbeln        TYPE lips-vbeln,
            posnr        TYPE lips-posnr,
            qty          LIKE vblkp-lfimg,
            vrkme        LIKE lips-vrkme,
            converted(1) TYPE c VALUE 'N',
    END OF t_frgroup.
    My issue is, after adding those fields, my collect statement no longer works:
          LOOP AT t_lips.
            MOVE-CORRESPONDING t_lips TO t_frgroup.
            COLLECT t_frgroup.
          ENDLOOP.
    I need it to collect with the key being mfrgr.  How can I do this?  After adding the fields the collect statement now acts as an insert (I assume that matnr is now acting as the key) instead of collect. 
    Regards,
    Aaron

    Hi Aaron,
    1. Define the table keys while defining your internal table.
    2. The order of the fields in the structure should be that the key fields come first , then the quantity fields and amount fields next.
    3. Sort the table by the key fields before the loop.
    The collect statment is creating news entries because If the system finds an entry with the key fields , the numeric fields that are not part of the table key are added to the sum total of the existing entries. If it does not find an entry, the system creates a new entry instead. Clearly the system is unable to find the existing entry because the key fields are not defined in your internal table or the fields are are out of order.
    Hope this helps.
    A simple example depicting this is as follows :
    TYPES: BEGIN OF COMPANY,
            NAME(20) TYPE C,
            SALES    TYPE I,
          END OF COMPANY.
    DATA: COMP    TYPE COMPANY,
          COMPTAB TYPE HASHED TABLE OF COMPANY
                                    WITH UNIQUE KEY NAME.
    COMP-NAME = 'Duck'.  COMP-SALES = 10. COLLECT COMP INTO COMPTAB.
    COMP-NAME = 'Tiger'. COMP-SALES = 20. COLLECT COMP INTO COMPTAB.
    COMP-NAME = 'Duck'.  COMP-SALES = 30. COLLECT COMP INTO COMPTAB.
    regards,
    Advait Gode.
    Edited by: Advait Gode on Mar 28, 2008 3:50 PM

  • Collection with bulk collect , statement is not executed..

    DECLARE
              CURSOR cur_upt IS SELECT ts.user_id, ts.lot_id, ts.ml_ac_no, ts.td_prs_dt, ts.unit_cost, ts.cost_basis
              FROM tb_xop_sharelot_frac_snap fs, tb_xop_sharelot ts
              WHERE fs.lot_id=ts.lot_id AND fs.user_id=ts.user_id;
    TYPE tx_tab IS TABLE OF tb_xop_sharelot.user_id%TYPE;
    ltab tx_tab;
    TYPE tx_tab1 IS TABLE OF tb_xop_sharelot.lot_id%TYPE;
    ltab1 tx_tab1;
    TYPE tx_tab2 IS TABLE OF tb_xop_sharelot.ml_ac_no%TYPE;
    ltab2 tx_tab2;
    TYPE tx_tab3 IS TABLE OF tb_xop_sharelot.td_prs_dt%TYPE;
    ltab3 tx_tab3;
    TYPE tx_tab4 IS TABLE OF tb_xop_sharelot.unit_cost%TYPE;
    ltab4 tx_tab4;
    TYPE tx_tab5 IS TABLE OF tb_xop_sharelot.cost_basis%TYPE;
    ltab5 tx_tab5;
    BEGIN
              INSERT INTO tb_xop_sharelot_frac_snap (lot_id, jemq_num, lot_qy, activity_type, LOT_SL_CREATE_DT,
                   LOT_SL_CLOSE_DT, lot_status, frac_recon, hist_flag, create_dt, user_id)
                   (SELECT lot_id, jemq_num, lot_qy, activity_type, LOT_SL_CREATE_DT,
                   LOT_SL_CLOSE_DT,lot_status, frac_recon, hist_flag, create_dt, user_id FROM tb_xop_sharelot_fraction);
              OPEN Cur_upt;
    LOOP
              FETCH Cur_upt BULK COLLECT INTO ltab, ltab1, ltab2, ltab3, ltab4, ltab5 LIMIT 5000;
    EXIT WHEN cur_upt%NOTFOUND;
              END LOOP;
              CLOSE cur_upt;
              FORALL i IN ltab.FIRST..ltab.LAST
    UPDATE tb_xop_sharelot_frac_snap SET ml_ac_no=ltab2(i)/*, td_prs_dt=ltab3(i),
              unit_cost=ltab4(i), cost_basis=ltab5(i)*/ WHERE user_id=ltab(i) AND lot_id=ltab1(i);
              COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SQLCODE|| ' ' ||SQLERRM);
    END;

    This is the third question you have posted just putting one short subject and only posting code not formatted.
    I suggest you to read SQL and PL/SQL FAQ and avoid posting your question in this way as they will be ignored.
    Please:
    a) post sample data
    b) post your code formatted
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    c) explain what problem you are facing in details (including oracle errors)
    d) explain the logic you want to have
    e) post your expected output.
    Regards.
    Al

  • Select with out into in plsql

    hi all
    i want to write a select statment in a procedure with out into statement ..
    is it possilbe if yes how can i do this.
    if its not possible then if we have to Return a number of rows from procedure then how can i do this..
    thanks in advance

    User1728 wrote:
    actual i want to return a datatable type data from procedureWhat does "datatable type" mean? "Datatable" is not a type in PL/SQL, so I assume that it has some meaning in your client programming language. What Oracle data type are you trying to return?
    My guess would be that you are trying to return a REF CURSOR so that you want something like
    SQL> create procedure return_rc( p_rc OUT sys_refcursor )
      2  as
      3  begin
      4    open p_rc for select * from emp;
      5  end;
      6  /
    Procedure created.
    SQL> variable rc ref cursor;
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
                        VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) |
                        NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
                        BINARY_FLOAT | BINARY_DOUBLE ] ]
    SQL> variable rc refcursor;
    SQL> exec return_rc( :rc );
    PL/SQL procedure successfully completed.
    SQL> print rc
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        800
            20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300
            30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500
            30
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7566 JONES      MANAGER         7839 02-APR-81       2975
            20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400
            30
    <<more data snipped>>Justin

  • Customer Collection Statement

    Hi All
    I need to some help with Customer Collection statement , I need this field to display the DOC REF NO in column 2 and not BP REF NO.
    Which field must I display in order to display the invoice number or credit note number related to a particular line on the statement lines.
    Thanks
    Bongani Dlamini

    Hi Bongani Dlamini,
    This PLD is one of the hard coded one.  There is no option for you to customize it.  You need to create your own report by a reporting tool instead.
    Thanks,
    Gordon

  • Is there a way to find out whether my imessages are being received by a specific iphone user or if there is a problem with their phone? Cannot get in touch with an out of state friend for several days.

    I'm looking for a way to check and see if a specific iPhone user is receiving my imessages or if there phone is not working properly.  I cannot get in touch with an out of state friend for several days and the only number I have is to their cell (iphone).  Thank you.

    YYou can only get a read receipt, not if they only received it.
    http://m.imore.com/how-turn-and-read-receipts-imessage

  • HT5268 Just purchased Imac and Macbook pro and upgrades to Mountain Lion. Java will not run with one important site where my Grandson is in Kindergarten out of state with in room camera. What to do. This is very disappointing and non of apple geniuses kno

    My new IMac and Macbook Pro are each loaded with Mountain Lion. Have Office for Mac also
    When I try to see my Grandson on webcam out of state the login will not activate. For PC use I needed Java and Active X to let it run. My Java is checked as ready to go but nothing happens. Otherwise these are great computers. Please help me through the process. The Geniuses at my apple store can't understand what to do.
    [email protected] or [email protected]

    By default, OS X does NOT come with Java installed nowadays. You need to open the Java Preferences app found in Utilities; when you do that the first time, it will inform you of the fact and offer to install the product for you.
    Afterwards, due to a major security issue we had back in the first quarter of the year, the plugin is disabled by default. You need to revisit the Preferences and enable manually. It will auto-disable if unused in awhile.
    Lastly, you may have to adjust which Java instance is being used, the 32-bit or the 64-bit. Default is 64-bit, but some applets crash & burn or outright refuse to run in such a platform. You can prioritize which version you prefer by dragging on top in the Preferences.

  • Cashflow statement with out activating cash management

    Dear Friends,
    With out activating CASH MANAGEMENT how to get cash flow statement, please suggest me how to define and get cash flow statement with some example and transaction codes. In my project there is no cash management active. My client is asking me how to get cash flow statement

    Hi,
    Cash flow statement can be prepared using the report painter and linking the financial statement version to the same.
    In this case we need not ativate the cash management.
    Thanks,
    Shilpa.

  • Collect statement with index

    Hi
    can anyone give me some idea  how to use collect statement with index
    here in the below syntax i want to use collect instead of insert.
    INSERT WA_ALVDISPLAY   INTO IT_ALVDISPLAY  index  3 .
    thanks.
    vivekk

    hi
    my scenario is like this
    i need an yearly report of a examination held in a school based on month,each month they need report for girls and boys separately
    the output format should be like this
    month:marks( boys)  marks( girls )
    so i have created 3 internal tables suppose itab ,itab1,itab2.
    itab1-month1
    itab1-boy_sub1
    itab1-boy_sub2
    itab2-month2
    itab2-girl_sub1
    itab2-girl_sub2
    itab -month1
    itab -boy_sub1
    itab -boy_sub2
    itab -girl_sub1
    itab -girl_sub2
    first i am looping in itab1 and using COLLECT statement i am inserting data to itab (bez in a month more than one exam can happen)
    i got boys mark in itab,then i need to put girls mark on the same row based on month
    based on particular index i need to insert data, moreover i need to use COLLECT statement for getting the total of particular month
    thanks
    vivek

  • I bought the production premium , cs6 , and I download it and registered with out any problem , I formatted my computer then I downloaded the collection , now everything else working only after effect is not working , what shall i do

    I bought the production premium , cs6 , and I download it and registered with out any problem , I formatted my computer then I downloaded the collection , now everything else working only after effect is not working , what shall i do

    did ae install without problem? check the install logs to be sure (Troubleshoot with install logs | CS5, CS5.5, CS6, CC)
    if it did, what do you see when clicking the executable?

  • How to get the inserted row primary key with out  using select statement

    how to return the primary key of inserted row ,with out using select statement
    Edited by: 849614 on Apr 4, 2011 6:13 AM

    yes thanks to all ,who helped me .its working fine
    getGeneratedKeys
    String hh = "INSERT INTO DIPOFFERTE (DIPOFFERTEID,AUDITUSERIDMODIFIED)VALUES(DIPOFFERTE_SEQ.nextval,?)";
              String generatedColumns[] = {"DIPOFFERTEID"};
              PreparedStatement preparedStatement = null;
              try {
                   //String gen[] = {"DIPOFFERTEID"};
                   PreparedStatement pstmt = conn.prepareStatement(hh, generatedColumns);
                   pstmt.setLong(1, 1);
                   pstmt.executeUpdate();
                   ResultSet rs = pstmt.getGeneratedKeys();
                   rs.next();
    //               The generated order id
                   long orderId = rs.getLong(1);

  • Can i only sync my recent album.with out having to sync my complete collection witch is over 2000. ipod classic

    can i only sync my recent album?.with out having to sync my complete collection witch is over 2000.songs on my ipod classic 80gb.

    Sorted it out. If anyone has this problem i reccommend visiting http://forums.ilounge.com/ipod-classic-ipod-5g-video/237546-ipod-classic-80gb-fr eezes-itunes-need-restore-plz-help-2.html#post1403546 there's some pretty good advice on it. have to go into control panel and re-format iPod into NTFS file. good luck.

  • My wife left to another state and she receive all my imessages  on her iphone i want that to stop how do i remove her with out her knowing

    my wife left to another state and she receive all my imessages on her iphone i want that to stop how do i remove her with out her knowing>?

    Try
    <https://selfsolve.apple.com/deregister-imessage>

  • Hi i have some problem with collect statement.

    hi when i am using collect statement and whn ever any field is modified it is getting doubled and showing doubled value. may i knoe what would be problem.

    Hai Kumar
    Go through the following Collect Syntax
    COLLECT
    Basic form
    COLLECT [wa INTO] itab.
    Addition
    ... SORTED BY f
    Effect
    COLLECT is used to create unique or compressed datsets. The key fields are the default key fields of the internal table itab .
    If you use only COLLECT to fill an internal table, COLLECT makes sure that the internal table does not contain two entries with the same default key fields.
    If, besides its default key fields, the internal table contains number fields (see also ABAP/4 number types ), the contents of these number fields are added together if the internal table already contains an entry with the same key fields.
    If the default key of an internal table processed with COLLECT is blank, all the values are added up in the first table line.
    If you specify wa INTO , the entry to be processed is taken from the explicitly specified work area wa . If not, it comes from the header line of the internal table itab .
    After COLLECT , the system field SY-TABIX contains the index of the - existing or new - table entry with default key fields which match those of the entry to be processed.
    Notes
    COLLECT can create unique or compressed datasets and should be used precisely for this purpose. If uniqueness or compression are unimportant, or two values with identical default key field values could not possibly occur in your particular task, you should use APPEND instead. However, for a unique or compressed dataset which is also efficient, COLLECT is the statement to use.
    If you process a table with COLLECT , you should also use COLLECT to fill it. Only by doing this can you guarantee that
    the internal table will actually be unique or compressed, as described above and
    COLLECT will run very efficiently.
    If you use COLLECT with an explicitly specified work area, it must be compatible with the line type of the internal table.
    Example
    Compressed sales figures for each company
    DATA: BEGIN OF COMPANIES OCCURS 10,
            NAME(20),
            SALES TYPE I,
          END   OF COMPANIES.
    COMPANIES-NAME = 'Duck'.  COMPANIES-SALES = 10.
    COLLECT COMPANIES.
    COMPANIES-NAME = 'Tiger'. COMPANIES-SALES = 20.
    COLLECT COMPANIES.
    COMPANIES-NAME = 'Duck'.  COMPANIES-SALES = 30.
    COLLECT COMPANIES.
    The table COMPANIES now has the following appearance:
    NAME SALES
    Duck 40
    Tiger 20
    Addition
    ... SORTED BY f
    Effect
    COLLECT ... SORTED BY f is obsolete and should no longer be used. Use APPEND ... SORTED BY f which has the same meaning.
    Note
    Performance
    The cost of a COLLECT in terms of performance increases with the width of the default key needed in the search for table entries and the number of numeric fields with values which have to be added up, if an entry is found in the internal table to match the default key fields.
    If no such entry is found, the cost is reduced to that required to append a new entry to the end of the table.
    A COLLECT statement used on a table which is 100 bytes wide and has a key which is 60 bytes wide and seven numeric fields is about approx. 50 msn (standardized microseconds).
    Note
    Runtime errors
    COLLECT_OVERFLOW : Overflow in integer field when calculating totals.
    COLLECT_OVERFLOW_TYPE_P : Overflow in type P field when calculating totals.
    Thanks & regards
    Sreenivasulu P

  • Problem with Collect statement

    Hi Experts,
    I am facing a peculiar problem. Please go through the code below and it is not giving the aggregate of it_ekbe_642_pgi-menge for the same it_ekbe_642_pgi-ebeln and it_ekbe_642_pgi-ebelp.
    LOOP AT it_ekbe_642_pgi.
        it_ekbe_642_pgi_tot-ebeln =   it_ekbe_642_pgi-ebeln.
        it_ekbe_642_pgi_tot-ebelp =   it_ekbe_642_pgi-ebelp.
        it_ekbe_642_pgi_tot-budat =   it_ekbe_642_pgi-budat.
        it_ekbe_642_pgi_tot-xblnr =   it_ekbe_642_pgi-xblnr.
        it_ekbe_642_pgi_tot-menge =   it_ekbe_642_pgi-menge.
        COLLECT it_ekbe_642_pgi_tot.
      ENDLOOP.
    Please suggest.
    Thanks....
    Shibaji.

    Hi Shibaji Maitra ,
    Since you are aggregating the it_ekbe_642_pgi-menge for the same it_ekbe_642_pgi-ebeln and it_ekbe_642_pgi-ebelp.
    For using the Collect statement the order of the fields should be
    in proper order i.e. all the char fields come up & then after that
    all the numeric fields.Please check the sequence in your internal
    table and also the fields type of menge field.
    LOOP AT it_ekbe_642_pgi.
      it_ekbe_642_pgi_tot-ebeln = it_ekbe_642_pgi-ebeln.
      it_ekbe_642_pgi_tot-ebelp = it_ekbe_642_pgi-ebelp.
    it_ekbe_642_pgi_tot-xblnr = it_ekbe_642_pgi-xblnr.
    it_ekbe_642_pgi_tot-budat = it_ekbe_642_pgi-budat.
    it_ekbe_642_pgi_tot-menge = it_ekbe_642_pgi-menge.
    COLLECT it_ekbe_642_pgi_tot.
    ENDLOOP.
    Rewards points if helpful.
    Regards
    Manoj Kumar

Maybe you are looking for

  • Handling unit 1000001227 contains an item that cannot be assigned

    THE HANDLING UNITS ARE CREATED WITH THE BATCH MANAGED MATERIAL HU02. AT THE TIME OF CREATING DELIVERY,WHEN I GO TO SELECT THE HANDLING UNITS IN EDIT>PACK THE SYSTEM GIVES ME FOLLOWING WARNING, Items subject to batch handling w/o batch assignment coul

  • IOs4 upgrade software - Error 29 - phone crashes

    HELP!!! Has anyone managed to solve this problem. Apple offered to look at mine under the remaining warranty. Sent it back saying it had water damage. My phone worked perfectly well until I downloaded this software.

  • Amfphp - flex remote object error event handler

    I'm using amfphp and I want it to return an error that the flex remote object error event handler will pick up. At the moment I can get only the result handler to do anything in flex.

  • Material quantity in CJ20N

    Hello, I have a reuirement that when attacjing a material to in CJ20N, the quantuty should be defaulted to 1 for particula materials. How can this be done? Any inputs will be appriciated. Thanks & Regards, Grego

  • I can't get a keyboard to show when I try to add a contact on my iPhone 5s

    I can't get  keyboard to show when I try to add a contact on my apple iPhone 5s. I already went to settings and I use QUERTY and I have a Swiftkey with the full access not allowed.