Problem with AT NEW and AT END Statements

Hi all,
I am facing a problem in a report with i have to change ,
currently report is for single plant input but now multiple option is to be given , so now the material quantity and value should come along with material and plant.
But in report lot's of AT NEW matnr and AT END of matnr has been use but now i have to add plant in it , but these statements take only one parameter.
I tried using ON CHANGE Statement but in that SUM Can't be use.
So please help me in sorting out this problem.
Thanks and Regards,
Vivek

Hi,
  Already you are using material in AT NEW statements and you want to include Plant. by changing the structure you can continue with the same statement i.e., AT NEW matnr.
Structure:
Data: begin of itab  occurs 0,
           werks  type werks,
           matnr   type  matnr,
           qyt     type  matqty,
         end of itab.
SORT itab BY  werks, matnr.
If you use AT NEW matnr. this will be triggered  when plant value changes and also when matnr changes.
Hope it is clear.

Similar Messages

  • COLLECT with AT NEW and AT END OF....?

    Hi Experts,
    I'm trying to use the collect statement withiin a at new and at end of loop as follows.
    DATA: BEGIN OF gt_item OCCURS 0,
          order TYPE order,
          quantity TYPE quantity,
          line_no TYPE line_no,
          END OF gt_item.
      DATA: BEGIN OF lt_picks OCCURS 0,
            pick(2) TYPE c,
            count TYPE i,
            END OF lt_picks.
    SORT gt_item BY suborder_no.
      LOOP AT gt_item.
        AT NEW suborder_no.
          CLEAR lt_picks.
          CLEAR lv_count.
        ENDAT.
    **EACH ITEM
        ADD 1 TO lv_count.
        AT END OF suborder_no.
          lt_picks-pick = lv_count.
          lt_picks-count = 1.
          COLLECT lt_picks.
        ENDAT.
      ENDLOOP.
    I have essetially 23 entries in gt_item where some ordr numbers are the same - the quantity for 20 entries is 1 and for 3 entries is 3.
    Therefore i should get back lt_picks as
    Pick     |      Count
    1                  20
    3                   3
    But what im getting back is
    Pick     |      Count
    1                  7
    3                  2
    2                  3
    4                   1
    Any ideas anyone - Thanks in advance

    Hi Henri,
    Contents are as follows :
    0806107835168-1                  |1            |000001                 
    2938277835168-1                  |1            |000003                 
    2938277835168-1                  |1            |000002                 
    2938277835168-1                  |1            |000001                 
    2938277835168-2                  |1            |000001                 
    080605-122378-2                  |1            |000002                 
    080605-122378-2                  |1            |000001                 
    080605-502378-1                  |1            |000003                 
    080605-502378-1                  |1            |000002                
    080605-502378-1                  |1            |000001                 
    080605-502378-2                  |1            |000002                 
    080605-502378-2                  |1            |000001                 
    080605-502379-1                  |3            |000001                 
    080605-502379-2                  |3            |000001                 
    080605-502379-3                  |3            |000001                 
    080605-502379-4                  |1            |000001                 
    080605-502380-1                  |1            |000001                 
    080605-502381-1                  |1            |000001                 
    080605-502381-1                  |1            |000002                 
    V80905-502374-1                  |1            |000005                 
    V80905-502374-1                  |1            |000003                 
    V80905-502374-1                  |1            |000002                 
    V80905-502374-1                  |1            |000001     
    Thanks

  • Problems with varchar2 column and a select statement

    Hi to all,
    I am new to ODP...so I would really appreciate your help..
    I am having problems with using the following code:
    con.ConnectionString = "User Id=bla;Password=bla;Data Source=bla;";
    string cmdQuery = "SELECT * from try where data ="+textBox1.Text+"";
    OracleCommand cmd = new OracleCommand(cmdQuery);
    cmd.Connection = con;
    cmd.CommandType = CommandType.Text;
    OracleDataReader reader = cmd.ExecuteReader();
    while (reader.Read())
    MessageBox.Show(reader.GetString(0)+"");
    cmd.Dispose();
    con.Close();
    where:
    data is the name of a field in the table
    textBox1 is the name of a text box where the user inserts the values..
    The error that appears is "Invalid identifier"..
    I hope it makes sense...and please help...

    Hi,
    I'm fairly sure it IS the single quotes actually. Print out the string you're trying to excute, then try it outside odp.net, does it work?
    For example:
    SQL> select * from dual where dummy=foo;
    select * from dual where dummy=foo
    ERROR at line 1:
    ORA-00904: "FOO": invalid identifier
    SQL> select * from dual where dummy='foo';
    no rows selected
    Cheers,
    Greg

  • Problems with string comparison and\or If statement

    Right now I'm trying to make a program that will look into all of my music folders, and rename the .mp3 files to a format i want, based on the id3 tags. The program so far looks in all of the folders I want it to, but I get stuck when I need to check if the files are .mp3 files or not. Here is my code so far:
    package fileRenamer;
    import java.io.File;
    public class FileRenamer {
    public static void main(String[] argv) {
         File artistsFolders = new File("F:/Music (MP3)");
         File[] artists = artistsFolders.listFiles();
         for(int i = 0; i < artists.length; i++){
              if(artists.isFile()) {
                   System.out.println(artists[i].getName());
         } else if (artists[i].isDirectory()) {
              System.out.println(artists[i].getName());
              File albumsFolders = new File("F:/Music (MP3)/"+artists[i].getName());
              File[] albums = albumsFolders.listFiles();
              for(int a = 0; a < albums.length; a++){
                   if(albums[a].isFile()) {
                        System.out.println("-" + albums[a].getName());
                   } else if (albums[a].isDirectory()) {
                        System.out.println("-" + albums[a].getName());
                   File songsFolders = new File("F:/Music (MP3)/"+artists[i].getName()+"/"+albums[a].getName());
                   File[] songs = songsFolders.listFiles();
                   for(int s = 0; s < songs.length; s++){
                        if(songs[s].isFile()) {
                             int dotPos = songs[s].getName().toString().lastIndexOf(".");
                             String extension = songs[s].getName().toString().substring(dotPos);
                             System.out.println(extension);
                             if(extension == ".mp3"){
                                  System.out.println("--" + songs[s].getName());
                   } else if (songs[s].isDirectory()) {
                             System.out.println("--" + songs[s].getName());
    When I test the code, the line System.out.println(extension); prints .mp3 into the console for all of the .mp3 files. Whatever I try, the if(extension == ".mp3") never seems to declare the two equal. If anyone knows what my problem is, I greatly appreciate the advice and help.
    Thanks in Advance,
    James

    Pojo226 wrote:
    I just tried that and it worked perfectly. Thanks.You're welcome.

  • At new and at end of statement

    how to use AT NEW and AT END OF
    efficiently,kindly give some solid examples.
    thanks!!

    Now say, u have internal table with mateirals....there are 100 records with 10 mterials...
    loop at it_matnr.
      at new matnr.
        <b>write code</b>
      endat.
      <b>write code.</b>
      at end of matnr.
         <b>write code</b>
      endat.
    endloop.
    Check this which is explained...
    Control Level Processing
    When you perform a sort using the SORTstatement, control levels are defined in the extract dataset. For general information about control levels, refer to Processing Internal Tables in Loops The control level hierarchy of an extract dataset corresponds to the sequence of the fields in the header field group. After sorting, you can use the ATstatement within a LOOP loop to program statement blocks that the system processes only when the control level changes.
    AT NEW f | AT END OF f.
    ENDAT.
    A control break occurs when the value of the field f or a superior field in the current record has a different value from the previous record (AT NEW) or the subsequent record (AT END). Field f must be part of the header field group.
    If the extract dataset is not sorted, the AT - ENDAT block is never executed. Furthermore, all extract records with the value HEX null in the field f are ignored when the control breaks are determined.
    The AT... ENDAT blocks in a loop are processed in the order in which they occur. This sequence should be the same as the sort sequence. This sequence must not necessarily be the sequence of the fields in the header field group, but can also be the one determined in the SORT statement.
    If you have sorted an extract dataset by the fields f1, f2, …, the processing of the control levels should be written between the other control statements in the LOOP loop as follows:
    LOOP.
      AT FIRST.... ENDAT.
        AT NEW f1....... ENDAT.
          AT NEW f2....... ENDAT.
              AT fgi..... ENDAT.
              Single record processing without control statement
          AT END OF f2.... ENDAT.
        AT END OF f1.... ENDAT.
      AT LAST..... ENDAT.
    ENDLOOP.
    You do not have to use all of the statement blocks listed here, but only the ones you require.
    REPORT demo_extract_at_new.
    DATA: t1(4) TYPE c, t2 TYPE i.
    FIELD-GROUPS: header.
    INSERT t2 t1 INTO header.
    t1 ='AABB'. t2 = 1. EXTRACT header.
    t1 ='BBCC'. t2 = 2. EXTRACT header.
    t1 ='AAAA'. t2 = 2. EXTRACT header.
    t1 ='AABB'. t2 = 1. EXTRACT header.
    t1 ='BBBB'. t2 = 2. EXTRACT header.
    t1 ='BBCC'. t2 = 2. EXTRACT header.
    t1 ='AAAA'. t2 = 1. EXTRACT header.
    t1 ='BBBB'. t2 = 1. EXTRACT header.
    t1 ='AAAA'. t2 = 3. EXTRACT header.
    t1 ='AABB'. t2 = 1. EXTRACT header.
    SORT BY t1 t2.
    LOOP.
      AT FIRST.
        WRITE 'Start of LOOP'.
        ULINE.
      ENDAT.
      AT NEW t1.
        WRITE / '   New T1:'.
      ENDAT.
      AT NEW t2.
        WRITE / '   New T2:'.
      ENDAT.
      WRITE: /14 t1, t2.
      AT END OF t2.
        WRITE / 'End of T2'.
      ENDAT.
      AT END OF t1.
        WRITE / 'End of T1'.
      ENDAT.
      AT LAST.
        ULINE.
      ENDAT.
    ENDLOOP.
    This program creates a sample extract, containing the fields of the header field group only. After the sorting process, the extract dataset has several control breaks for the control levels T1 and T2, which are indicated in the following figure:
    In the LOOP loop, the system displays the contents of the dataset and the control breaks it recognized as follows:
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db9f1f35c111d1829f0000e829fbfe/frameset.htm

  • I just upgraded my iMac to Lion, and a few seconds ago, I upgraded the iWork package and now I'm having some problems with the new version of Pages (4.1) When I try to change something in a document, a message says "the program is not responding"

    I just upgraded my iMac to Lion, and a few seconds ago, I upgraded the iWork package and now I'm having some problems with the new version of Pages (4.1) When I try to change something in a document, a message says "the program is not responding", so I have to force it to close. By the way, the SAVE botton stays the same even I change erverything in my document. Please, a have a work to finish, **** me. What I can do abou it?

    I just upgraded my iMac to Lion, and a few seconds ago, I upgraded the iWork package and now I'm having some problems with the new version of Pages (4.1) When I try to change something in a document, a message says "the program is not responding", so I have to force it to close. By the way, the SAVE botton stays the same even I change erverything in my document. Please, a have a work to finish, **** me. What I can do abou it?

  • Problems with the new iPad and Joikuspot premium after iOS 6

    Hi,
    I'm experiencing serious problems with my new iPad after last iOS update. Usually I was connecting to the internet through Joikuspot premium on Nokia mobile phone (E6). I was able to do everything, https sites surfing, absolutely everything with no exceptions.
    Now, after iOS 6 update, I can't connect to https sites, google+, sync calendar etc.
    I've tried to change connection criteria on joikuspot but nothing. The fact is also that other devices as laptop or other smartphones are still working perfectly, in any case, sharing the wi-fi connection created by joikuspot.
    Finally the problem is 100% due to the iPad and the new iOS.
    disappointing, amateur for such a device... (iPad I mean).
    Any help?
    Many many thanks
    Vittorio

    Ho lo stesso problema, dopo l'aggiornamento a IOS 6 l'ipad non riconosce più il mio nokia N8. Con IOS 5 andava una cannonata...
    vorrei ritornare a IOS 5

  • I am having email problems with the new Lion.  stmp, imap, etc. I have looked up google info and It is confusing when it comes to TS, SSL also, please explain how to set it up so my email goes out and comes in securely.  Help

    I am having email problems with the new Mountain Lion.  stmp, imap, etc. I have looked up google info and It is confusing when it comes to TS, SSL also, please explain how to set it up so my email goes out and comes in securely.  Help
    Incoming Mail (IMAP) Server - requires SSL:
    imap.gmail.com
    Use SSL: Yes
    Port: 993
    Outgoing Mail (SMTP) Server - requires TLS:
    smtp.gmail.com (use authentication)
    Use Authentication: Yes
    Use STARTTLS: Yes (some clients call this SSL)
    Port: 465 or 587
    Account Name:
    your full email address (including @gmail.com) Google Apps users, please enter username@your_domain.com
    Email Address:
    your full Gmail email address ([email protected]) Google Apps users, please enter username@your_domain.com
    Password:
    your Gmail password
    The Quick Answer
    Follow the instructions below to set up IMAP1 access in most email clients.
    Google Apps users, please follow the default instructions unless otherwise noted, replacing 'your_domain.com' with your actual domain2 name.
    this is all greek to me. WHAT IS STARTTLS? On the first page of Apple set up there is a TLS certificate and it is marked NONE- should I change it to the long APPLE CERT option?  The next page under ADVANCED: THERE IS A BOX SSL MARKED.  Then IMAP Path Prefix - I put stmp.gmail.com.. is that right?  Port 993 can  use this one? as 456 doesn't work and 587 said it wasn't safe.  Under AUTHENTICATION I used PASSWORD.  Should I have used external client cert TLS?
    Please help me set this up securely. Thanks

    Apple - Support - Mail Setup Assistant

  • Since the most recent Firefox update 3.6.8 by banking institution no longer shows as having a secure encrypted connection, however, my bank assures me all is well with their certificates and that is a problem with the new Firefox browser update, can you g

    Since the most recent Firefox update 3.6.8 my banking institution no longer shows as having a secure encrypted connection, however, my bank assures me all is well with their certificates and that is a problem with the new Firefox browser update, can you give me some idea why it is doing this?
    == This happened ==
    Every time Firefox opened
    == Right after the new Firefox update

    Hello Anne.
    Can you please try it in a new (temporary) Firefox profile and see if the issue is still present? See [http://support.mozilla.com/en-US/kb/Managing+profiles this article] to know how to create a new Firefox profile. Please report back the results.

  • HT4972 I have an iphone 4 , but it still has the ios 4 , and i want to upgrade it to a newer version , but when I try to do it via  Itunes it says there's a problem with the internet (and the internet it's working fine) and it won't work ,how can i upgrad

    I have an iphone 4 , but it still has the ios 4 , and i want to upgrade it to a newer version , but when I try to do it via  Itunes it says there's a problem with the internet (and the internet it's working fine) and it won't work ,how can i upgrade?

    try rebooting your computer.

  • Having problems with ipad mini and Siri. Works sporadically, will work once and then the second time not. Worked all the time with the original Mailbox app. Then started doing the same thing when I installed the new update so wondering if it is software?

    Having problems with ipad mini and Siri. Works sporadically, will work once and then the second time not. Worked all the time with the original Mailbox app. Then started doing the same thing when I installed the new update so wondering if it is software?

    Hi,
    I have the check box on a second Partition  but not on the Time Machine one
    I forget what I did now to get this called "Recovery HD"
    For the rest try https://discussions.apple.com/docs/DOC-4055  User Tip that links to Pondini's work on Time Machine.
    10:17 pm      Friday; May 2, 2014
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • Problem with this new version is when i open firefox something change my home page to mozila defalut page and in the new tab open mozila firefox first run page.Sorry for my bad English

    Problem with this new version is when i open firefox something change my home page to mozila defalut page and in the new tab open mozila firefox first run page.Sorry for my bad English

    Sounds like this issue:
    * http://kb.mozillazine.org/Preferences_not_saved
    * [[Preferences are not saved]]

  • I have a problem with my motherboard and my battery of my 2010 macbook pro 13". It was just serviced with a new screen, keyboard, and logic board.

    I have a problem with my motherboard and my battery of my 2010 macbook pro 13". It was just serviced with a new screen, keyboard, and logic board. How much will a new battery and motherboard cost and would it be worth it or should I just get a new computer. It was about 300 dollars to get it serviced last week. if it adds up to much past 600 dollars I will just get a new one. THANKS FOR ANY HELP!
    P.S During classes today it began beeping in my bag. Like three kind of long steady beeps then a short pause, and when I opened it I couldn't see anything but it was on so I turned it off and back on.

    Depends on what options your Apple store offers - if they can do a depot repair (where they send it out), that's around $300 for all parts & labor.
    If the store doesn't have that option, a logicboard is around $600, battery $80-$100, from what I've seen.
    If they JUST replaced the logicboard, you absolutely should NOT have to pay for another replacement - the replacement is covered by a warranty. If they want you to pay for it, make sure you have a copy of the receipt for the work that was recently completed so you can show it to them. They have no reason to charge you for another logicboard.
    ~Lyssa

  • I am having problems with my new ipad that i got for Christmas today, i don't get free wi-fi at my home and it said if the wi-fi is not available, connect to itunes. i have done that and it didnt help me. mind helping me out?

    i am having problems with my new ipad that i got for Christmas today, i don't get free wi-fi at my home and it said if the wi-fi is not available, connect to itunes. i have done that and it didnt help me. mind helping me out?

    Further info - I changed my security settings to allow apps from anywhere, and again tried to install.  I again got an error message
    that the update failed to install, and to contact Customer Support.

  • Boot Camp problems with Windows 7, and a new Macbook Pro

    When I try to install Windows 7, when the process is almost complete and Windows is finalizing all settings, the system reboots then gets stuck at the white/gray bootscreen, and then tries to boot from disk, only to repeat the bootscreen cycle indefinitely. How do I fix this? Thank you very much.

    My MAC BOOK is 13 inch, first generation of unibody that I bought when it first came out last November, 2009. It seems that the latest boot camp 3.1 does not support windows7 64 bits on my mac book model. I followed Apple instruction to upgrade boot camp 3.0 when running XP 32 bits. And I then upgrade my XP 32 bits to 64 bit Windows 7. The upgrade/installation was successful but I encountered a lot of problems with the mouse and sound.
    1. No sound with my new Windows 7 64 bits.
    2. I managed to make Windows 7 64 bit recognize my apple mighty mouse. But the mouse does not funtion normal as expected. It does not work with swiping and scrolling.
    3. I could not re-install boot camp 3.0 from windows.old nor from the Mac OS X installation disk. When I tried to run setup.exe from the MAC OS X snow leopard, I got the error "Boot camp x64 is unsupported for this model"
    I am really disappointed that boot camp 3.1 is not universally supported for all mac book or mac book pro.
    I need help to re-install boot camp for my Windows 7? I bought the upgrade through education upgrade program and I selected to get 64 bit version so I do not want to rollback the installation to 32 bit.
    Please help.

Maybe you are looking for

  • Access to ITunes Home Page and Music Stores in Other Countries

    In the past two days, I haven't been able to access any other ITunes music store except the US and only when I press music and not the little house (home) symbol. As I am an independent musician and my tracks sell on ITunes in US and abroad, I've bee

  • Counting files in a Flder

    Hi all, I have to count the number of files in a folder and their respectives name in it using flash.Is it possible to do it by JSFL. can anyone give me samples regarding this.thanks in advance. Regards, S.Hidayath

  • HP Notebook breakdown/ Ask for recovery / Error code 0xc0000034 HELP

    Hello, Last week my PC broke down after I turned it off manually. Since then, when I turn it on I fell directly on the 'Recovery' blue page. Saying 'Your PC need to be repaired. The Boot configuration data file is missing some required information...

  • Validation Errors on TabPanel - How do I show them to user?

    I have a tabbed panel on one of my JSF pages with required=true validation on field on tabs other than the first tab. When the user does not fill in those required fields on tabs other than the first one, those field level error messages are not show

  • Office 365 in education

    Hi, My wife is the assistant head for a primary school and she is wanting to move towards Office 365 so they can benefit from using Lync, SharePoint sites and personal profiles and collaborating with other schools.  I'm looking at possibly doing the