Group by  please help

Dear All,
I am tryinf group by in my select statement which is not working . please correct the code.
thanks
Vinayak
tables : ekko,ekpo,lfa1.
data : begin of itab occurs 0,
         ebeln like ekko-ebeln,
         bedat like ekko-bedat,
         lifnr like ekko-lifnr,
         netwr like ekpo-netwr,
         name1 like lfa1-name1,
         count type i,
      end of itab.
select-options: s_bedat for ekko-bedat.
select aebeln alifnr abedat sum( bnetwr )
    into corresponding fields of itab
    from ekko as a inner join ekpo as b on bebeln = aebeln
     where abedat in s_bedat group by aebeln alifnr abedat.
    select single name1 from lfa1 into itab-name1
       where lifnr = itab-lifnr.
append itab.
endselect.
endselect.
loop at itab.
on change of itab-lifnr.
  skip.
  write :/ itab-lifnr, itab-name1.
endon.
write :/ itab-ebeln, itab-bedat,itab-netwr.
endloop.

See my comments below.
> Dear All,
>
> I am tryinf group by in my select statement which is
> not working . please correct the code.
> thanks
> Vinayak
> tables : ekko,ekpo,lfa1.
You do not need any tables statement. Just leave it away
>
> data : begin of itab occurs 0,
>          ebeln like ekko-ebeln,
>          bedat like ekko-bedat,
>          lifnr like ekko-lifnr,
>          netwr like ekpo-netwr,
>          name1 like lfa1-name1,
>          count type i,
>       end of itab.
personally I do not like the declaration of table with
header lines and occurs and I did not figure out what you want to do with the count column in your internal table
>
> select-options: s_bedat for ekko-bedat.
>
> select aebeln alifnr abedat sum( bnetwr )
>     into corresponding fields of itab
> from ekko as a inner join ekpo as b on b~ebeln =
> ln = a~ebeln
> where abedat in s_bedat group by aebeln
> ebeln alifnr abedat.
>
>     select single name1 from lfa1 into itab-name1
>        where lifnr = itab-lifnr.
> append itab.
> endselect.
> endselect.
There are tons of threads here advising not to use nested selects - in this case you could read the name of lfa1 right before you write it.
select aebeln alifnr abedat sum( bnetwr )
     into table itab
from ekko as a inner join ekpo as b
              on bebeln =   aebeln
