What's the best way to collect internal table?

Hi,
I have an internal table, the fields are:
  Key1, key2, key3, qty1, qty2, qty3
I want to collect the field "qty3" based on the key fields: "key1 + key2 + key3".
What's the most efficient way to collect the internal table?
Thanks.

Hi Ren,
You can code something like this with COLLECT statement.
DATA: BEGIN OF ITAB OCCURS 0,
        KEY1 TYPE TABLE1-FIELD1,
        KEY2 TYPE TABLE1-FIELD2,
        KEY3 TYPE TABLE1-FIELD3,
        QTY1 TYPE TABLE2-QTY1,
        QTY2 TYPE TABLE2-QTY2,
        QTY3 TYPE TABLE2-QTY3.
DATA: END OF ITAB.
DATA: BEGIN OF ITAB2 OCCURS 0,
        KEY1 TYPE TABLE1-FIELD1,
        KEY2 TYPE TABLE1-FIELD2,
        KEY3 TYPE TABLE1-FIELD3,
        QTY3 TYPE TABLE2-QTY3.
DATA: END OF ITAB2.
SORT ITAB.
LOOP AT ITAB.
  MOVE-CORRESPONDING ITAB TO ITAB2.
  COLLECT ITAB2.
ENDLOOP.
LOOP AT ITAB2.
  WRITE: /01 ITAB2-KEY1, ITAB2-KEY2, ITAB2-KEY3,
             ITAB3-QTY3.
ENDLOOP.
Hope this will help and give an idea.
Regards,
Ferry Lianto
Please reward points if helpful.

