Select Latest entry  in each material based on input

Dear Experts,
                     in my itab.
material            year                period              amt         qty            
abc                   2008                  01                4545         878
abc                   2008                  03                5255         900
abc                   2008                  07                4545         1212
abc                   2009                  02                4551         1555  
bbb                   2008                  01                4545         878
bbb                   2008                  03                5255         900
bbb                   2008                  07                4545         1212
bbb                   2009                  02                4551         1555  
like that internel table stored in PSA in BI Side in around 10000 materialsi fetch all 10000 materials based on sam einput logic.
But user give the input  period  03-2009    i show the result for only 02-2009 records.
But user give the input  period 10-2008    i show the result for only 07-2008 records.
But user give the input  period 05-2008   i show the result for only 03-2008  records.
Thanks and regards,
raj

Hi,
Did you want this?
TYPES: BEGIN OF ty_data,
      f1 TYPE char10,
      f2 TYPE char10,
      f3 TYPE char10,
      f4 TYPE char10,
      END OF ty_data.
TYPES: BEGIN OF ty_data1,
      f1 TYPE char10,
      f2 TYPE char10,
      f3 TYPE char10,
      f4 TYPE char10,
      sub TYPE char10,
      END OF ty_data1.
DATA: it_data TYPE STANDARD TABLE OF ty_data,
      wa_data TYPE ty_data,
      it_data1 TYPE STANDARD TABLE OF ty_data1,
      wa_data1 TYPE ty_data1.
wa_data-f1 = 'abc'.
wa_data-f2 = '2009'.
wa_data-f3 = '01'.
wa_data-f4 = '4545'.
APPEND wa_data TO it_data.
wa_data-f1 = 'abc'.
wa_data-f2 = '2008'.
wa_data-f3 = '01'.
wa_data-f4 = '768'.
APPEND wa_data TO it_data.
wa_data-f1 = 'abc'.
wa_data-f2 = '2008'.
wa_data-f3 = '07'.
wa_data-f4 = '435'.
APPEND wa_data TO it_data.
wa_data-f1 = 'abc'.
wa_data-f2 = '2009'.
wa_data-f3 = '08'.
wa_data-f4 = '34'.
APPEND wa_data TO it_data.
it_data1 = it_data.
PARAMETERS: p_year TYPE char10,
            p_period TYPE char10.
SORT it_data BY f2 f3.
SORT it_data1 BY f2 f3.
READ TABLE it_data INTO wa_data WITH KEY f2 = p_year BINARY SEARCH.
IF sy-subrc = 0.
  LOOP AT it_data INTO wa_data FROM sy-tabix.
    IF ( wa_data-f3 EQ p_period ) AND
       ( wa_data-f2 EQ p_year ).
      WRITE: wa_data-f1,
       wa_data-f2,
       wa_data-f3,
       wa_data-f4.
      EXIT.
    ELSEIF ( wa_data-f2 EQ p_year ) AND
         ( wa_data-f3 NE p_period ).
      READ TABLE it_data1 INTO wa_data1 INDEX sy-tabix.
      IF sy-subrc = 0.
        wa_data1-sub = wa_data-f3 - p_period.
        MODIFY it_data1 FROM wa_data1 INDEX sy-tabix.
      ENDIF.
    ENDIF.
  ENDLOOP.
ENDIF.
SORT it_data1 ASCENDING BY sub.
READ TABLE it_data1 INTO wa_data1 WITH KEY f2 = p_year.
WRITE: wa_data1-f1,
      wa_data1-f2,
      wa_data1-f3,
      wa_data1-f4,
      wa_data1-sub.