where abedat in s_bedat group by aebeln
ebeln alifnr abedat.
should work
(corresponding is not necessary but would not work, unless you do not use " sum( b~netwr ) as netwr ".
make sure to sort the table before loop over it
> loop at itab.
>
> on change of itab-lifnr.
>   skip.
here you could read your name if you must.
select single name1 from lfa1 into itab-name1
        where lifnr = itab-lifnr.
>   write :/ itab-lifnr, itab-name1.
> endon.
> write :/ itab-ebeln, itab-bedat,itab-netwr.
> endloop.
HTH Christian

Similar Messages

  • Trying to download latest iTunes, but I keep getting "The older version of Apple Software Update cannot be removed.  Contact your technical support group."  Please help.

    Please help.  I am trying to download the latest version of iTunes so I can synch my new iPhone.  I keep getting "The older version of Apple Software Update cannot be removed.  Contact your technical support group."  Please help as I have absolutely no idea.  Thanks.

    Download the Windows Installer CleanUp utility from the following page (use one of the links under the thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    To install the utility, doubleclick the msicuu2.exe file you downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any Apple Software Update entries and click "Remove", as per the following screenshot:
    Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • Help! Why can't I send to a group? Please help!

    When I try to send an email to a group, with the individual addresses hidden (set in preferences), I get the following error message:
    *This message could not be delivered and will remain in your Outbox until it can be delivered.*
    *Sending the message content to the server failed.*
    But when I send to the same group with the addresses showing, it works fine.
    I want to hide the addresses. What can I do? Why is it not working?
    Thank you.

    please do not repost a discussion 45 minutes after starting an earlier one on the same topic.
    http://discussions.apple.com/message.jspa?messageID=5485165#5485165
    If someone has a suggestion they will post it in time. Please be patient.

  • Can't join group calls, please help.

    The subject, whenever I try to join group calls I get my friends' names, profile pictures, and a loading/connecting sort of animation shown in the attachment, and then I don't even join the call, it just closes and skype stops showing the people in the call. I can call my friends individually just fine, but whenever I try to join the group call, it doesn't even let me in for a second.
    Attachments:
    ss (2014-07-22 at 04.40.17).jpg ‏1 KB

    Nice how this was already known 5 months ago (and maybe more, I didn't search)
    community.skype.com/t5/Windows-desktop-client/Skyp​e-does-not-want-to-join-group-calls-at-all/m-p/396​...
    AND YOU DIDN'T MOVE A FINGER TO FIX THIS FU CKING ANNOYING BUG.
    As I've said in that post, your ridiculous fix didn't work, and I have to ask call creator to close call for everyone and create a new one everytime I need to rejoin it.
    Do the work you're paid for, please.

  • How do I delete all my contact groups? Please help me!

    I have deleted all my contacts so I can start fresh- there were so many mistakes. How do I delete the contact groups on my IPhone and the "selected groups" in ITunes under sync contacts with Outlook.

    I take it you want to delete the itunes list and not from your hard drive.
    Select one song in the list, hold down the ctrl + A to select them all (or you can go to viwe on the menu and selcet all. Press the delete key. It might ask you if you want to keep the actual files or send them to the recycle bin. This is your choice, be careful though.
    If your recycle bin is set to only hold a certain amount of data and your mucic exceeds this amount you may not be able to recover it all if you make a mistake.

  • Can't group text or send/receive picture messages! Please Help!

    Hell Everyone,
    so I just recently switched from my Iphone back to my blackberry for simplicity/practical reasons...I couldn't deal with the iphone anymore. In doing so, I came across a problem. I am not able to send group texts or send/receive mms. Everytime I try to do so, the text has a red 'X' next to it showing that it didn't go through. I am currently with ATT and have tried calling them to resolve it but no one knows.
    here are some of the steps I took to resolve it
    1. Resetted to Factory Settings - Did not work
    2. Made sure all the settings in my text message options is selected properly - Did not work
    3. Deactivated iCloud/iMessage on my previous iPhone - Did not work
    4. Called ATT and had them make sure BB Data plan was on my plan, and it was - Did not work
    Can someone please help?
    Thank you,
    Pogos

    Hi and Welcome to the Community!
    With a strong carrier network signal (e.g., not merely WiFi), I suggest the following steps, in order, even if they seem redundant to what you have already tried (steps 1 and 2 each should result in a message coming to your BB...please wait for that before proceeding to the next step):
    1) Register HRT
    KB00510 How to register a BlackBerry smartphone with the wireless network
    Please wait for one "registration" message to arrive to your Messages app
    2) Resend Service Books
    KB02830 Send the service books for the BlackBerry Internet Service
    Please wait for "Activation" Messages, one per already configured email account, to arrive in your Messages. If you have no already configured email accounts, please wait 1 hour.
    3) Reboot
    With power ON, remove the back cover and pull out the battery. Wait about a minute then replace the battery and cover. Power up and wait patiently through the long reboot -- ~5 minutes.
    See if things have returned to good operation. Like all computing devices, BB's suffer from memory leaks and such...with a hard reboot being the best cure.
    Hopefully that will get things going again for you! If not, then you should re-contact your mobile service provider for formal support...be sure to request their dedicated BB support group. MMS is a specific service level that must be properly enabled on BBs in order to function. Often, the first support group you reach will not understand the proper method for configuring this on BB...but their dedicated BB support group will.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Search criteria is not working in Responsible Group field in sap crm could you please help me this how to achieve.

    search criteria is not working in Responsible Group field in sap crm could you please help me this how to achieve.I have writen code on EH_ONSEARCH .as per below...what changess i need to do..and through partner function and adding the selection params please send the sample .
    code. partner funtction - ZRG DATA :
    DATA : lv_partner_fct type .
    types: begin of ty_resp,
           partner    type but000-partner,
           name_last  type but000-name_last,
           name_first type but000-name_first,
           mc_name1   type but000-mc_name1,
           mc_name2   type but000-mc_name2,
           end of ty_resp.
    DATA: lv_resp_bp type STANDARD TABLE OF ty_resp INITIAL SIZE 0,
           lw_resp_bp type ty_resp.
    IF lv_attr_name = 'Rgroup'.
    lr_entity->get_property_as_value( EXPORTING iv_attr_name = if_crm_srqm_uiu_const=>gc_attr_low
                                       IMPORTING ev_result = lv_low ).
    IF lv_low IS INITIAL.
    SELECT partner
           name_last
           name_first
           mc_name1
          mc_name2
    FROM but000 INTO table lv_resp_bp
    WHERE mc_name2 = lv_low and bu_group = '0010'.
    loop at lv_resp_bp into lw_resp_bp.
        lv_low = lw_resp_bp-mc_name2.
      lr_query_service2->add_selection_param( iv_attr_name = 'Rgroup'
                                                iv_sign = lv_sign
                                                iv_option = lv_option
                                                iv_low = lv_low
                                                iv_high = lv_high ).
      ENDLOOP.
    if lv_partner_fct = 'ZRG'.
      lr_entity = lr_iterator->get_next( ).
    CONTINUE.
    ENDIF.
    lv_attr_name = 'BU_PARTNER'.
    ENDIF.

    <b>You can acheive   this .... first by creating the search help exit    ... by  creating the maintaince  view   then   using it in the   Creation of the search help </b> ...
    see the link for attaching the view   to the serach help .
    <a href="http://">http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_elementary.htm</a>
    reward  points if it is usefull...
    Girish

  • Please help me how to check a material does existed group code in system (w

    Hi all,
    Please help me...
    I have inputted quantity for  tx MC 94  but when I input them into  tx MC94, I met  a message " Structure  not yet maintained for  this conbination characterstics". Step by step to show a error message as below:
    Step 1: Launch MC 94
    step 2: Enter Planning
    Step 3: Enter  Prod.Code. Material (ex: enter material code :0101010260008, this code is existed  Prod.Code )
    Step 4: Click on "Inactive Version " button
    ==> A error message is showed.
    Please help me how to check a material does existed group code in system (which table to  check  it)?
    How to record the message" Structure  not yet maintained for  this conbination characterstics" to catch up it in my program?
    Thank in advance.

    Karenloria,
    1. Check in MC8C, which Infostructure is used for Planning type "Planning" or the one you are entering in the intial screen of MC94.
    2. Using transaction MC63 for the infostructure identified in step 1, check the planning hierarchy maintained. If this product is not maintined maintain using MC62.
    You can also check using SE16 transction the current infostructe records(Plan) for the table name = infostructure identified in step 1.
    Regards,
    Prasobh

  • Please help with assigning user to a group in AD using dbms_ldap

    Dear gurus of Apex and LDAP!
    Please help me a bit.
    I managed to create any user in AD from Apex using dbms_ldap package and set many of his attributes. But I cannot set that my user belongs to specific group, let's say MY_GROUP. I guess the name of attribute for group is 'member' or 'memberOf', so I tried them both in the same way as I've done for other attributes:
    v_vals(1) := 'MY_GROUP';
    DBMS_LDAP.populate_mod_array(v_array, DBMS_LDAP.MOD_ADD, 'member', v_vals);
    I've got LDAP client/server error: CONSTRAINT violation. 000020B5: AtrErr: DSID-031516FC, #1: 0: 000020B5:
    DSID-031516FC, problem 1005 (CONSTRAINT_ATT_TYPE), DATA 0, Att 1f (MEMBER)
    v_vals(1) := 'MY_GROUP';
    DBMS_LDAP.populate_mod_array(v_array, DBMS_LDAP.MOD_ADD, 'memberOf', v_vals);
    I've got LDAP client/server error: DSA IS unwilling TO perform. 0000209A: SvcErr: DSID-031A0929, problem 5003 (WILL_NOT_PERFORM), DATA 0
    After that I've tried to extend group name to string, which is shown in LDAP browser for attribute 'memberOf' (when I've added it manualy):
    v_vals(1) := 'CN=MY_GROUP,OU=GROUPS,OU=Allianz,DC=allianz,DC=com';
    DBMS_LDAP.populate_mod_array(v_array, DBMS_LDAP.MOD_ADD, 'member', v_vals);
    I've got LDAP client/server error: OBJECT CLASS violation. 0000207D: UpdErr: DSID-03150913, problem 6002 (OBJ_CLASS_VIOLATION), DATA 0
    v_vals(1) := 'CN=MY_GROUP,OU=GROUPS,OU=Allianz,DC=allianz,DC=com';
    DBMS_LDAP.populate_mod_array(v_array, DBMS_LDAP.MOD_ADD, 'memberOf', v_vals);
    LDAP client/server error: DSA IS unwilling TO perform. 0000209A: SvcErr: DSID-031A0929, problem 5003 (WILL_NOT_PERFORM), DATA 0
    I've also tried some other variants (without 'CN=' and without 'OU=GROUPS,OU=Allianz'), but still no success.
    Search of this forum and even google didn't help either :(
    Please, help me to find the correct syntax for it or tell me if it's not possible.
    Thanx in advance,
    Vladimir

    Vladimir ,
    firstly the attributes member and memberOf are special attributes in AD having a set of predefined values. Hence an error will be thrown if you try to assign them values like 'MY_GROUP'. There are two basic solutions to this problem : Either you define an OU in your AD which will act as your 'MY_GROUP'. This is a quick fix solution and is not robust at all. The other solution is to add your own property in the tree , something like 'roleCode', you can then assign it any value you want.
    But the problem now is, AD does not allow addition of new attributes in the structure. You have to use ADAM in for this and you can specify a common linking mechanism between AD and ADAM now such as email address can act as the link between both the directories.
    Hope this helps
    Shantanu

  • Is there anyway to turn off the Group MMS texting?  I want to send a mass text but don't want every person to see every other person's response. Please help!

    Is there anyway to turn off the Group MMS texting?  I want to send a mass text but don't want every person to see every other person's response. I am getting ready to have a baby and want to send one text out to friends and family when the baby comes BUT I don't want all of those people to receive the responses.  Can I turn it off temporarily?  Please help!

    Settings > Messages > Group Messaging > Off

  • Please Help, After Kernel panic restart failed- apple swirl(6 hrs), SafeMode-failed, SUMode-sucess. Could not unmount disk to erase. Repair permissions-multiple fail errors:unable to set permissions on... unable to set owner and group...

    Please Help, I deleted an account that was the same name as the administrator but was not the administrator. Also a samsung galaxy s phone was charging through the usb port.
    I closed out a program and got a message that the temp file could not be stored/saved.
    Then a Kernel panic message occurred and restart was necessary.
    The restart resulted in the screen with the apple logo and a continous swirl for 6+hrs,
    Attempted Safe Mode start up, unsuccessful,
    Single User Mode-sucess.
    Ran $ fsck_hfs -rfd /dev/disk0s2 Ran several times repairs made with one which remained. something about a node.
    No change in start up attempts
    Started with install CD matching current OS 10.6
    Ran Disk Utility Repair Permissions resulting in multiple errors:
    One line/error
    Warning: SUID file /////Ardagent has been modified and will not be repaired
    144 lines/errors of this type of series of lines
    Group permissions differ on...should be drwxr-xr-x, they are -rw-r--r-- .
    permissions differ on...should be drwxr-xr-x, they are -rw-r--r-- .
    unable to set owner and group...error 22: Invalid Argument
    unable to set permissions on...error 22: Invalid Argument
    Ran Repair Disk, result:
    Error: Could not unmount disk (in red)
    Ran Verify Disk, result:
    The volume HD appears to be ok (in green)
    Next I attempted to erase the dist to start from scratch since I have data backed up on time machine.
    Error message box
    Volume Erase failed
    Volume Erase failed with error:
    Could not unmount disk
    I am looking to solve without buying DiskWarrior unless only resort.

    So it looks like  solved it for now I will update later. What I did was after starting from the install cd for the 10.6 system I ran from terminal ran:
    diskutil disablejournaling /dev/disk0s2
    diskutil disableownership /dev/disk0s2
    diskutil repairPermissions /dev/disk0s2
    then i closed terminal and then when to disk utility and chose to repair disk with results all was fine. Then ran repair permissions and got similar results from terminal function next I erased disk and then chose to restore from time machine and it is now restoring! yea!

  • I upgraded to mountain lion a week ago and now on startup of my macbook pro, microsoft excel and word start up automatically and then crash? very strange can anyone please help? I have checked the login items under users and groups and there is nothing.

    I upgraded to mountain lion a week ago and now on startup of my macbook pro, microsoft excel and word start up automatically and then crash? very strange can anyone please help? I have checked the login items under users and groups and there is nothing.

    Are you using the Office for Mac 2011 version, as you need to do?  The Office for Mac 2004 is Not at all compatible with Mountain Lion, and the 2008 version has been noted to have some problems running with ML.
    Hope this helps

  • Group values on Barchart - Please help Urgent

    Hi
    I am plotting a bar chart.
    I am plotting chart "on change of" first group name.and showing 3 values which i get in formulas.
    I had to place these formulas in lowest level of subgroup just above the details ( i don`t need any details).
    i am getting all the values properly.
    But it is plotting the graph with group A values as group B values.
    In other words,
    on starting group all the 3 values will be zeros.By the end of this group (after details) i will get 3 values.
    I want to plot chart with these values as starting group values.
    But as took "on change of" group name it is plotting zeros initially and the result of group A  as the result of Group B and so on.
    Please help me how can i plot chart after a group is evaluated.
    I placed my chart in report header
    Please help me .
    Haima.

    Hi
    I am using bar Chart ( side by side bar chart).
    This time i would like to explain in more detailed.Please find my layout and preview as pictures in the following links.
    [http://i34.tinypic.com/2wc48w9.jpg]
    [http://i33.tinypic.com/2603ern.jpg]
    I want show msx3 in the bar chart .so first i initialized it to zero and counted all the records which suits my criteria and showing the same value in the bar against that group.( i am explaining with one formula msx3 only..anyway remaining are similar).
    This value is initially zero and will give a count number at the end of this Group #1 Name ( plz see pictures).
    My problem is i have take "On change of" Group# 1 Name in the data of chart expert and showing the formulas ( with don`t Summarize  option checked).
    It is giving me the result properly but plotting the values of first iteration ( when the first time the group is evaluated) ans result of second iteration.I understand this is because of "on change of " option ,when it is plotting all the values will be zeros.
    I have to plot the chart with values after evaluating the group #1 but not before evaluating it.
    Please give me any idea over it.I am not an expert and it is urgent.
    Please help.
    Thanks,
    Haima

  • BUG: GROUP BY NOT WORKING (please help)

    Hi,
    My company is using Crystal Reports XI. Every installation for crystal has the same problem here:
    If you create a formula, it does not appear as a selection for the group by -- regardless of whether the formula is being used in the report or not.
    Is anyone else seeing this problem? (there was no problem with this feature 2 weeks ago when I last created a report using these features).
    Please help.
    Thanks
    Anna Bogdanova
    Data Analyst
    Recombinant Data Corporation

    Please copy and paste the formula into a reply and we can be more specific but I suspect you're utilizing a function that must be processed later on in the 3-pass report generation model.  One can only group on simple formulas so that the results of the formula will be available at the point the groups are created.
    Once we see the formula we can provide more specifics and workarounds.  Crystal Reports is intelligent and will not display those printtime formulas when selecting a field or formula on which to group - as it knows that this cannot be done.
    There are workarounds based on what functions are being used in your formula.

  • Grouping Inner Query based on a column.Please help

    I have a strange query.
    I am using Subquery to display the count of rows from the inner query
    depending upon the value of 'Y' or 'N'
    Trade
    id_entity       id_inst_code_type   id_inst_code   dt_trade
    AGL            SE                  5660249        10-Feb-06
    AGL            SE                  5660249        13-Feb-06
    AGL            SE                  5660249        13-Feb'06
    Instrument_xref
    ID_inst      id_inst_xref_type     id_inst_xref  flg_active
    0029010             SE          5660249          Y
    0070789          SE          5660249          Y
    0071190          SE          5660249          Y
    0072385          SE          5660249          Y
    0073215          SE          5660249          Y
    0084797          SE          5660249          Y
    0091375          SE          5660249          Y
    0094690          SE          5660249          Y
    0104438          SE          5660249          Y
    My output:
    id_inst_code_type          id_inst_code   Earliest    Latest       Total    Active
    SE                         5660249       10 Feb 06   13 Feb 06    3        9
    2) If all the 'flg_active' column in Table Instrument_xref is set to 'N'
       the Active should be 0.
    3) Assume that the flg_active could be 3 Y's and 6 N's then what?
    id_inst_code_type          id_inst_code   Earliest    Latest       Total    Active
    SE                         5660249       10 Feb 06   13 Feb 06    3        0
    How do I check for the 'Y' or 'N' value in my code below ?
    Help appreciated as the the functionality changes by the hour...
    select    tie.id_entity             'Entity',
              tie.id_inst_code          'Inst Code',
              min(tie.dt_trade)         'Earliest',
              max(tie.dt_trade)         'Latest',
              count(*)                  'Total',
              dt.InnerTotal             'Active'   
    from     trade_input_event tie,
    (Select  insx.id_inst_xref_type,
                   insx.id_inst_xref,
                   insx.flg_active,
                   count(*) InnerTotal
      from instrument_xref insx
      where insx.id_inst_xref = '5660249'
      ---** Do I need to Check the flg_active here..
      ---** Do I need to use the Having clause here? ie having count(insx.id_inst_xref) = 'N'
       group by insx.id_inst_xref_type,insx.id_inst_xref,insx.flg_active) dt
      where tie.id_inst_code = dt.id_inst_xref
      and tie.id_entity = 'AGL'
      group by tie.id_entity, tie.id_inst_code_type,tie.id_inst_code

    As the flg_active is set to 'Y', I am trying to set it to 'N' in the query
    so that count of 0 is returned, but this displays nothing.
    Please help as to how to display a count(*) of 0 when the flg_active is 'N'??
    Select  insx.id_inst_xref_type,
                   insx.id_inst_xref,
                   insx.flg_active,
                   count(*) InnerTotal
      from instrument_xref insx
      where insx.id_inst_xref = '5660249'
      and insx.flg_active = 'N'
      group by insx.id_inst_xref_type,insx.id_inst_xref,insx.flg_active) dt

Maybe you are looking for

  • Suddenly Can't Connect to Flash Debugger

    Out of the blue today my flex builder stopped breaking at breakpoints. While trying to troubleshoot I discovered that if I right-click on the flash application, and choose Debugger, I can try to connect on either LocalHost or Other Machine. I clicked

  • Reed switch versus Inverter board

    I need help.... My display has quit working and the screen is black. I've read so much about this my brain is shorting out and now i need clarification. Here's what i've done: Took it to apple store - they denied my request to get it fixed even thoug

  • Advice required on TSCM62-- Certification

    I'm doing Online Training on SD TSCM60 & 62. Regards to preparing for certification, can anyone advice whether I need to concentrate only on theory or do I need to concentrate on working & solving on the excercises which are given in the books. How i

  • Need to create a "checkedlistbox"

    Hello, I need to create a custom component that has the following - - is a listbox that appears as a MS-VB checkedlistbox - ability to be loaded at runtime from a datasource (XML data file) I've searched forums and other websites looking for anything

  • Custom LoginActions PEI - error

    I have custom loginActions PEI - OnAfterLogin function which needs to set the cookie in user browser. same way OnBeforeLogout function needs to delete the cookie. The code as follows to set the cookie: (I am getting error in this line "m_WebData.AddC