Similar Messages

  • What is the best way to dynamically create table partition by year and month based on a date column?

    Hi,
    I have a huge table and it will keep growing. I have a date column in this table and thought of partition the table by year and month. Can any you suggest better approach so that partition will create automatically for new data also along with the existing
    data? Nothing but automatically/dynamically partition should create along with file group and partition files.
    Thanks in advance!
    Palash 

    Also this one
    http://weblogs.sqlteam.com/dang/archive/2008/08/30/Sliding-Window-Table-Partitioning.aspx
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • What is the best way to move an iPhoto library from one internal drive to another internal drive?

    the drive where my iPhoto library is store is just about full.  I have a second internal SSD that I'd like to move (not copy) the library to.  What is the best way to do that and still ensure that iPhoto will access the library in its new location?

    Just drag the iPhoto Library package from the one drive to the second disk.  Launch iPhoto with the Option key held down and select the library in it's new location on the second disk.  Once you're satisfied that it is working satisfactorliy you can delete the copy on the first disk.
    OT

  • What is the best way to sync multiple collections of contacts among multiple users?

    (I originally submitted this question under the "Mac OS X Technologies" section, but got no response. I'm submitting a duplicate here because this is where all the smart folks are! My apologies that my question is only partially related to OS X Server . . . )
    What is the best way to sync multiple collections of contacts among multiple users on iOS and OS X?
    For example, suppose I have three collections of contacts: Bob's, Sally's, and Common. I want Bob to be able to access and sync Bob's contacts and Common contacts, and Sally to access and sync Sally's contacts and Common contacts. Bob and Sally never need to access or sync each other's contacts. Bob and Sally would both sync and share contacts in Common.
    How would I best implement this? It's my understanding I have three options for managing contacts across iOS and OS X: 1. iCloud accounts, 2. Install OS X server, or 3. Install and manage Darwin CardDAV directly. Which method would best support what I wish to do?
    I am a seasoned Unix geek well versed in the terminal, so I am prepared to get my hands dirty as much as necessary to achieve what I want. Also, it is sufficient if syncing takes place over WiFi on the local network, in fact, that is desirable versus syncing over the cloud.

    Thanks for your reply Nick101. I see my example was oversimplified. When I say "multiple groups of contacts over multiple users" I'm really referring to N groups of contacts over N users.
    So I need to add Fred, who can access and sync Bob's contacts, Sally's contacts, and Common contacts, as well as Fred's contacts. Can I do it with OS X server?
    You mention you keep your and your partner's contacts administered locally. What keeps you from administering them through OS X server as well?
    I am guessing this can all somehow be accomplished with multiple contact accounts, but I can't find any information on the web explicitly describing this.

  • What is the best way to declare field length 500 in internal table?

    Hi all,
    what is the best way to declare field length 500(constant value allways) in internal table?
    I am trying to send data from internal table to file format, and I have a field in internal table with 500 length (constant value always). So how do I can declare and append this field value to table?
    Thanks
    Murali

    Hi.  Please see the following example program, notice how I am filling the field with the constant value.
    report zrich_0001.
    *       CLASS lcl_main DEFINITION
    class lcl_main definition.
      public section.
        types: begin of ttab,
                fld1(500) type c,
               end of ttab.
        data: itab type table of ttab.
        data: xtab type ttab.
        methods: constructor,
                 write_itab.
    endclass.
    *       CLASS lcl_main IMPLEMENTATION
    class lcl_main implementation.
      method constructor.
    <b>
        xtab-fld1 =
          'This is one part of the total string which needs to be really' &
          ' long and this is a constant and we need to move it to a work' &
             ' area and then append it to the internal table which has a' &
              ' field with a length of five hundred characters'.
        append xtab to itab.</b>
      endmethod.
      method write_itab.
        loop at itab into xtab.
          write:/ xtab-fld1.
        endloop.
      endmethod.
    endclass.
    data: o_main type ref to lcl_main.
    start-of-selection.
      create object o_main.
      call method o_main->write_itab.
    Regards,
    Rich Heilman

  • What is the best way to handle collections that contains different object

    Hi
    Suppose i have two class as below
    class Parent {
           private String name;
    class Child extends Parent {
          private int childAge;
    }I have a list that can contains both Child and Parent Object but in my jsp i want to display a childAge attribute ( preferrably not to use scriplet )
    what is the best way to achieve this?

    Having a collection containing different object types is already a bad start.
    How are parent and child related to each other? Shouldn't Child be a property of Parent?
    E.g.public class Parent {
        private Child child;
    }In any way, you could in theory just check Object#getClass()#getName(), but this is a nasty design.

  • What is the best way to delete folders and collections from Library?

    I have approximately 500 photographs in folders and collections. Want to delete them and start over. What is the best way to go back to Lightroom 5 cc as it was when initially downloaded?
    Using Mac running Maverick.
    Thanks for your help

    File>New Catalog and start over.
    The 500 images will stay put where they are and you can choose to import them again into the pristine catalog.

  • What is the best way is to create a web app item collection which will contain only the listings where addressstate="ABC".

    What is the best way is to create a web app item collection which will contain only the listings where addressstate="ABC".

    How many systems have you used Robert?
    This is the only system you can not have all item data at least in JSON format and all of it. Big commerce has a lower limit and as I have said in every post related to a limit - I understand the function, but you can still make the requests as just one example (front and back)
    Same with API Robert.
    Firstly - the SOAP API request on say products gets you ALL the products, if you do something through a REST API request you can  make the requests to get all the items to complete your process of what your doing - You have to otherwise the API is pointless.
    Ok if the normal modules can not iterate through if there is a module_data solution, and web apps will get there hopefully sooner then later and you do have the sql query (where) for your filter which is great BUT, if you want to implement a solution across everything you cant do that with the liquid implementation.
    This also flows through to the JSON everywhere in concept which is fundamentally flawed for the same reason... And again referring other like services where a hard API has a limit but the JSON request returns everything.
    How those work varies from the method of request, some will only update every day, xxx time (Depending on cost of the plan) so its a cached version of data, to the ones that limit that request to x number of times per set time/day.
    That is how the actual rest of the world works, varied solutions but they are solutions. BC know they have a few limitations, there clearly is the need for things, there are a varied set of options... It is just a matter of engaging in it and offering up a solution for it, silence just creates frustration.

  • There are way too many photos on my internal hard drive. I have older libraries, and newer libraires in iPhoto and Aperture 2.  What is the best way to find and reduce the number of duplicate photos/libraries  before upgrading to Aperture 3?

    There are way too many photos on my internal hard drive. I have older libraries, and newer libraires in iPhoto and Aperture 2.  What is the best way to find and reduce the number of duplicate photos/libraries  before upgrading to Aperture 3?

    Sharon-
    Good idea.
    Back up first.
    I would probably wait for the merge function of the latest version before merging. Be sure to verify every merge.
    Merge Libraries, then from within Aperture move images to referenced on external hard drives.
    HTH
    -Allen

  • I have 21,000  photos stored in iphoto. I have a WD 1.5TB backup external hard drive.  What is the best way to erase about half of my photos on my internal hard drive?

    I have 21,000  photos stored in iphoto. I have a WD 1.5TB backup external hard drive.  What is the best way to erase about half of my photos on my internal hard drive?

    Here's one way to do what you want:
    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    Now you have two full versions of the Library.
    3. On the Internal library, trash the Events you don't want there
    Now you have a full copy of the Library on the External and a smaller subset on the Internal
    Some Notes:
    As a general rule: when deleting photos do them in batches of about 100 at a time. iPhoto can baulk at trashing large numbers at one go.
    You can choose which Library to open: Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Choose Library'
    You can keep the Library on the external updated with new imports using iPhoto Library Manager

  • What is the best way to make  certain cost centers as REQUIRING an internal

    Hello,
    What is the best way to make  certain cost centers as REQUIRING an internal order (when entering invoices in the accounts payable module u2013 transaction code FB60). At the present, if a cost center requires an internal order, and the employee who is  is entering the invoice in FB60 forgets to include the Internal Order, the invoice is incorrectly costed.
    Regards,
    Saeed

    Hai !!!
    The below method can solve your problem
    1.Create Internal order for each cost center from transaction code KO01 - Create and  enter the cost center under Requesting  CCtr
    2. Enter internal order or costcenter / while user post the transaction
        Example Fb60
    Regards
    shamul heq

  • Collecting Form Data - what's the best way?

    Hi,
    I'm setting up a new website and will need to collect data from subscribers. I understand that you can use Acrobat to manage the whole process - from design to data collection. I've tried emailing forms to myself, but these come down as xml files and have to be converted into excel - very time consuming and fiddly, so not the best way of collecting the data. So, what's the quickest and best way, and why isn't this made clearer by the LiveCycle Designer programme? Cheers in advance!

    Emailing is certainly not the right way to go. Think of the email
    submission as a toy for testing with.
    Like any other web site form, you should submit to a web script (ASP,
    CGI, PHP, etc.). This can run a program which is sent the XML; parse
    the XML; put it in a database.
    Aandi Inston

  • What is the best way to get the end of record from internal table?

    Hi,
    what is the best way to get the latest year and month ?
    the end of record(KD00011001H 1110 2007  11)
    Not KE00012002H, KA00012003H
    any function for MBEWH table ?
    MATNR                 BWKEY      LFGJA LFMON
    ========================================
    KE00012002H        1210             2005  12
    KE00012002H        1210             2006  12
    KA00012003H        1000             2006  12
    KD00011001H        1110             2005  12
    KD00011001H        1110             2006  12
    KD00011001H        1110             2007  05
    KD00011001H        1110             2007  08
    KD00011001H        1110             2007  09
    KD00011001H        1110             2007  10
    KD00011001H        1110             2007  11
    thank you
    dennis
    Edited by: ogawa Dennis on Jan 2, 2008 1:28 AM
    Edited by: ogawa Dennis on Jan 2, 2008 1:33 AM

    Hi dennis,
    you can try this:
    Sort <your internal_table MBEWH> BY lfgja DESCENDING lfmon DESCENDING.
    Thanks
    William Wilstroth

  • What's the best way to back up laptop?

    Hi all,
    This is probably a dumb question, but I'm going to ask it anyway. What's the best way to back up a laptop: hooking up a hard drive manually, or via WiFi?
    In the past, I've just hooked up a hard drive to my MacBook Pro, and manually synced it with Time Machine. But, of course, sometimes I'm busy and I don't get around to doing that as faithfully as I should. So, I'm thinking of hooking up a hard drive to my AirPort so that my laptop will automatically sync over WiFi whenever I'm home.
    Before I do that, however, two questions:
    1) Is that easier to do than the way I'm currently backing up? Or are there problems with that route that I'm not foreseeing right now? How do you all back up your laptops?
    2) I also have a Mac Pro on my network at home. Will I have a problem with my Mac Pro seeing the WiFi "Time Machine" hard drive and wanting to back up to it, rather than the Time Machine hard drive I already have physically hooked up to it?
    Thanks for your advice!

    learn about backups VS. archives, and data protection:
    Methodology to protect your data. Backups vs. Archives. Long-term data protection
    excerpt:
    Four words: "compartmentalized autonomous redundancy of data" or C.A.R.D. What this means regarding your data is “centralize it, isolate it, and multiply it”. This easy acronym to remember about how to approach your data is a great first approach to keep in mind.
    Compartmentalized: separating out your data from your system files, centralizing all static and active files into a location or two to make backups, and archived data easier to update and locate. Centralizing your data collection is the primary hazard to overcome for what usually is the case of data that is scattered everywhere throughout your internal hard drive.
    Autonomous: Isolation of data from changes, theft, decentralizing data to safes, fire boxes, offsite and online locations. Importantly ‘freezing’ data onto independent storage media for protection and from alterations, such as DVDs, hard drives, and online encrypted files, or .DMG created files of static data collections.
    Redundancy: making copies of all autonomous isolated data such that data is decentralized not only in place and in media storage type (DVD, HD, online) for safety and protection as a failsafe, but each aspect of that failsafe has at the very least two redundant copies.
    Data: all files made, saved, created, modified or working on. Important pictures, documents, videos, PDF, financial, personal. Any data large or small which you would not dare lose, which is private, important, hard or impossible to recreate, or most importantly, would take tremendous time to regenerate. Essentially anything important to you, your company, your loved ones (will, medical records, financial information, etc.), friends or otherwise.

  • I have two users on the same MAC and want to have separate ITunes libraries stored on my time capsule.  what's the best way to ensure that is done?

    I have 2 users on a MAC each with separate accounts (email, photo, ITunes) and I want to migrate my ITUnes Library over to a time capsule so that each usewr still has their own library bu don't want to duplicate songs.  What is the best way to have both Itunes pointed to separate libraries both stored on the Time Capsule?

    A bit of basics on iTunes.  iTunes does 99% of what you see through a library.itl file in the iTunes folder.  This file is a database and in it are references to the actual media files.  These files can be anywhere in theory, but if you have iTunes set to default then they are nicely organized in media folders in the iTunes folder.  You have probably moved them to some central shared location in the past, then built up two individual libraries around that central location.
    iTunes is very fussy about a person dragging files to a different location, and that goes double if the other location is on a different drive.  You can move files, but it is best to let iTunes do it so it can keep track.  If this was just for one person I'd say go into preferences, select the other drive for media location, then close preferences. My understanding (never done this before) is iTunes will then ask you if you want to move your media.  Say yes and iTunes will move it and keep track of it -- for your library.  Now when you go to the other person's library, it opens and you see loads of ! because their library is still looking for the media on the same  drive as the library is located on.  I don't think it will work (but you could always try) to re-assign the media location to the external drive because the reference in the database is to look for such-and-such a file on the internal drive.  iTunes did that for the first library as part of the move, but not for the second one.  Note that typically when you want to move a single user's collection from drive to drive we advise moving the whole iTunes folder, library files and all, to another drive, but you don't have that structure.
    So I'm not sure what to advise.  If it were me and I was absolutely gung-ho on doing this I would re-assign the media with one library.  Then edit the .xml version of the library file for the second library so it points to the new file locations and import this into a fresh iTunes library for the second user.  This isn't the perfect solution because nominally the .xml version does not 1005 replicate all the characteristics of the original .itl file (which cannot be edited).
    Or maybe some other user bas a better idea.

Maybe you are looking for

  • What is the HP part number for the power adapter shipped with the dv7-6b32us​?

    I would like to know what is the exact HP part number for the 90w power supply that is shipped in the box with the DV7-6B32US?

  • Ipod cannot synchronise

    Hey, I just bought an iPod 30g and I had nothing but trouble. First I had iTunes 7.0 wich said there was an unknown error (-50) and i could not synchronise (or something). Now I have itunes 7.2 which says: The ipod can not be syncronised, the disk ca

  • Import into SLD does not work

    Hi to all, I want to synchronize the central sld of our production XI with the backup from the test sld, like in note 935474 grouping sld instances described. Import of CIM model works, import of backup of sld doesn't work. It is impossible to import

  • DI: Problem in Creating a Credit Memo

    The problem is when i want to create an a/r credit memo  based in an invoice of a customer with multycurrency with sdk i got an error "-5002 invalid currency code [orin.doccur], ‘mxp’. " This error only ocurred with a customer with multycurrency I ap

  • Sapscript problem assignment

    hi all.,     i have a problem with form assignment,i have made complete print program for order quotation and layout. but when i execute from se 38 editor i get the selection screen and after giving the order number i am able to view the output layou