FOR ALL WITH RETURNING

Hi All,
My requirement is to return a set of values using forall returning clause.For that I am using
begin
FORALL J IN 1..M_T_TABLE1.COUNT SAVE EXCEPTIONS
INSERT INTO TABLE2 VALUES M_T_TABLE1(J)
RETURNING CUST_CODE BULK COLLECT INTO P_T_CUST_CODE;
exception
end;
This code is working fine and It is returning CUST_CODE values using P_T_CUST_CODE.
But there is a situation that i've to run this code in loop like..
begin
FOR I IN 1..NO_OF_ITERATIONS LOOP
FORALL J IN 1..M_T_TABLE1.COUNT SAVE EXCEPTIONS
INSERT INTO TABLE2 VALUES M_T_TABLE1(J)
RETURNING CUST_CODE BULK COLLECT INTO P_T_CUST_CODE;
END LOOP;
exception
end;
NOW IT IS RETURNING THE VALUES INSERTED IN LAST ITERATION ONLY .BUT I WANT THE VALUES INSERTED IN ALL ITERATIONS.
ANY IDEA HOW TO ACHIVE THAT?
THANKS IN ADVANCE.
NM

Hi,
You need to declare table of table (two dimensional table in pl/sql).
  1   declare
  2     type
  3       t1 is table of table2%rowtype index by binary_integer;
  4     type
  5       t2 is table of t1 index by binary_integer;
  6     no_of_iterations number := 3;
  7     m_t_table1 t2;
  8     p_t_cust_code t2;
  9   begin
10     m_t_table1(1)(1).cust_code := 1;
11     m_t_table1(1)(2).cust_code := 2;
12     m_t_table1(2)(1).cust_code := 3;
13     m_t_table1(2)(2).cust_code := 4;
14     m_t_table1(3)(1).cust_code := 5;
15     m_t_table1(3)(2).cust_code := 6;
16     delete from table2;
17     --your code
18     begin
19       FOR I IN 1..NO_OF_ITERATIONS LOOP
20         FORALL J IN 1..M_T_TABLE1(I).COUNT SAVE EXCEPTIONS
21           INSERT INTO TABLE2 VALUES M_T_TABLE1(I)(J)
22           RETURNING CUST_CODE BULK COLLECT INTO P_T_CUST_CODE(I);
23       END LOOP;
24     end;
25     --your code
26     for I in 1..NO_OF_ITERATIONS LOOP
27       for J in M_T_TABLE1(I).first..M_T_TABLE1(I).last loop
28         dbms_output.put_line('P_T_CUST_CODE('||I||', '||J||')='||to_char(P_T_CUST_CODE(I)(J).cust_code));
29       end loop;
30     end loop;
31*  end;
32  /
P_T_CUST_CODE(1, 1)=1
P_T_CUST_CODE(1, 2)=2
P_T_CUST_CODE(2, 1)=3
P_T_CUST_CODE(2, 2)=4
P_T_CUST_CODE(3, 1)=5
P_T_CUST_CODE(3, 2)=6
PL/SQL procedure successfully completed.Bartek
Edited by: brtk on 2009-06-18 08:25 edited line 28.
Edited by: brtk on 2009-06-18 08:26