Similar Messages

  • Selecting many records for each material...

    Hi all,
    I have an internal table that contains a list of materials. I want to loop over that list and retrieve a group of purchase reqs from EBAN for each material...appending each group of rews to my req table for each pass over the material list. Sample code;
    LOOP AT GT_MATERIALS INTO WA_MATERIALS.
    SELECT MENGE LFDAT
        INTO CORRESPONDING FIELDS OF TABLE GT_EBAN_FIELDS
        FROM EBAN
        WHERE MATNR EQ WA_MATERIALS-MATNR.      
        ???DO I DO AN APPEND OF SOME KIND HERE???
    ENDLOOP.
    Regards,
    Mat

    Hi Mathew,
    From performance point of view, the SELECT QUERY should not be under a loop. So you can do the following :
    <b>SORT GT_MATERIALS.
    IF not gt_materials is initial.</b>
    SELECT MENGE LFDAT
    INTO CORRESPONDING FIELDS OF TABLE GT_EBAN_FIELDS
    FROM EBAN
    <b>FOR ALL ENTRIES IN GT_MATERIALS</b>
    WHERE MATNR EQ GT_MATERIALS-MATNR.
    <b>ENDIF.</b>
    Also if the structure of table GT_EBAN_FIELDS has only two fields MENGE, LFDAT then please remove INTO CORRESPONDING FIELDS, instead use INTO TABLE GT_EBAN_FIELDS. This is becz INTO CORRESPONDING FIELDS would affect the performance.
    Best regards,
    Prashant

  • Get Latest Entry for each Item

    I have a table that has items with multiple entries per item.  Each entry has a date of when it was entered.  I want to get unique entries with the latest date. For example,
    From this:
    item
    date
    item1 12/13/2014
    item1 12/15/2014
    item2 12/10/2014
    item2 12/19/2014
    To this:
    item
    date
    item1 12/15/2014
    item2 12/19/2014
    Thanks in advance.

    Give this a try:
    DECLARE @items TABLE (itemName VARCHAR(20), itemDate DATE)
    INSERT INTO @items (itemName, itemDate) VALUES ('item1', '12/13/2014'),('item1', '12/15/2014'),('item2', '12/10/2014'),('item2', '12/19/2014')
    SELECT *
    FROM @items i
    WHERE i.itemDate = (
    SELECT MAX(itemDate)
    FROM @items
    WHERE i.itemName = itemName

  • I am having problems updating my itunes to the latest version, on each stage I am getting a message 'The feature you are trying to use in on a network resource that is unavailable.'  I try to click OK it fails and I do not know an alternate path to select

    I am having problems updating my itunes to the latest version, on each stage I am getting a message 'The feature you are trying to use in on a network resource that is unavailable.'  I try to click OK it fails and I do not know an alternate path to select, please help?
    I get message like below on each stage of the update, Quicktime, Safari & iTunes;
    It's so annoying as until I update my iTunes account my phone won't sync.

    Many thanks for the screenshot. (The key to these is knowing which particular .msi file is being mentioned by the message.)
    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any Bonjour entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?
    (Assuming that the QuickTime and Safari messages were also citing bonjour64.msi, you should also then be good to go with those installs too.)

  • One PR for Each Material

    Dear friends
    When i run Forecast based MRP in a Hotel, i am getting One P.R for every material, i having more than 2000 materials,. Can u pl guide me how can i combine the purchase requisition. what are the settings needed to avoide one P.R for each material.
    Thanks
    Shivani

    Shivani,
    MRP is a planning tool, which processes one part number at a time.  It is not designed to manage your client's requirements to consolidate purchase requisitions across multiple part numbers.
    If your client requires that purchase requisitions be consolidated, then that is a custom requirement and will require custom programming.  Get the detailed specs from the client and submit them to an ABAP'er.  It would be a simple matter for a custom program to select specified purchase reqs,  and consolidate them into a smaller number of reqs, and then delete the original reqs that are no longer needed.
    Rgds,
    DB49

  • Showing selected parameters values on each page in SSRS

    Hi All,
    I have a SSRS report with multi-selection parameter..Basically it's a summary report of sales and based on country parameter I have to show data.
    let say Country is the parameter and below are the values of the Country parameter list...
    Parameters list:
    All
    Australia
    England
    Canada
    Italy
    Parameter: All
    1) If I select 'All' in the parameter list then
    In 1st page I should see data related to Australia and display parameter value as Australia in the left side top corner of the report.   In 2nd page I should see data related to England and display parameter value as England in the left side top
    corner of the report.   In 3rd page I should see data related to Canada and display parameter value as Canada in the left side top corner of the report.  In 4th page I should see data related to Italy and display parameter value as Italy in
    the left side top corner of the report.  In 5th page I should see data related to All and display parameter value as All in the left side top corner of the report.
    2) If I select Australia and England in the parameter list then
    In 1st page I should see data related to Australia and display parameter value 
    as Australia in the left side top corner of the report.   In 2nd page I should see data related to England and display parameter value as England in the left side top corner of the report.
    3) If I select Italy in the parameter list then
    In 1st page I should see data related to Italy and display parameter value 
    as Italy in the left side top corner of the report.
    It should look like this..I need help in showing parameters (selected parameter) individually on each page.
    Page-1
    Parameter: Australia ( how to show Australia on 1st page)
    Product
    Amount
    Country
    Prd1
    100
    Australia
    Prd2
    200
    Australia
    Prd3
    300
    Australia
    Prd1
    340
    Australia
    Page-2
    Parameter: England ( how to show England on 2nd page)
    Product
    Amount
    Country
    Prd4
    400
    England
    Prd1
    125
    England
    Page-3 
    Parameter: Italy ( how to show Italy on 3rd page)
    Product
    Amount
    Country
    Prd2
    250
    Italy
    Prd3
    250
    Italy
    Create Table:
    Create Table Sample(
    Product varchar(10) Not Null,
    Amount Money null,
    Country null
    Insert Statement:
    Insert into sample (Product,Amount,Country) Values ('Prd1',100,'Australia')
    Insert into sample (Product,Amount,Country) Values ('Prd2','200,'Australia')
    Insert into sample (Product,Amount,Country) Values ('Prd3','300,'Australia')
    Insert into sample (Product,Amount,Country) Values ('Prd4','400,'England')
    Insert into sample (Product,Amount,Country) Values ('Prd5','480,'Canada')
    Insert into sample (Product,Amount,Country) Values ('Prd1','340,'Australia')
    Insert into sample (Product,Amount,Country) Values ('Prd3','290,'Canada')
    Insert into sample (Product,Amount,Country) Values ('Prd1','125,'England')
    Insert into sample (Product,Amount,Country) Values ('Prd2','250,'Italy')
    Insert into sample (Product,Amount,Country) Values ('Prd3','250,'Italy')
    Thanks in Advance,
    RH
    sql

    Hi sql9,
    According to your description, you have a report with a parameter for selecting countries. Now you need to display records for one country and show the country name on each page. Right?
    For this requirement, we need to add a parent group (Group on Country) so that we can set page break for each country. Also, we want to display the country name on each page. This country name is group name, not the parameter because the parameter contains
    all countries that we have selected. In this scenario, we just need to set the group name as page name, then display the Page Name (Build-in Field) in report header. You case has been tested in our local environment. Here are steps and screenshots for your
    reference:
    1. Create a table in report. Set detail rows group on Country. Set page break between each group instance.
    2. Create a parameter for filtering data. Set Filter on tablix.
    3. Go to Row Groups, select group Country. In Tablix Member Properties grid, go to Group->PageName. Put “=Fields!Country.Value” in expression. 
    4. Create a textbox in report header. Put Page Name (in Build-in Fields) into the textbox.
    5. Save and preview. It looks like below:
    Reference:
    Pagination in Reporting Services (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou
      

  • Assign different ship to party for each material in a sales order in CRM?

    Hi all,
    I need to create a sales order in CRM, such that the sales order contains more than 100 materials at item level and each material should be shipped to a different ship to party.
    That is for 100 materials in sales order I need to ship to 100 different customers.
    The 100 ship to partyu2019s are maintained for the business partner in relation ships tab in /nBP.
    The CRM configuration is done in such a way that when we enter a material while creating a sales order in CRM,u2026u2026.a window pops up asking us to select the ship to party for that material.
    No I need to replicate this programmatically. I generated a sales order in CRM programmatically using BAPI_SLSTRANSACT_CREATEMULTI. u2026 Now I need to make changes such that I have a provision to assign ship to party for each materialu2026
    How can I do this? Can any one tell me if there is a BAPI or Function Module available so that I can assign a different ship to party for each material in sales order?
    Regards,
    Jessica Sam

    Here is sample code. In that highlighted portion is different. check this out
    DATA: ls_partner TYPE crmt_partner_com,
            ls_input_fields TYPE crmt_input_field,
            lt_fieldname TYPE crmt_input_field_names_tab,
            ls_fieldname LIKE LINE OF lt_fieldname.
      ls_partner-ref_handle = p_iv_handle.
      ls_partner-ref_partner_handle = 1.
      ls_partner-ref_kind = 'A'.
      ls_partner-display_type = 'BP'.
      ls_partner-no_type = 'BP'.
      ls_partner-kind_of_entry = 'C'.
    licensee
      ls_partner-partner_fct = '00000069'.
      ls_partner-partner_no = w_but000-partner.
      INSERT ls_partner INTO TABLE gt_partner.
    Bill to party
      IF NOT w_con_header-billtoparty IS INITIAL.
        ls_partner-partner_fct = '00000003'.
        ls_partner-partner_no = w_but001-partner.
        INSERT ls_partner INTO TABLE gt_partner.
      ENDIF.
      IF w_con_header-billtoparty IS INITIAL.
        ls_partner-partner_fct = '00000003'.
        ls_partner-partner_no = w_but000-partner.
        INSERT ls_partner INTO TABLE gt_partner.
      ENDIF.
    Employee
      ls_partner-partner_fct = '00000014'.
      ls_partner-partner_no = w_con_header-empresp.
      INSERT ls_partner INTO TABLE gt_partner.
      +*lsinput_fields-ref_handle = p_iv_handle.*+_
      +*lsinput_fields-ref_kind = 'A'.*+_
      ls_input_fields-logical_key = ls_partner-ref_partner_handle.
      ls_input_fields-objectname = 'PARTNER'.
      ls_fieldname-fieldname = 'DISPLAY_TYPE'.
      INSERT ls_fieldname INTO TABLE lt_fieldname.
      CLEAR ls_fieldname.
      ls_fieldname-fieldname = 'KIND_OF_ENTRY'.
      INSERT ls_fieldname INTO TABLE lt_fieldname.
      CLEAR ls_fieldname.
      ls_fieldname-fieldname = 'NO_TYPE'.
      INSERT ls_fieldname INTO TABLE lt_fieldname.
      CLEAR ls_fieldname.
      ls_fieldname-fieldname = 'PARTNER_FCT'.
      INSERT ls_fieldname INTO TABLE lt_fieldname.
      CLEAR ls_fieldname.
      ls_fieldname-fieldname = 'PARTNER_NO'.
      INSERT ls_fieldname INTO TABLE lt_fieldname.
      CLEAR ls_fieldname.
      ls_input_fields-field_names = lt_fieldname.
      INSERT ls_input_fields INTO TABLE gt_input_fields.

  • Any notes for this issue 2 entries for 1 material while searching material

    Hello All
    Internal goods and services
    search material which has more than one UOMs.
    When i search material for internal goods and services i get two entries for one material . i know the reson why it dispalys two same items since it might have alternate UOM but however you select any one of the item it will be order unit only as UOM.
    Why SRM system showing two enties for one material with same item . enduser may dismay what item item needs to select.
    this must be protected right? Any suggestion not to show tow items while searching one material.
    Clue:- MARM - ecc table has Alternate UOMs entries fort he material. Any one is facing this problem ?
    br
    muthu

    Hi. I just tried it on our SRM 4 system (I know it's old, upgrade soon hopefully) and I can see the alternate UOM in MARM and also in SRM in COMMPR01, but I only get 1 hit in the search help.
    Are you sure you haven't got the same material replicated twice into SRM from 2 different backends or something? Can you see the logical system in the search? Check table COMM_PRODUCT to see if there is more than 1 entry for the material maybe?
    If it is the same system and the UOMs causing the problem It seems a bit odd that SAP would introduce this on a new system, have you tried raising a message with them?
    Worst case you always have the BBP_F4_READ_ON_ENTRY / BBP_F4_READ_ON_EXIT BADI's.
    Regards,
    Dave.

  • Select one record for each member of the group

    Hi,
    am having a table where in i will be having data for so many group members. i need to fetch data for a particular group members whose number of rows of data may be more in numbers (but i want only one row of data for each member of the group)
    here is the query for fetching all rows of data
    select RI.RESOURCE_NAME,TR.MSISDN,TR.ADDRESS1_GOOGLE, TR.MSG_DATE_INFO, FROM TRACKING_REPORT TR, RESOURCE_INFO RI
    WHERE TR.MSISDN IN (SELECT MSISDN FROM RESOURCE_INFO WHERE GROUP_ID ='1' AND COM_ID=2 ) AND RI.MSISDN=TR.MSISDN
    order by MSG_DATE_INFOoutput of this query is...
    >
    ddd     12345          13-Mar-10 19:43:03
    eee     54321     Tamil Nadu, India      13-Mar-10 19:39:48
    ddd     12345          13-Mar-10 19:32:58
    eee     54321     Tamil Nadu, India      13-Mar-10 19:30:07
    ddd     12345          13-Mar-10 19:23:08
    eee     54321     Tamil Nadu, India      13-Mar-10 19:20:14
    fff     98765          13-Mar-10 19:19:22
    ddd     12345          13-Mar-10 19:13:01
    eee     54321     Tamil Nadu, India      13-Mar-10 19:09:50
    ddd     12345          13-Mar-10 19:02:56
    eee     54321     tn,ind      13-Mar-10 18:59:49
    ddd     12345          13-Mar-10 18:53:08
    eee     54321     tn,ind      13-Mar-10 18:49:50
    ddd     12345          13-Mar-10 18:42:56
    eee     54321     tn,ind      13-Mar-10 18:39:50
    ddd     12345          13-Mar-10 18:33:00
    eee     54321     tn,ind      13-Mar-10 18:29:50
    ddd     12345          13-Mar-10 18:22:54
    eee     54321     tn,ind      13-Mar-10 18:19:50
    ddd     12345          13-Mar-10 18:12:56
    eee     54321     tn,ind      13-Mar-10 18:09:50
    ddd     12345          13-Mar-10 18:02:54
    eee     54321     tn,ind      13-Mar-10 18:00:02
    fff     98765     Tamil Nadu, India      13-Mar-10 17:59:26
    fff     98765     Tamil Nadu, India      13-Mar-10 17:54:26
    ddd     12345          13-Mar-10 17:52:56
    eee     54321     tn,ind      13-Mar-10 17:49:50
    fff     98765     Tamil Nadu, India      13-Mar-10 17:49:25
    fff     98765     Tamil Nadu, India      13-Mar-10 17:44:26
    ddd     12345          13-Mar-10 17:42:56
    >
    from this output i want only one latest record for each member(ddd,eee,fff). i.e
    >
    ddd     12345          13-Mar-10 19:43:03
    eee     54321     Tamil Nadu, India      13-Mar-10 19:39:48
    fff     98765          13-Mar-10 19:19:22
    >
    how to modify the query to achieve this...?

    Hi,
    This is not giving the result which i want...
    table is
    CREATE TABLE TRACKING_REPORT
      ID               NUMBER,
      MSISDN           NUMBER(12)                   NOT NULL,
      X                NUMBER(15,8)                 NOT NULL,
      Y                NUMBER(15,8)                 NOT NULL,
      TIME_STAMP       DATE,
      MSG_DATE_INFO    DATE                         DEFAULT sysdate,
      ADDRESS1_GOOGLE  VARCHAR2(400 BYTE),
      ADDRESS2_GOOGLE  VARCHAR2(400 BYTE),
      ADDRESS_MLINFO   VARCHAR2(400 BYTE),
      REQ_ID           VARCHAR2(30 BYTE)
    CREATE TABLE RESOURCE_INFO
      RESOURCE_ID    NUMBER,
      MSISDN         NUMBER,
      RESOURCE_NAME  VARCHAR2(25 BYTE),
      ADDRESS        VARCHAR2(100 BYTE),
      COM_ID         VARCHAR2(20 BYTE),
      ADMIN_ID       NUMBER,
      TIME_STAMP     DATE                           DEFAULT SYSDATE,
      GROUP_ID       NUMBER
    )

  • Ship to party for each material using BAPI_SLSTRANSACT_CREATEMULTI

    i am able to generate sales order for in CRM. I am inputting the sold to party, ship to party, bill to party and payer at the header level...
    CRM is currently configured in such a way that , there is a provision to assign ship to party at item level for each material.
    How can i programatically replicate this? I need to assign a diiferent ship to party for each material in the sales order.*
    how can i programatically replicate this?...
    this is  my code for cresating a sales order in CRM with sold to party, ship to party, bill to party and payer at the header level...
    *************include constants
      include crm_direct.
    ************// GUIDs
      data:         lv_guid_h type GUID_32,              "HEADER GUIDE
                    lv_guid_i type GUID_32,              "ITEM GUIDE
                    lv_guid_sl type GUID_32,             "SCHEDULE LINE GUIDE
                    lv_guid_p type GUID_32.              "PARTNER GUIDE
    ***********// Handles
      data:        lv_current_handle type crmt_handle,    "CURRENT HANDLE
                   lv_handle_h type crmt_handle,          "HEADER HANDLE
                   lv_handle_i type crmt_handle,          "ITEM HANDLE
                   lv_handle_sl type crmt_handle,         "SCHEDULE LINE HANDLE
                   lv_handle_p type crmt_handle.          "PARTNER HANDLE
    ***********// Administration header + item + etc
      data:        lt_salesorder_header type table of bapibus20001_header_ins,        "LT_SALESORDER_HEADER
                   ls_salesorder_header type bapibus20001_header_ins,                 "LS_SALESORDER_HEADER
                   lt_salesorder_item type table of bapibus20001_item,                "LT_SALESORDER_ITEM
                   ls_salesorder_item type bapibus20001_item,                         "LS_SALESORDER_ITEM
                   lt_scheduleline type table of BAPIBUS20001_SCHEDLIN,               "LT_SCHEDULELINE
                   ls_scheduleline type BAPIBUS20001_SCHEDLIN,                        "LS_SCHEDULELINE
                   lt_partner type table of BAPIBUS20001_PARTNER_INS,                 "LT_PARTNER
                   ls_partner type BAPIBUS20001_PARTNER_INS,                          "LS_PARTNER
                   ls_logical_key TYPE crmt_partner_logic_partner_key,                "LS_LOGICAL_KEY
                   lt_organisation type table of BAPIBUS20001_ORGMAN_INS,             "LT_ORGANISATION
                   ls_organisation type BAPIBUS20001_ORGMAN_INS.                      "LS_ORGANISATION
    *********// Saved sales orders
    data: lt_saved_process type table of bapibus20001_object_id,                   "LT_SAVED_PROCESS
      data:
            ls_saved_process type bapibus20001_object_id,                             "LS_SAVED_PROCESS
            ls_salesorder type CRMT_RETURN_OBJECTS_STRUC.                             "LS_SALESORDER
      data: lt_input_fields type table of bapibus20001_input_fields,                  "LT_INPUT_FIELDS
            ls_input_fields type bapibus20001_input_fields,                           "LS_INPUT_FIELDS
            ls_return type bapiret2.                                                  "LS_RETURN
    data: lt_return type table of bapiret2.                                        "LT_RETURN
    ***********// Macro definition to populate structure and input field This, called as
    *_set_field ls_salesorder_header GUID lv_guid_h
    *is exploded as
          ls_salesorder_header-GUID            =        lv_guid_h.
          ls_input_fields-fieldname            =        'GUID'.
          append ls_input_fields to lt_input_fields.
    *Note 1: &2 (field name) MUST be uppercase
    *Note 2: for the salesorder header, Macro has not been used to show how the code should look like.
    *except for that the macro has been used everywhere else.
         define setfield.
              &1-&2 = &3.
              ls_input_fields-fieldname = '&2'.
              append ls_input_fields to lt_input_fields.
        end-of-definition.
    *****// end of macro definition
    ******// fill order administration header
        perform get_guid changing lv_guid_h.
        add 1 to lv_handle_h.
        ls_salesorder_header-guid = lv_guid_h.
        ls_salesorder_header-handle = lv_handle_h.
        ls_salesorder_header-process_type = 'ZWEB'.
        clear ls_input_fields.
        ls_input_fields-ref_handle = lv_handle_h.
        ls_input_fields-ref_guid = lv_guid_h.
    *ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
        ls_input_fields-objectname = gc_object_name-orderadm_h.
        ls_input_fields-fieldname = 'GUID'.
        append ls_input_fields to lt_input_fields.
        ls_input_fields-fieldname = 'HANDLE'.
        append ls_input_fields to lt_input_fields.
        ls_input_fields-fieldname = 'PROCESS_TYPE'.
        append ls_input_fields to lt_input_fields.
        append ls_salesorder_header to lt_salesorder_header.
    **********// fill organisation data (Interface needs this, some times may rely on sales org determination instead...
        clear ls_input_fields.
        ls_input_fields-ref_handle          =      lv_handle_h.
        ls_input_fields-ref_guid            =      lv_guid_h.
        ls_input_fields-ref_kind            =      gc_object_ref_kind-orderadm_h.
        ls_input_fields-objectname          =      gc_object_name-orgman.
        setfield      ls_organisation    REF_GUID         lv_guid_h.
        setfield      ls_organisation    REF_HANDLE       lv_handle_h.
        setfield      ls_organisation    REF_KIND         gc_object_ref_kind-orderadm_h.
        setfield      ls_organisation    SALES_ORG_RESP   SO_RESP .                                 "(input).
        setfield      ls_organisation    SALES_ORG        SALES_ORG.                                "(input).
        setfield      ls_organisation    DIS_CHANNEL      DIS_CHNL.                                 "(input).
        setfield      ls_organisation    DIVISION         DIVISION.                                 "(input).
        append ls_organisation to lt_organisation.
    **********// fill order administration item
      perform get_guid changing lv_guid_i.
      lv_handle_i = lv_handle_h.
      add 1 to lv_handle_i.
      clear ls_input_fields.
      ls_input_fields-ref_guid            =        lv_guid_i.
      ls_input_fields-ref_handle          =        lv_handle_i.
    *ls_input_fields-ref_kind             =        gc_object_ref_kind-orderadm_i.
      ls_input_fields-objectname          =        gc_object_name-orderadm_i.
      setfield      ls_salesorder_item      GUID               lv_guid_i.
      setfield      ls_salesorder_item      HEADER             lv_guid_h.
      setfield      ls_salesorder_item      HANDLE             lv_handle_i.
      setfield      ls_salesorder_item      HEADER_HANDLE      lv_handle_h.
      setfield      ls_salesorder_item      ORDERED_PROD       PRODUCT .                           "(input).
      setfield      ls_salesorder_item      ITM_TYPE           'ZTAN'.
      setfield      ls_salesorder_item      MODE               'A'.
    *adjustment taken from standard include LCMS_MAPPERF04
    *(see where-used-list for BAPI_SLSTRANSACT_CREATEMULTI, program LCMS_MAPPERU11)
      delete lt_input_fields where fieldname = 'HANDLE'
      OR
      fieldname      =    'HEADER_HANDLE'.
      append ls_salesorder_item to lt_salesorder_item.
    ********// fill schedule line for item
      perform get_guid changing lv_guid_sl.
      add 1 to lv_handle_sl.
      clear ls_input_fields.
      ls_input_fields-ref_guid          =        lv_guid_i.
      ls_input_fields-ref_handle        =        lv_handle_i.
      ls_input_fields-ref_kind          =        gc_object_ref_kind-orderadm_i.
      ls_input_fields-objectname        =        gc_object_name-schedlin.
      setfield       ls_scheduleline       ITEM_GUID       lv_guid_i.
      setfield       ls_scheduleline       GUID            lv_guid_sl.
      setfield       ls_scheduleline       HANDLE          lv_handle_sl.
      setfield       ls_scheduleline       ITEM_HANDLE     lv_handle_i.
      setfield       ls_scheduleline       QUANTITY        quantity.                        "(input).
      append ls_scheduleline to lt_scheduleline.
    ********// fill partner line
    *perform get_guid changing lv_guid_p.
    *the partner use the logical key as well
      ls_logical_key-ref_partner_handle = '0001'.
      clear ls_input_fields.
      ls_input_fields-ref_guid       =       lv_guid_h.
      ls_input_fields-ref_handle     =       lv_handle_h.
      ls_input_fields-ref_kind       =       gc_object_ref_kind-orderadm_h.
      ls_input_fields-objectname     =       gc_object_name-partner.
      ls_input_fields-logical_key    =       ls_logical_key.
      setfield       ls_partner       REF_GUID                   lv_guid_h.
      setfield       ls_partner       REF_HANDLE                 lv_handle_h.
      setfield       ls_partner       REF_KIND                   gc_object_ref_kind-orderadm_h.
      setfield       ls_partner       REF_PARTNER_HANDLE         '0001'.
      setfield       ls_partner       KIND_OF_ENTRY              'C'.
      setfield       ls_partner       PARTNER_FCT                '00000001'.
      setfield       ls_partner       PARTNER_NO                 SOLD_TO.                                "(input).
      setfield       ls_partner       NO_TYPE                    'BP'.
      setfield       ls_partner       DISPLAY_TYPE               'BP'.
      move-corresponding ls_partner to ls_logical_key.
      append ls_partner to lt_partner.
      ls_logical_key-ref_partner_handle        =       '0002'.
      clear ls_input_fields.
      ls_input_fields-ref_guid                 =         lv_guid_h.
      ls_input_fields-ref_handle               =         lv_handle_h.
      ls_input_fields-ref_kind                 =         gc_object_ref_kind-orderadm_h.
      ls_input_fields-objectname               =         gc_object_name-partner.
      ls_input_fields-logical_key              =         ls_logical_key.
      setfield          ls_partner           REF_GUID                   lv_guid_h.
      setfield          ls_partner           REF_HANDLE                 lv_handle_h.
      setfield          ls_partner           REF_KIND                   gc_object_ref_kind-orderadm_h.
      setfield          ls_partner           REF_PARTNER_HANDLE         '0002'.
      setfield          ls_partner           KIND_OF_ENTRY              'C'.
      setfield          ls_partner           PARTNER_FCT                '00000002'.
      setfield          ls_partner           PARTNER_NO                 SHIP_TO .                                "(input).
      setfield          ls_partner           NO_TYPE                    'BP'.
      setfield          ls_partner           DISPLAY_TYPE               'BP'.
      move-corresponding ls_partner to ls_logical_key.
      append ls_partner to lt_partner.
      ls_logical_key-ref_partner_handle = '0003'.
      clear ls_input_fields.
      ls_input_fields-ref_guid             =           lv_guid_h.
      ls_input_fields-ref_handle           =           lv_handle_h.
      ls_input_fields-ref_kind             =           gc_object_ref_kind-orderadm_h.
      ls_input_fields-objectname           =           gc_object_name-partner.
      ls_input_fields-logical_key          =           ls_logical_key.
      setfield         ls_partner            REF_GUID                   lv_guid_h.
      setfield         ls_partner            REF_HANDLE                 lv_handle_h.
      setfield         ls_partner            REF_KIND gc_object_ref_kind-orderadm_h.
      setfield ls_partner REF_PARTNER_HANDLE '0003'.
      setfield ls_partner KIND_OF_ENTRY 'C'.
      setfield ls_partner PARTNER_FCT '00000003'.
      setfield ls_partner PARTNER_NO BILL_TO ."(input).
      setfield ls_partner NO_TYPE 'BP'.
      setfield ls_partner DISPLAY_TYPE 'BP'.
      move-corresponding ls_partner to ls_logical_key.
      append ls_partner to lt_partner.
      ls_logical_key-ref_partner_handle = '0004'.
      clear ls_input_fields.
      ls_input_fields-ref_guid = lv_guid_h.
      ls_input_fields-ref_handle = lv_handle_h.
      ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
      ls_input_fields-objectname = gc_object_name-partner.
      ls_input_fields-logical_key = ls_logical_key.
      setfield ls_partner REF_GUID lv_guid_h.
      setfield ls_partner REF_HANDLE lv_handle_h.
      setfield ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
      setfield ls_partner REF_PARTNER_HANDLE '0004'.
      setfield ls_partner KIND_OF_ENTRY 'C'.
      setfield ls_partner PARTNER_FCT '00000004'.
      setfield ls_partner PARTNER_NO PAYER ."(input).
      setfield ls_partner NO_TYPE 'BP'.
      setfield ls_partner DISPLAY_TYPE 'BP'.
      move-corresponding ls_partner to ls_logical_key.
      append ls_partner to lt_partner.
    *******// example of a second partner function (custom) with data override
    *ls_logical_key-ref_partner_handle = '0002'.
    *clear ls_input_fields.
    *ls_input_fields-ref_guid = lv_guid_h.
    *ls_input_fields-ref_handle = lv_handle_h.
    *ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
    *ls_input_fields-objectname = gc_object_name-partner.
    *ls_input_fields-logical_key = ls_logical_key.
    *_set_field ls_partner REF_GUID lv_guid_h.
    *_set_field ls_partner REF_HANDLE lv_handle_h.
    *_set_field ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
    *_set_field ls_partner REF_PARTNER_HANDLE '0002'.
    *_set_field ls_partner KIND_OF_ENTRY 'B'. "manual entry...
    *_set_field ls_partner PARTNER_FCT customFct(input).
    *_set_field ls_partner PARTNER_NO bpNumber(input).
    *_set_field ls_partner NO_TYPE 'BP'.
    *_set_field ls_partner DISPLAY_TYPE 'BP'.
    *_set_field ls_partner TITLE 'Mr.'.
    *_set_field ls_partner FIRSTNAME 'John'.
    *_set_field ls_partner LASTNAME 'Smith'.
    *_set_field ls_partner STR_SUPPL1 'John Smith and Co'.
    *_set_field ls_partner STREET 'Street1'.
    *_set_field ls_partner STR_SUPPL3 'Street4'.
    *_set_field ls_partner HOUSE_NO '42'.
    *_set_field ls_partner CITY 'Townville'.
    *_set_field ls_partner DISTRICT 'Districtshire'.
    *_set_field ls_partner POSTL_COD1 'AA1 2BB'.
    *note now ...
    *adjustment taken from standard include LCMS_MAPPERF04
    *(see where-used-list for BAPI_SLSTRANSACT_CREATEMULTI, program LCMS_MAPPERU11)
    *I don't use macro because name of the field in input_table is different
    *_set_field ls_partner COUNTRYISO 'GB'.
    *instead
      ls_partner-COUNTRYISO = 'GB'.
      ls_input_fields-fieldname = 'COUNTRY'.
      append ls_input_fields to lt_input_fields.
    *_set_field ls_partner LANGU_ISO 'EN'.
      ls_partner-LANGU_ISO = 'EN'.
      ls_input_fields-fieldname = 'LANGU'.
      append ls_input_fields to lt_input_fields.
      move-corresponding ls_partner to ls_logical_key.
      append ls_partner to lt_partner.
    *Create sales orders *
      call function 'BAPI_SLSTRANSACT_CREATEMULTI'
        EXPORTING
          testrun       = false
        TABLES
          header        = lt_salesorder_header[]
          item          = lt_salesorder_item[]
          partner       = lt_partner[]
          organisation  = lt_organisation[]
          input_fields  = lt_input_fields[]
          scheduleline  = lt_scheduleline[]
          saved_process = lt_saved_process[]
          return        = lt_return[].
    *************// get the GUID of the created object
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT          = 'X'
    IMPORTING
        RETURN        = lt_return1.
    INCLUDE ZZGVBAPISALESORDER_GET_GUIDF01.
    Edited by: jessica sam on Dec 22, 2008 4:25 PM
    Edited by: jessica sam on Dec 22, 2008 4:27 PM
    Edited by: jessica sam on Dec 22, 2008 7:05 PM
    Edited by: jessica sam on Dec 23, 2008 5:18 AM

    I know how to trace the Ship to party at line item. When i create an order manually on CRM then the table CRMD_PARTNER has the required entries and the Ship to party at line item is getting populated correctly. Also if i open the order in CRMD_ORDER the ship pto party are being populated correctly at line item..
    But if i am trying to replicate this programatcally using the BAPI, i see that the ship to at header is being copied to each line item and this is not what is expected.
    If i go and check in the CRMD_PARTNER the data is not filled
    correctly as I dont have any ship to party at line item
    So finally I even tried to insert the data manually in the CRMD_PARTNER table using an
    INSERT statement and even that doesnt work...
    https://www.sdn.sap.com/irj/scn/forums
    So i am unable to ficgure out what is going wrong
    Any body if they have any idea on poulating ship to party programatically in
    sales order for each line item please help
    I am unable to figure out how to fill PArtner table of this BAPI to populate ship to at line item level
    Kindly Help..
    Regards,
    Jessica Sam

  • What's This Help not working for one entry in each header file

    I have a large RoboHelp project that I have imported into Version 8 from a previous version. Prior to the import into Version 8, all of the What's This Help in the project was working perfectly; now, post-import, I have a problem.
    Firstly, some background information.
    My project contains a large number of individual header (.H) files, one for each dialog within the software. These header files, which have been generated and provided by our developers, contain one entry for each field on the dialog to which the header file relates. The header files are all contained within a \HTML Topics\Fields\ folder (going from the root of my Help project).
    Each header file has a corresponding text (.TXT) file. These text files contain entries that correspond to the entries in the relevant header file. The text files are also contained within the \HTML Topics\Fields\ folder.
    Below is an example of the contents of a header file:
    #define IDH_HIERARCHY_APPEARANCE_HIEARCHY_LIST          16811
    #define IDH_HIERARCHY_APPEARANCE_ADD_APPEARANCE         16812    
    #define IDH_HIERARCHY_APPEARANCE_REMOVE_APPEARANCE      16813
    Below is the contents of the corresponding text file:
    .topic IDH_HIERARCHY_APPEARANCE_ADD_APPEARANCE
    Click this button to add a new row of hierarchical appearance settings to the grid.
    .topic IDH_HIERARCHY_APPEARANCE_HIEARCHY_LIST
    Use this grid to define hierarchy appearance settings. Each row in the grid represents a level of the hierarchy. For example, the appearance settings you define for the first row apply to the top level of hierarchy, the settings you define for the second row apply to the second level, and so on.
    .topic IDH_HIERARCHY_APPEARANCE_REMOVE_APPEARANCE
    Click this button to delete the selected row of hierarchical appearance settings from the grid.
    The What's This Help that was part of the original project still works perfectly. However, after upgrading the project to RoboHelp Version 8, I have had to update the project to reflect changes to the software. As part of this work, I have imported some new header files and updated some existing ones - and edited the corresponding text files accordingly.
    The What's This Help that is covered by the header files that I have imported since the upgrade to RoboHelp Version 8 does not work correctly; in each case, the What's This Help does not work for whichever field appears at the top of the appropriate text file. The position of the entry in the corresponding header file does not make a difference.
    If I manually edit a text file to move a different entry to the top then recompile the Help project, the What's This Help does not work for the field that now appears at the top of the text file - and the What's This Help for the field that used to appear at the top of the text file now works.
    I've tried everything I can think of to fix this, but nothing has worked. It seems as if there is a problem in the way RoboHelp is compiling the header and text files.
    If I use Microsoft HTML Help Workshop to decompile the CHM file, then view the contents of the resulting, decompiled text files, the affected files appear as follows:
    .topic IDH_HIERARCHY_APPEARANCE_ADD_APPEARANCE
    Click this button to add a new row of hierarchical appearance settings to the grid.
    .topic 16811
    Use this grid to define hierarchy appearance settings. Each row in the grid represents a level of the hierarchy. For example, the appearance settings you define for the first row apply to the top level of hierarchy, the settings you define for the second row apply
    to the second level, and so on.
    .topic 16813
    Click this button to delete the selected row of hierarchical appearance settings from the grid.
    Note how the entry at the top - which relates to the What's This Help that doesn't work - appears differently to the other entries which do work. The name of the ID appears after ".topic" rather than the appropriate ID number.
    Any help that anyone can provide me with would be very much appreciated.
    Thank you,
    Mark

    Its working now. We just kept trying to reinstall the tools and restarting indesign. On the 4th time the buttons started working. I can't explain why it finally worked, just that it is working now.

  • Two entries for each archive log in v$archived_log

    Hi,
    I have noticied that there are two entries for each archive log. Why this is so...?
    I have fired following command.
    ==================
    set pages 300
    set lines 120
    ALTER SESSION SET nls_date_format='DD-MON-YYYY HH24:MI:SS';
    SELECT sequence#, first_time, next_time
    FROM v$archived_log
    ORDER BY sequence#;
    ==================
    output is as follows.
    ==================
    1436 24-FEB-2012 00:04:09 24-FEB-2012 08:24:21
    1436 24-FEB-2012 00:04:09 24-FEB-2012 08:24:21
    1437 24-FEB-2012 08:24:21 24-FEB-2012 15:45:01
    1437 24-FEB-2012 08:24:21 24-FEB-2012 15:45:01
    1438 24-FEB-2012 15:45:01 24-FEB-2012 15:45:04
    1438 24-FEB-2012 15:45:01 24-FEB-2012 15:45:04
    1439 24-FEB-2012 15:45:04 24-FEB-2012 15:45:57
    1439 24-FEB-2012 15:45:04 24-FEB-2012 15:45:57
    1440 24-FEB-2012 15:45:57 24-FEB-2012 17:26:41
    1440 24-FEB-2012 15:45:57 24-FEB-2012 17:26:41
    1441 24-FEB-2012 17:26:41 24-FEB-2012 18:40:07
    1441 24-FEB-2012 17:26:41 24-FEB-2012 18:40:07
    1442 24-FEB-2012 18:40:07 24-FEB-2012 19:36:17
    1442 24-FEB-2012 18:40:07 24-FEB-2012 19:36:17
    1443 24-FEB-2012 19:36:17 24-FEB-2012 19:36:18
    1443 24-FEB-2012 19:36:17 24-FEB-2012 19:36:18
    ==================
    Regards
    DBA.

    I have noticied that there are two entries for each archive log. Why this is so...?Mseberg already mentioned.. little in detail as below
    Check for the name column in v$archived_log,
    One location refers to Local destination LOG_ARCHIVE_DEST_1
    Other location refers to your standby/DR location, But it will shows you only service name instead of full archive name.
    select dest_id,name from v$archived_log where name is not null and completion_time like '%24%FEB%'
       DEST_ID NAME
             1 +ORAARCHIVE/prod1/archivelogs/arch_0001_0671689302_0000240097.arc
             2 (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=sldb1srv)(POR
               T=9101)))(CONNECT_DATA=(SERVICE_NAME=prod_sldb1srv_XPT)(INSTANCE_N
               AME=prod1)(SERVER=dedicated)))Edited by: CKPT on Feb 24, 2012 8:26 PM

  • Address Book making multiple copies of latest entry upon reopen

    Lately when I have been entering an entry in to address book, each time i reopen after the program after having previously entered a new contact i get about 20 copies of the latest entry. What is going on? How can i rectify?
    The problem started following a recent .csv file import.
    Thanks for any help!
    -Ponderosa

    do you use mobileme? if you do it could be corrupt sync data. then disable and reset syncing
    http://support.apple.com/kb/HT1497
    if that doesn't help or you don't use mobileme quit Address book and delete the file homedirectory/library/application support/address book/AddressBook-v22.abcddb. then start Address Book and see if it behaves.

  • The quantity received/required for each material (only sum of Dep and Foreq

    Hi all
    I have a report and I need it to show the <b>quantity received/required</b> for each material (<b>only sum of Depreq and ForReq</b>) in a plant due to MRP execution.
    Basically something like MD04 showing each MRP element entry (only sum of Depreq and ForReq)
    Do anyone knows a function, bapi, or other that can helps calculate this?
    Thanks in advance

    Hi srivalli,
    U mean that for every material u need sum of recieved quntity and required qunatity? if this is your requirement.
    Try the synax below.
    Example.
    itab - internal table of any sturcture. suppose itab  consits of materil and quantity fiedls.
    sort itab by matnr.
    loop at itab.
    At end of matnr.
    Sum.
    Write: itab-matnr, itab-menge.
    ENDAT.
    endloop.
    This syntax will display the sum of quantity for each material.
    <b>Reward if useful</b>
    Any thing please reply back if you have any other doubt.
    Regards,
    sunil kairam.

  • Select last value for each day from table

    Hi!
    I have a table that stores several measures for each day. I need two queries against this table and I am not quite sure how to write them.
    The table stores these lines (sample data)
    *DateCol1                 Value       Database*
    27.09.2009 12:00:00       100           DB1
    27.09.2009 20:00:00       150           DB1
    27.09.2009 12:00:00       1000          DB2
    27.09.2009 20:00:00       1100          DB2
    28.09.2009 12:00:00       200           DB1
    28.09.2009 20:00:00       220           DB1
    28.09.2009 12:00:00       1500          DB2
    28.09.2009 20:00:00       2000          DB2Explanation of data in the sample table:
    We measure the size of the data files belonging to each database one or more times each day. The value column shows the size of the database files for each database at a given time (European format for date in DateCol1).
    What I need:
    Query 1:
    The query should return the latest measurement for each day and database. Like this:
    *DateCol1       Value      Database*
    27.09.2009        150          DB1
    27.09.2009       1100          DB2
    28.09.2009        220          DB1
    28.09.2009       2000          DB2Query 2:
    The query should return the average measurement for each day and database. Like this:
    *DateCol1       Value      Database*
    27.09.2009       125          DB1
    27.09.2009      1050          DB2
    28.09.2009       210          DB1
    28.09.2009      1750          DB2Could someone please help me to write these two queries?
    Please let me know if you need further information.
    Edited by: user7066552 on Sep 29, 2009 10:17 AM
    Edited by: user7066552 on Sep 29, 2009 10:17 AM

    For first query you can use analytic function and solve it.
    with t
    as
    select to_date('27.09.2009 12:00:00', 'dd.mm.yyyy hh24:mi:ss') dt,       100 val,           'DB1' db from dual union all
    select to_date('27.09.2009 20:00:00', 'dd.mm.yyyy hh24:mi:ss'),       150,           'DB1' from dual union all
    select to_date('27.09.2009 12:00:00', 'dd.mm.yyyy hh24:mi:ss'),       1000,          'DB2' from dual union all
    select to_date('27.09.2009 20:00:00', 'dd.mm.yyyy hh24:mi:ss'),       1100,          'DB2' from dual union all
    select to_date('28.09.2009 12:00:00', 'dd.mm.yyyy hh24:mi:ss'),       200,           'DB1' from dual union all
    select to_date('28.09.2009 20:00:00', 'dd.mm.yyyy hh24:mi:ss'),       220,           'DB1' from dual union all
    select to_date('28.09.2009 12:00:00', 'dd.mm.yyyy hh24:mi:ss'),       1500,          'DB2' from dual union all
    select to_date('28.09.2009 20:00:00', 'dd.mm.yyyy hh24:mi:ss'),       2000,          'DB2' from dual
    select dt, val, db
      from (
    select row_number() over(partition by trunc(dt), db order by dt) rno,
           count(*) over(partition by trunc(dt), db) cnt,
           t.*
      from t)
    where rno = cntFor second you can just group by
    with t
    as
    select to_date('27.09.2009 12:00:00', 'dd.mm.yyyy hh24:mi:ss') dt,       100 val,           'DB1' db from dual union all
    select to_date('27.09.2009 20:00:00', 'dd.mm.yyyy hh24:mi:ss'),       150,           'DB1' from dual union all
    select to_date('27.09.2009 12:00:00', 'dd.mm.yyyy hh24:mi:ss'),       1000,          'DB2' from dual union all
    select to_date('27.09.2009 20:00:00', 'dd.mm.yyyy hh24:mi:ss'),       1100,          'DB2' from dual union all
    select to_date('28.09.2009 12:00:00', 'dd.mm.yyyy hh24:mi:ss'),       200,           'DB1' from dual union all
    select to_date('28.09.2009 20:00:00', 'dd.mm.yyyy hh24:mi:ss'),       220,           'DB1' from dual union all
    select to_date('28.09.2009 12:00:00', 'dd.mm.yyyy hh24:mi:ss'),       1500,          'DB2' from dual union all
    select to_date('28.09.2009 20:00:00', 'dd.mm.yyyy hh24:mi:ss'),       2000,          'DB2' from dual
    select trunc(dt) dt, avg(val) val, db
      from t
    group by trunc(dt), db
    order by trunc(dt)

Maybe you are looking for

  • How to declare a internal table in start routine i.e. transformations

    Hi Gurus, How to define an internal table in a start rotuine? any help greatly appreciated. Best Regards, Reddy.

  • Original iPad no longer connects to Mac?

    My original iPad will no longer connect to my Mac. I replaced my old Mac Tower with an Intel Power Mac. I have tried everything that I can think of to remedy this problem.

  • Multi-Room DVR and HD DVR?

    Is it possible yet to have a multi-room DVR and an HD-DVR?  I want to have my downstairs DVR be the multi-room DVR and be able to watch the shows that I record upstairs on that DVR in addition to the shows recorded downstairs.  It seems I can never g

  • Sort Global Address List by Last Name in Exchange (SBS 2011)

    Hello We Use SBS 2011 and outlook for interoffice mailing. In our Company People Know each other by their Last Names. But in Outlook in Global Address List names are sorted by First Name alphabetically. I want, for example, when people type "C" in se

  • Mail not coming in from Gmail

    I know there are a zillion discussions dealing with Mavericks email and Gmail (which was all working fine before the upgrade!), but I would like to talk about one very specific show-stopper I am experiencing. That is - new email is often simply not a