Similar Messages

  • Common customer for all vendor returns

    dear friends,
    In my current project all our stocks are maintained by a third party warehouse who receives material from vendor and despatches to customer. Despatch Instructions to him is sent by outbound delivery from SAP. When vendor return happens he expects an outbound delivery from SAP, so we are creating outbound delivery from the 122 document but the problem is SAP is expecting one to one customer for each vendor. In our case we want to maintain our third party as single customer and assign to all vendor. Is this possible and how to maintain it?
    Thanks & Regards,
    Venkatesh

    you can use customer hierarchy functionality to over come this kind of situations.

  • Time-split not allowed for routines with return tables

    I've had this issue a couple of times.  It was usually a date field was incorrect.  I have not made any changes concerning update rules.  Any ideas?
    Thanks everyone!
    -Ryan.

    Hi,
    Normally, the date format is common accross R/3 and BW so as long as it is
    stright forward date value then you won't get any errors.
    else, if you are using date field and trying to assign to a fisacl period or Fiscal year
    then you would have to sub string the date and manipulate accordinly..
    like ex: BUDAT+(6) : 200702
                BUDAT+(4): 2007
                BUDAT+4(2) : 02
    Hope this helps..
    assign points if useful..
    Cheers,
    Pattan.

  • Handle with return debit note

    Hi all,
    is there a process for handle with return debi notes?
    A AR invoice for an customer is payed made by direct debit (Lastschrift)
    for any reason the direct debit comes some days later back on the bank account
    but now the AR invoice ist marked as Payed (with the direct debit with the payment wizard)
    and the Bookings of the bank account are
    debit and credit on different days.
    ist there a way to handle this process to get the old invoice open?
    Kind regards
    Gerhard Bienen

    hi gerahard,
    if u want to change the status of AR invoice from closed to open u can do it with the help of the query is this what u wanted to know
    samle query to change the status of the ar invoice when banking module kas been met and i revesed teh payment thus openinging the banking module option
    SELECT   oinv.docnum, oinv.docstatus
    FROM         OINV INNER JOIN
                          INV1 ON OINV.DocEntry = INV1.DocEntry
    where oinv.docnum='29'LECT   oinv.docnum, oinv.docstatus
    regards,
    Manish

  • Signatures For All

    Welcome to Signatures For All
    With the return of signatures to the forum, Signatures For All has also returned. We have changed a lot from previously, except for the one fact that we want everyone to have a decent signature image under their post.
    Anyone can create or request a signature. Just remember the sig makers can either be at school, college, university or may be working and they will also have a life away from these forums, so when you request, please be patient.
    Type of requests we do
    Signatures
    Avatars
    MSN Display Pictures
    Desktop Wallpapers
    PSP Wallpapers
    When you make a request try to be specific about what you want, and don’t request every second day or you will be ignored.
    To make it easier, you can use this form template to request the best way will be to copy and paste it and fill in the blank bits, you don’t have to use it or fill out all the fields.
    Handle:
    Quote:
    Possible Pictures to be Included:
    Size:
    Style/Overall Look:
    Maker:
    There are certain restrictions on the content you can include in you request, it cannot be offensive in anyway and it must abide by the House Rules.Also there are certain size restrictions that creators should keep in mind:
    Signatures
    The maximum size of your custom image is 500 by 100 pixels or 40.0 KB (whichever is smaller).
    Avatars
    The maximum size of your custom image is 80 by 80 pixels or 19.5 KB (whichever is smaller).
    So nothing left to say but get requesting

    Handle: Crus
    Quote: "Crus Loves Fearne
    Possible Pictures to be Included:
    http://img156.imageshack.us/img156/7656/71791622ie5.jpg
    http://myspace-946.vo.llnwd.net/01006/64/93/1006753946_l.jpg
    http://myspace-428.vo.llnwd.net/01292/82/42/1292042428_l.jpg
    Size: What ever suits the maker, not sure of new size restrictions
    Style/Overall Look: School love note style, hearts and what not.
    Maker: Any sexy bastard whos up to the challenge.
    Hows this

  • Once I fix the thumbnail pictures in iPhoto, how do I make them stay fixed.  Everytime I turn the computer back on iPhoto goes directly back to having 1 picture for all thumbnails.

    I have been having problems with the thumbnail pictures in iPhoto.  It will typically show 1 picture for all thumbnails.  I have figured out how to repair the thumbnail pictures, but everytime the computer is shut down, the thumbnail pics revert back to 1 picture for all.

    With the amount of information you've provided it's impossible to offer a potential solution.  We can't see your computer so we need to know the details of your problem and setup, i.e.:
    what version of iPhoto are you using?
    what system version are you running?
    how do you fix the thumbnailsd?
    what other fixes have you tried?
    where is your library located?
    did you apply any updates or upgrades just prior to the problem occurring?
    are you running a "managed" or "referenced" library?
    what type of Mac?
    how much free space on your boot drive?
    OT

  • I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build.  The same call works fine when running on the device

    I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build. The same call works fine when running on the device (iPhone) using debug build. When running with a release build, the result handler is never called (nor is the fault handler called). Viewing the BlazeDS logs in debug mode, the call is received and send back with data. I've narrowed it down to what seems to be a data size issue.
    I have targeted one specific data call that returns in the String value a string length of 44kb, which fails in the release build (result or fault handler never called), but the result handler is called as expected in debug build. When I do not populate the String value (in server side Java code) on the object (just set it empty string), the result handler is then called, and the object is returned (release build).
    The custom object being returned in the call is a very a simple object, with getters/setters for simple types boolean, int, String, and one org.23c.dom.Document type. This same object type is used on other other RemoteObject calls (different data) and works fine (release and debug builds). I originally was returning as a Document, but, just to make sure this wasn't the problem, changed the value to be returned to a String, just to rule out XML/Dom issues in serialization.
    I don't understand 1) why the release build vs. debug build behavior is different for a RemoteObject call, 2) why the calls work in debug build when sending over a somewhat large (but, not unreasonable) amount of data in a String object, but not in release build.
    I have't tried to find out exactly where the failure point in size is, but, not sure that's even relevant, since 44kb isn't an unreasonable size to expect.
    By turning on the Debug mode in BlazeDS, I can see the object and it's attributes being serialized and everything looks good there. The calls are received and processed appropriately in BlazeDS for both debug and release build testing.
    Anyone have an idea on other things to try to debug/resolve this?
    Platform testing is BlazeDS 4, Flashbuilder 4.7, Websphere 8 server, iPhone (iOS 7.1.2). Tried using multiple Flex SDK's 4.12 to the latest 4.13, with no change in behavior.
    Thanks!

    After a week's worth of debugging, I found the issue.
    The Java type returned from the call was defined as ArrayList.  Changing it to List resolved the problem.
    I'm not sure why ArrayList isn't a valid return type, I've been looking at the Adobe docs, and still can't see why this isn't valid.  And, why it works in Debug mode and not in Release build is even stranger.  Maybe someone can shed some light on the logic here to me.

  • Issue with Return Delivery for movement type 262

    Hi,
    I have got a strange issue, the user is trying to do a MIGO Return Delivery for a material document using movement type 262, this he claims has been doing it for many materials. However when i go to the MKPF table i see the transaction Code field to be MIGO_GI for all the material documents for which he claims to have done return delivery. But under this transaction code we have only 4 options - Display, Issue, Cancel and Remove from storage.
    Now when he tries to do the return delivery for movement type 262 he get an error message "Check table T156N: entry RL 262  does not exist" , but this has been very well maintained in the table.
    Can you please let me know -
    If it is possible to do a return delivery for a movement type 262?
    If yes how to address the above error encountered.
    Thanks in advance
    Sachin

    Hi Sachin,
    If you think of return delivery to vendor with or w/o PO reference you can use movement types 161, 122, 124 as default settings.
    Movement type 261 means withdrawal against production order and its reverse is MVT 262. The latter can be used e.g. via MB1A (or you can make storno of a confirmation by 261).
    Are you sure your user is using the correct terminology ('return delivery')? Please check the material documents he/she claims to have booked as return delivery. (in MB51 you can get a list of all material movements of MVT 261 that belong to 'your user' and after that you can open the material document and check through which transaction the booking was made.)
    BR
    Csaba

  • HELP for all 5 TYPES of  STO  Stock Transport Orders with detailed scenario

    PLEASE help me understanding the detailed scenarios for all 5 TYPES of STO s
    as in my day to day job activities , i frequently handles issues related to STO s
    PLEASE HELP WITH DETAILED STEP BY STEP SCENARIOS

    Hi Jagatram,
    Standard SAP has the following methods For Stock transport order:
    1) One Step Transfer stock without using purchasing documents; Use movement type 301.
    2) Two Step Transfer stock without using purchasing documents; Use movement type 303 in Supplying plant and movement type 305 in receiving plant.
    3) Using Standard Transport Order (STO) without delivery in two steps. STO created in T-Code ME27, receiving plant posts goods issue (for returns), movement type 351 and supplying plant post goods receipt from using movement type 101.
    4) Using Standard Transport Order (STO) with delivery in one step. STO created in T-Code ME27, Receiving plant creates shipment and Goods issue document (for materials to be returned) with movement type 647 and goods receipt document with movement type 101 both created in one step.
    5) Using Standard Transport Order (STO) with delivery in two steps. STO created in T-Code ME27, Receiving plant creates shipment and Goods issue posted (for materials to be returned) with movement type 641.Goods receipt is posted in the supplying plant, movement type 101.
    6) Using Transportation scheduling agreement (TSA) with delivery in two steps. TSA created in T-Code ME37. Receiving plant creates shipment and Goods issue document (for materials to be returned) with movement type 641. Goods receipt is posted in the supplying plant, movement type 101.
    To achieve it, necessary configurations has to be done in Tcode- OMGN.
    SPRO>> Materials management>> Purchasing>> Purchase Order>> Set up Stock transport Order:
    1. Plant: For the receiving plant, maintain customer No-Plant (If using STO with delivery), for the Sales Org, Dist channel and Division.
    2. Checking Rule: Create checking rule.
    3. Define checking rule : Usually no change required here.
    4. Assign delivery type/checking rule: Assign the document type(UB) - Supplying plant- Delivery type(NL).
    5. Purchasing document type: Maintain the supplying plant- Receiving plant relationships for the doc type-UB, either 1-step or 2-step, as per business.
    Hope this helps!
    Regards,
    Shilpa

  • Even I cant believe this is happening again! i'm once again asking for help with my account.  Since im very sick I ask that u look into my account and read the hell verizon has put me through and assist ending the hell once and for all even if that means

    Even I cant believe this is happening again! i'm once again asking for help with my account.  Since im very sick I ask that u look into my account and read the hell verizon has put me through and assist ending the hell once and for all even if that means ending my contract, i just want the hell over. I went into my bill tonight and the mess was still there I paid $110. that's what I owe

    I guess I spoke too soon!  I really can't believe this nightmare is not over yet! My account is still wrong.  The credit that I was due totaled $63.00  I am looking at a message on my phone saying that $21.01 was credited which makes my balance $219.72.  I received a text the following day that says, I processed your credit of $30.00 and your new balance $216.73 how is that possible?  None of the late fees were credited and the amount due for my monthly charges are wrong.  Before any changes were made to my data plan back in Nov. My monthly charges were $140.00, I needed my hot spot back and i was told that the hot spot will increase my bill $10 for each phone that totals $20.  The customer rep that change my data plan at that time also gave me a credit of $20 to compensate for the increase until I had time to talk with customer service about the mix-up with my Hot spot. I originally had the hot spot, but the rep that change my plan almost a year prior told me nothing was changing except I was getting more for less money.  I explained to that rep that I need my hot spot 4 times a year...and I don't want my plan to have any changes. To verify what I'm telling u check my account and see that I called from Albany New York wanting to know where my hot spot was and I was told I didn't have the hot spot on my account since the last data change!  I lost money once again due to the verizon rep's.  so my current data plan the rep promised would increase $20 which makes my monthly charges that were $140 prior to the change $160 after the hot spot was returned to my account.  Then I was given a $12 credit per month for 12 months because of so many mistakes made to my account so with that $12 credit my monthly charges should $148 + surcharges + taxes and that's not what I see. I do know this much right now my account is in such a shambles I can hardly see the light at the end if there is an end!  I need real help!
    >> Personal information removed by Verizon Moderator to comply with the Verizon Wireless Terms of Service <<

  • Gather_table_stats with a method opt of "for all indexed columns size 0"

    I have 9 databases I support that contain the same structure, and very similar data concentrations. We are seeing inconsistent performance in the different databases due to bind variable peeking.. I have tracked it down to the Min and Max values that are gathered during the analyze. I analyze from one cluster, and export/import those statistics into the other clusters.. I then go about locking down the stats gathered. Some of the statistics are on tables that contain transient data (the older data is purged, and new data gets a new PK sequence number).
    Since I am gathering statistics with a 'FOR ALL INDEXED COLUMNS SIZE 1', a min and max value are grabbed. This value is only appropriate for a short period of time, and only for a specific database. I do want oracle to know the density to help calculate, but I don't want cardinality based on whether the current bind values fall in this range..
    Example
    COLUMN PK
    When I analyze the min is 1 and max is 5. I then let the database run, and the new min is 100 and max is 105.. same number of rows, but different min/max. At first a select * from table where pk>=1 and pk <=5 would return a cardinality of 5.. Later, a seelct * from tables where pk>=100 and pk<=105 would return a cardinaility 1.
    Any ideas how to avoid this other than trying set min and max to something myself (like min =1 max = 99999999). ??

    MarkDPowell wrote:
    The Oracle documentation on bind variable peeking said it did not peek without histograms and I cannot remember ever seeing on 9.2 where the trace showed otherwise. Mark,
    see this simple test case run on 9.2.0.8. No histograms, but bind variable peeking, as you can see that the EXPLAIN PLAN output generated by AUTOTRACE differs from the estimated cardinality of the actual plan used at runtime.
    Which documentation do you refer to?
    SQL>
    SQL> alter session set nls_language = 'AMERICAN';
    Session altered.
    SQL>
    SQL> drop table bind_peek_test;
    Table dropped.
    SQL>
    SQL> create table bind_peek_test
      2  as
      3  select
      4             100 as n1
      5           , cast(dbms_random.string('a', 20) as varchar2(20)) as filler
      6  from
      7             dual
      8  connect by
      9             level <= 1000;
    Table created.
    SQL>
    SQL> exec dbms_stats.gather_table_stats(null, 'bind_peek_test', method_opt=>'FOR ALL COLUMNS SIZE 1')
    PL/SQL procedure successfully completed.
    SQL>
    SQL> variable n number
    SQL>
    SQL> variable n2 number
    SQL>
    SQL> alter system flush shared_pool;
    System altered.
    SQL>
    SQL> exec :n := 1; :n2 := 50;
    PL/SQL procedure successfully completed.
    SQL>
    SQL> set autotrace traceonly
    SQL>
    SQL> select * from bind_peek_test where n1 >= :n and n1 <= :n2;
    no rows selected
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1000 Bytes=24
              000)
       1    0   FILTER
       2    1     TABLE ACCESS (FULL) OF 'BIND_PEEK_TEST' (Cost=2 Card=100
              0 Bytes=24000)
    Statistics
            236  recursive calls
              0  db block gets
             35  consistent gets
              0  physical reads
              0  redo size
            299  bytes sent via SQL*Net to client
            372  bytes received via SQL*Net from client
              1  SQL*Net roundtrips to/from client
              4  sorts (memory)
              0  sorts (disk)
              0  rows processed
    SQL>
    SQL> set autotrace off
    SQL>
    SQL> select
      2             cardinality
      3  from
      4             v$sql_plan
      5  where
      6             cardinality is not null
      7  and      hash_value in (
      8    select
      9            hash_value
    10    from
    11            v$sql
    12    where
    13            sql_text like 'select * from bind_peek_test%'
    14    );
    CARDINALITY
              1
    SQL>
    SQL> alter system flush shared_pool;
    System altered.
    SQL>
    SQL> exec :n := 100; :n2 := 100;
    PL/SQL procedure successfully completed.
    SQL>
    SQL> set autotrace traceonly
    SQL>
    SQL> select * from bind_peek_test where n1 >= :n and n1 <= :n2;
    1000 rows selected.
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1000 Bytes=24
              000)
       1    0   FILTER
       2    1     TABLE ACCESS (FULL) OF 'BIND_PEEK_TEST' (Cost=2 Card=100
              0 Bytes=24000)
    Statistics
            236  recursive calls
              0  db block gets
            102  consistent gets
              0  physical reads
              0  redo size
          34435  bytes sent via SQL*Net to client
           1109  bytes received via SQL*Net from client
             68  SQL*Net roundtrips to/from client
              4  sorts (memory)
              0  sorts (disk)
           1000  rows processed
    SQL>
    SQL> set autotrace off
    SQL>
    SQL> select
      2             cardinality
      3  from
      4             v$sql_plan
      5  where
      6             cardinality is not null
      7  and      hash_value = (
      8    select
      9            hash_value
    10    from
    11            v$sql
    12    where
    13            sql_text like 'select * from bind_peek_test%'
    14    );
    CARDINALITY
           1000
    SQL>
    SQL> spool offRegards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Inner join with for-all entries

    Why is the below inner join-for all entries does not result in expected output ?
    REPORT  ZTST3                                   .
    tables : ztst1,ztst2 .
    * table ztst1 has 4 fields : mandt,ebeln,ebelp,etenr,char4. ; ztst2 has
    * 3 fields : mandt,ebeln,ebelp,matnr
    *Entries in ztst1
    * EBELN       EBELP   ETERN  CHAR4
    * 5000000000  00010    0001    abc
    * 5000000000  00010    0002    cbd
    * 5000000000  00010    0003    efg
    *Entries in ztst2
    * EBELN       EBELP   matnr
    * 5000000000  00010    matabc
    *expected itab after inner join
    * EBELN       EBELP   CHAR4  MAtnr
    * 5000000000  00010   abc    matabc
    * 5000000000  00010   cbd    matabc
    * 5000000000  00010   efg    matabc
    data : begin of itab1 occurs 0,
           ebeln type ebeln,
           ebelp type ebelp,
           end of itab1.
    data : begin of itab occurs 0,
           ebeln type ebeln,
           ebelp type ebelp,
           char4 type char4,
           matnr type matnr,
           end of itab.
    start-of-selection.
    itab1-ebeln = '5000000000'.
    itab1-ebelp = '00010'.
    append itab1.
    select ztst1~ebeln
           ztst1~ebelp
           ztst1~char4
           ztst2~matnr into corresponding fields of table itab
    from ztst1 inner join ztst2
    on ztst1~ebeln = ztst2~ebeln and
       ztst1~ebeln = ztst2~ebelp
    for all entries in itab1
    where
    ztst1~ebeln eq itab1-ebeln and
    ztst1~ebelp eq itab1-ebelp .
    * why does it return no entries;
    break-point.

    For example in the bellow case
    *Entries in ztst1
    EBELN       EBELP   ETERN  CHAR4
    5000000000  00010    0001    abc
    5000000000  00010    0002    cbd
    5000000000  00010    0003    efg
    5000000002  00020    0003    efg
    5000000002  00020    0003    efg
    *Entries in ztst2
    EBELN       EBELP   matnr
    5000000000  00010    matabc
    5000000002  00020    abc
    may it will return you 2 records yes, than I think you have under stand the working of u201Cfor all entriesu201D ?
    And the following case I think it will work fine.
    *Entries in ztst1
    key  EBELN       EBELP   ETERN  CHAR4
    1       5000000000  00010    0001    abc
    2       5000000000  00010    0002    cbd
    3       5000000000  00010    0003    efg
    4       5000000002  00020    0003    efg
    5       5000000002  00020    0003    efg
    *Entries in ztst2
    EBELN       EBELP   matnr
    5000000000  00010    matabc
    5000000002  00020    abc
    select  ztst1~key
    ztst1~ebeln
           ztst1~ebelp
           ztst1~char4
           ztst2~matnr into corresponding fields of table itab
    from ztst1 inner join ztst2
    on ztst1~ebeln = ztst2~ebeln and
       ztst1~ebelp = ztst2~ebelp
    for all entries in itab1
    where
    ztst1~ebeln eq itab1-ebeln and
    ztst1~ebelp eq itab1-ebelp .
    Sorry, I donu2019t have system with me right now and I am sending you with out testing but I am sure that it is working the same way.
    Please Reply if any problem
    Kind Regards,
    Faisal

  • For all entries.. with agregate functions....help

    Hi ppl,
    I want to put this select query outside loop using for all entries but it doesnt support group by neither aggregate funstions like sum.
    its not giving correct results if i use collect or sum even using control break statements .
    plz help..
    LOOP AT T_UNITS.
        V_TABIX = SY-TABIX.
         get GLPCA postings
        SELECT AWTYP AWORG RACCT REFDOCNR SUM( HSL ) FROM GLPCA "1062
            INTO TABLE T_GLPCA
            WHERE RPRCTR = T_UNITS-UNIT
            AND   RACCT  IN S_HKONT
            AND   KOKRS = V_KOKRS
            AND   RYEAR = P_GJAHR
            AND   POPER  <= P_MONAT
            GROUP BY  AWTYP AWORG RACCT REFDOCNR.               "GK_166118
        SORT T_GLPCA BY AWTYP AWORG REFDOCNR.                   "1062
         process GLPCA postings
        LOOP AT T_GLPCA.
    endloop.
    some code
    endloop.
    thanks
    Archana

    ... FOR ALL ENTRIES IN itab WHERE cond
    Effect
    Only selects the records that meet the logical condition cond when each replacement symbol itab-f is replaced with the value of component f of the internal table itab for at least one line of the table. SELECT ... FOR ALL ENTRIES IN itab WHERE cond returns the union of the solution sets of all SELECT statements that would result if you wrote a separate statement for each line of the internal table replacing the symbol itab-f with the corresponding value of component f in the WHERE condition.Duplicates are discarded from the result set. If the internal table itab does not contain any entries, the system treats the statement as though there were no WHERE cond condition, and selects all records (in the current client).
    Example
    Displaying the occupancy of flights on 28.02.2001:
    TYPES: BEGIN OF ftab_type,
             carrid TYPE sflight-carrid,
             connid TYPE sflight-connid,
           END OF ftab_type.
    DATA:  ftab TYPE STANDARD TABLE OF ftab_type WITH
                     NON-UNIQUE DEFAULT KEY INITIAL SIZE 10,
           free TYPE I,
           wa_sflight TYPE sflight.
    Suppose FTAB is filled as follows:
    CARRID  CONNID
    LH      2415
    SQ      0026
    LH      0400
    SELECT * FROM sflight INTO wa_sflight
        FOR ALL ENTRIES IN ftab
        WHERE CARRID = ftab-carrid AND
              CONNID = ftab-connid AND
              fldate = '20010228'.
      free = wa_sflight-seatsocc - wa_sflight-seatsmax.
      WRITE: / wa_sflight-carrid, wa_sflight-connid, free.
    ENDSELECT.
    The statement has the same effect as:
    SELECT DISTINCT * FROM sflight INTO wa_sflight
        WHERE ( carrid = 'LH'   AND
                connid = '2415' AND
                fldate = '20010228' ) OR
              ( carrid = 'SQ'   AND
                connid = '0026' AND
                fldate = '20010228' ) OR
              ( carrid = 'LH'   AND
                connid = '0400' AND
                fldate = '20010228' ).
      free = wa_sflight-seatsocc - wa_sflight-seatsmax.
      WRITE: / wa_sflight-carrid, wa_sflight-connid, free.
    ENDSELECT.
    Notes
    You can only use ... FOR ALL ENTRIES IN itab WHERE cond in a SELECT statement.
    In the logical condition cond, the symbol itab-f is always a replacement symbol, and should not be confused with the component f of the header line of the internal table itab. The internal table itab does not need to have a header line.
    Each component of the internal table that occurs in a replacement symbol in the WHERE condition must have exactly the same type and length as the corresponding component in the database table.
    You cannot use replacement symbols in comparisons in LIKE, BETWEEN, or IN expressions.
    If you use FOR ALL ENTRIES IN itab, you cannot use ORDER BY f1 ... fn in the ORDER-BY clause.
    If you use FOR ALL ENTRIES IN itab, you cannot use a HAVING clause as well.
    Sameer

  • Software Metering Report - Install base for all metered software programs - Returns 0

    Hi All
    I have an issue with one of the software metering reports, Install base for all metered software programs. when run it returns that the metered software is installed on 0 computers.
    All usage reports seem to work correctly and I can see usage data for the monitored applications. But anything related to install base such as the one listed above and "Computers that have a metered program installed but have not run the program since
    a specific date" either return 0 or are blank.
    Any help will be greatly appreciated

    Hi All
    finally found a fix to the problem. It was very closely related to what Gareth  had mentioned regarding Asset Intelligence. The actual method of detecting if a program is installed is done through Software Inventory
    Under Custom Client Settings i had enabled Software Inventory on client but never setup any rules to gather data. So i created a new rule for all *.exe files and around an hour later the report started to show up clients.
    This blog post also describes the method of setting up software inventory correctly 
    Thanks to all the help and hopefully this will aid anyone else encountering similar problems

  • The select with for all entries is not working correctly

    IF NOT i_ekko_ekpo[] IS INITIAL.
        SELECT ebeln
               ebelp
               zekkn
               vgabe
               bewtp
               menge
               bpmng
               shkzg
               INTO TABLE i_ekbe
               FROM ekbe
               FOR ALL ENTRIES IN i_ekko_ekpo
               WHERE ebeln EQ i_ekko_ekpo-ebeln.
                AND ebelp EQ i_ekko_ekpo-ebelp.
        IF sy-subrc EQ 0.
          SORT i_ekbe.
        ENDIF.
      ENDIF.
    I have a PO with 2 line items in i_ekko_ekpo. In EKBE, I have 49 recs for this PO and this select is returning only 13 recs.
    I tried by commenting EBELP and still the same result.
    Thanks
    Kiran
    Edited by: kiran dasari on May 22, 2009 9:56 PM

    Hi Sudhi, I added these now but still no charm
        SELECT ebeln
               ebelp
               zekkn
               vgabe
               bewtp
               menge
               bpmng
               shkzg
               INTO TABLE i_ekbe
               FROM ekbe
               FOR ALL ENTRIES IN i_ekko_ekpo
               WHERE ebeln EQ i_ekko_ekpo-ebeln
                 AND ebelp EQ i_ekko_ekpo-ebelp
                 AND zekkn GE '00'
                 AND vgabe IN ('1','2').
    And as per your note: in the 13 entries, am having duplicate also. This is something weird for me now.
    Any more clues.
    Thanks
    Kiran

Maybe you are looking for

  • Communication Channel Monitoring using CCMS/Solution manager

    Hi ,         I have configured everything in solution manager for message monitoirng of PI system, but my requirement is to monitor communication channel error in ccms. Is there any possibilty to trigger alerts for communication channel errors ?? Reg

  • Tired of my Mail and some other apps crashing.

    My Mail.app and 2-3 other applications are crashing daily and have done so for a long time now. First I thought it was just a Leopard bug but now I'm tired of the crashes. Does some body understand this crash log? Process: Mail [304] Path: /Applicati

  • Home Sharing Not Displaying on Other Devices

    I currently have iTunes v11.1.2.31 installed on Windows 7 64-bit Home Premium. I also have multiple iOS devices, to include an iPhone and iPads that are on iOS 7 and an Apple TV (Gen 2) that has the most recent update as well. I have Home Sharing tur

  • Westell 327W and WEP

    I have the latest software version for the router. When I enable WEP and hit apply, the wireless settings confirm WEP is enabled. However, every time I go back and access the router, WEP is disabled. Any ideas?

  • EJB Calling a Servlet

    Can I make a call to a servlet from within an EJB method ?           If so how ?           Anil           RealPrompt, Inc.           575 Harrison Street, Suite 206           San Francisco, CA 94105           415.546.5600 ext. 204           415.546.02