URGENT: Selecting only 25 records at a time from a table

URGENT !!!!
Hi,
Im having a RFC which selects records from a table (say table_A) and depending on these selected records, further processing is done within that RFC.
Now my problem is, this table_A contains around 200 matching records. Due to this entire logical processing consumes lot of time. Hence my RFC is taking huge time to produce result. (apprx 10 mins).
Can i select these matching records in batch of 25 and display result for these 25 records??
I'll give this batch size as input to RFC?
Do anybody have any idea about how to tackle this situation and reduce response time?
If u hav any better solution than this then pls pls let me know ASAP..
Regards,
Amey

Amey Mogare  ,
                         Do One thing , create  a new importing parameter in your RFC , say current_trans_id. NOw on the first call pass the initial value for current_trans_id.
then inside the logic .. change the select to
select upto 25 rows where trnascation id > current_trans_id.
next time when u call teh rfc.. send the last selected id as a value for current_trans_id.
i think you can some how use this logic
Regards
Sarath

Similar Messages

  • Records have been deleted from the table.

    Hi all ,
    If records have been deleted from the table that any log file maintains the history as following Way.
    User Name who delete the records.
    Machine name where the command is execute.
    The command syntax e.g delete from abc where ……..
    or any other help related to mentioned problem.
    Regards,
    Mobeen.

    Wrong forum .. your question doesnt make much sense.
    But take a look at Oracle Auditing.

  • How to fetch n records at a time from a FM and then fetch next n records

    I have a report program which is calling a function module . This function module returns all the records from a table. As the table has millions of records, it cant be returned at a time. How can we return N records from a function module and then return Next n records .The Function module and the report program are in different system .
    Thanks in Advance.

    Use open cursor and fetch cursor.
    Check the program as in SAP Help.
    DATA: BEGIN OF count_line,
            carrid TYPE spfli-carrid,
            count  TYPE i,
          END OF count_line,
          spfli_tab TYPE TABLE OF spfli.
    DATA: dbcur1 TYPE cursor,
          dbcur2 TYPE cursor.
    OPEN CURSOR dbcur1 FOR
      SELECT carrid count(*) AS count
             FROM spfli
             GROUP BY carrid
             ORDER BY carrid.
    OPEN CURSOR dbcur2 FOR
      SELECT *
             FROM spfli
             ORDER BY carrid.
    DO.
      FETCH NEXT CURSOR dbcur1 INTO count_line.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      FETCH NEXT CURSOR dbcur2
        INTO TABLE spfli_tab PACKAGE SIZE count_line-count.
    ENDDO.
    CLOSE CURSOR: dbcur1,
                  dbcur2.
    Regards
    Kannaiah

  • Urgent: Can Only Record in Demonstration Mode

    When I try to record, I can choose from any of the recording
    modes, but it only outputs in demonstration mode (i.e., no text
    entry boxes are recorded from keystokes). I noticed that when I
    check the settings in the recording window, it will always default
    to demonstration mode no matter which mode I choose after hitting
    ok. Any suggestions would be greatly appreciated!
    I have used Captivate for a few years now and this is the
    first time I have seen this problem.

    Hi again
    Perhaps consider performing the factory reset. Close
    Captivate and open Windows Explorer. Then navigate to the following
    folder on your PC:
    C:\Documents and Settings\????\Application Data\Adobe\Adobe
    Captivate
    *NOTE: Replace ???? with your logged in user name.
    Once you are there you should see a file named
    Captivate_v30.dat. Delete this file and restart Captivate.
    Captivate will bake up a fresh one when it restarts.
    If you are reluctant to delete the file, just rename it
    instead. The goal is to get it where Captivate can't find it. If it
    can't find it, it creates a new one.
    Cheers... Rick

  • How can i display 5,10,15... records @ a time from a table in a DB?

    well, i have developed a JSP application that shows ALL the employees in a certain department... the problem is when the number of employees increase the jsp page bcomes very, VERY long...
    how can i do this by showing at least 20 records at a time... also like other jsp pages that i see that they have page numbers in the page above to show the other records... like...
    page 1 20 records...
    page 2, another 20...
    ... so on and so forth...
    please help...
    :]

    Don't loop through the whole result set at once, just show records 1 to n....where n is whatever value you think creates a nice sized page. If you cache the results you can then display n+1 to 2n when the user hits a "more" link at the bottom of the page...and so on.
    btw...caching may not be the best way to store your data, depends on the size of the resultsset, you may want to re-run the query each time and/or optimise the query to only fetch back the n results you want each time.
    J.

  • How to insert a set of rows at a time from another table

    Hello!
    I have a table1 and table 2 - i want to insert a set of rows at a time from table1 to table 2. Then do a COMMIT. Then continue inserting another set of rows and so on.... say i want to insert into table 2 i million records at a time and then do a commit. then continue with the next 1 million and do a commit and so on..until there are no more records in table 1
    Any ideas please!!!!!!!!!!

    may be this will help
    declare
    cursor c1
    select * from table1
    i_counter binary_integer := 1;
    begin
    for c1_rec in c1
    insert into table2
    values(c1_rec.,..);
    if i_counter = 1000? then
    commit;
    i_counter = 1;
    end if;
    i_counter := i_counter+1;
    end loop
    end;

  • Urgent : Making heirarchy report by fetching data froma single table

    Hi,
    I am making a report in which i hae to display the data like this:-
    If there is a material and it contains batch and that batch furhter conatins sub-batches of it.
    The problem is dat all the data which is to be displayed is from the table CHVW  and i am  not able to display the data in hierarchy by fetching it from a single table.
    plzz guide me how to do dis as it is really urgent and points will be deinftely rewarded.
    help me out.
    reagrds,
    ric.s
    Edited by: ric .s on Apr 30, 2008 10:31 AM

    Hi,
    Check the sample Report.
    REPORT z_alv_hierseq_list.
    Program with FM REUSE_ALV_HIERSEQ_LIST_DISPLAY                      *
    TYPE-POOLS: slis.                    " ALV Global types
    CONSTANTS :
      c_x VALUE 'X',
      c_gt_vbap TYPE slis_tabname VALUE 'GT_VBAP',
      c_gt_vbak TYPE slis_tabname VALUE 'GT_VBAK'.
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.    "#EC NEEDED
    PARAMETERS p_max(02) TYPE n DEFAULT '10' OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_2 FOR FIELD p_expand. "#EC NEEDED
    PARAMETERS p_expand AS CHECKBOX DEFAULT c_x.
    SELECTION-SCREEN END OF LINE.
    TYPES :
    1st Table
      BEGIN OF ty_vbak,
        vbeln TYPE vbak-vbeln,             " Sales document
        kunnr TYPE vbak-kunnr,             " Sold-to party
        netwr TYPE vbak-netwr,             " Net Value of the Sales Order
        erdat TYPE vbak-erdat,             " Creation date
        waerk TYPE vbak-waerk,             " SD document currency
        expand TYPE xfeld,
      END OF ty_vbak,
    2nd Table
      BEGIN OF ty_vbap,
        vbeln TYPE vbap-vbeln,             " Sales document
        posnr TYPE vbap-posnr,             " Sales document
        matnr TYPE vbap-matnr,             " Material number
        arktx TYPE vbap-arktx,             " Material description
        netwr TYPE vbap-netwr,             " Net Value of the Sales Order
        waerk TYPE vbap-waerk,             " SD document currency
      END OF ty_vbap.
    DATA :
    1st Table
      gt_vbak TYPE TABLE OF ty_vbak,
    2nd Table
      gt_vbap TYPE TABLE OF ty_vbap.
    INITIALIZATION.
      v_1 = 'Maximum of records to read'.
      v_2 = 'With ''EXPAND'' field'.
    START-OF-SELECTION.
    Read Sales Document: Header Data
      SELECT vbeln kunnr netwr waerk erdat
        FROM vbak
          UP TO p_max ROWS
        INTO CORRESPONDING FIELDS OF TABLE gt_vbak.
      IF gt_vbak[] IS NOT INITIAL.
      Read Sales Document: Item Data
        SELECT vbeln posnr matnr arktx netwr waerk
          FROM vbap
          INTO CORRESPONDING FIELDS OF TABLE gt_vbap
           FOR ALL ENTRIES IN gt_vbak
         WHERE vbeln = gt_vbak-vbeln.
      ENDIF.
    END-OF-SELECTION.
      PERFORM f_display.
          Form  F_DISPLAY
    FORM f_display.
    Macro definition
      DEFINE m_fieldcat.
        ls_fieldcat-tabname = &1.
        ls_fieldcat-fieldname = &2.
        ls_fieldcat-ref_tabname = &3.
        ls_fieldcat-cfieldname = &4.       " Field with currency unit
        append ls_fieldcat to lt_fieldcat.
      END-OF-DEFINITION.
      DEFINE m_sort.
        ls_sort-tabname = &1.
        ls_sort-fieldname = &2.
        ls_sort-up        = c_x.
        append ls_sort to lt_sort.
      END-OF-DEFINITION.
      DATA:
        ls_layout   TYPE slis_layout_alv,
        ls_keyinfo  TYPE slis_keyinfo_alv,
        ls_sort     TYPE slis_sortinfo_alv,
        lt_sort     TYPE slis_t_sortinfo_alv," Sort table
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv." Field catalog
      ls_layout-group_change_edit = c_x.
      ls_layout-colwidth_optimize = c_x.
      ls_layout-zebra             = c_x.
      ls_layout-detail_popup      = c_x.
      ls_layout-get_selinfos      = c_x.
      IF p_expand = c_x.
        ls_layout-expand_fieldname  = 'EXPAND'.
      ENDIF.
    Build field catalog and sort table
      m_fieldcat c_gt_vbak 'VBELN' 'VBAK' ''.
      m_fieldcat c_gt_vbak 'KUNNR' 'VBAK' ''.
      m_fieldcat c_gt_vbak 'NETWR' 'VBAK' 'WAERK'.
      m_fieldcat c_gt_vbak 'WAERK' 'VBAK' ''.
      m_fieldcat c_gt_vbak 'ERDAT' 'VBAK' ''.
      m_fieldcat c_gt_vbap 'POSNR' 'VBAP' ''.
      m_fieldcat c_gt_vbap 'MATNR' 'VBAP' ''.
      m_fieldcat c_gt_vbap 'ARKTX' 'VBAP' ''.
      m_fieldcat c_gt_vbap 'NETWR' 'VBAP' 'WAERK'.
      m_fieldcat c_gt_vbap 'WAERK' 'VBAP' ''.
      m_sort c_gt_vbak 'KUNNR'.
      m_sort c_gt_vbap 'NETWR'.
      ls_keyinfo-header01 = 'VBELN'.
      ls_keyinfo-item01 = 'VBELN'.
      ls_keyinfo-item02 = 'POSNR'.
    Dipslay Hierarchical list
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        EXPORTING
          i_callback_program      = sy-cprog
          i_callback_user_command = 'USER_COMMAND'
          is_layout               = ls_layout
          it_fieldcat             = lt_fieldcat
          it_sort                 = lt_sort
          i_tabname_header        = c_gt_vbak
          i_tabname_item          = c_gt_vbap
          is_keyinfo              = ls_keyinfo
          i_save                  = 'A'
        TABLES
          t_outtab_header         = gt_vbak
          t_outtab_item           = gt_vbap
        EXCEPTIONS
          program_error           = 1
          OTHERS                  = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                               " F_LIST_DISPLAY
          Form USER_COMMAND                                             *
    FORM user_command USING i_ucomm     TYPE sy-ucomm
                            is_selfield TYPE slis_selfield.     "#EC CALLED
      DATA ls_vbak TYPE ty_vbak.
      CASE i_ucomm.
        WHEN '&IC1'.                       " Pick
          CASE is_selfield-tabname.
            WHEN c_gt_vbap.
            WHEN c_gt_vbak.
              READ TABLE gt_vbak INDEX is_selfield-tabindex INTO ls_vbak.
              IF sy-subrc EQ 0.
              Sales order number
                SET PARAMETER ID 'AUN' FIELD ls_vbak-vbeln.
              Display Sales Order
                CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
              ENDIF.
          ENDCASE.
      ENDCASE.
    ENDFORM.                               " USER_COMMAND
    END OF PROGRAM Z_ALV_HIERSEQ_LIST ******************
    Regards,
    Raj.

  • Need help in writing a select query to pull required data from 3 tables.

    Hi,
    I have three tables EmpIDs,EmpRoles and LatestRoles. I need to write a select Query to get roles of all employees present in EmpIDs table by referring EmpRoles and LatestRoles.
    The condition is first look into table EmpRoles and if it has more than one entry for a particular Employee ID than only need to get the Role from LatestRoles other wise consider
    the role from EmpRoles .
    Sample Script:
    Create Table #EmpIDs
    (EmplID int )
    Create Table #EmpRoles
    (EMPID int,Designation varchar(50))
    Create Table #LatestRoles
    EmpID int,
    Designation varchar(50)
    Insert into #EmpIDs values (1),(2),(3)
    Insert into #EmpRoles values (1,'Role1'),(2,'Role1'),(2,'Role2'),(3,'Role1')
    Insert into #LatestRoles values (2,'Role2')
    Employee ID 2 is having two roles defined in EmpRoles so for EmpID 2 need to fetch Role from LatestRoles table and for
    remaining ID's need to fetch from EmpRoles .
    My Final Output of select query should be like below.
    EmpID Role
    1 Role1
    2 Role2
    3 Role1
    Please help.
    Mohan

    Mohan,
    Can you check if this answers your requirement:
    Create Table #EmpIDs
    (EmplID int )
    Create Table #EmpRoles
    (EMPID int,Designation varchar(50))
    Create Table #LatestRoles
    EmpID int,
    Designation varchar(50)
    Insert into #EmpIDs values (1)
    Insert into #EmpIDs values (2)
    Insert into #EmpIDs values (3)
    Insert into #EmpRoles values (1,'Role1')
    Insert into #EmpRoles values (2,'Role2')
    Insert into #EmpRoles values (2,'Role1')
    Insert into #EmpRoles values (3,'Role1')
    Insert into #LatestRoles values (2,'Role2')
    --Method 1
    select e.EmplID,MIN(ISNULL(l.Designation,r.Designation)) as Designation
    from #empids e
    left join #emproles r on e.emplID=r.EmpID
    left join #latestRoles l on e.emplID=l.EmpID
    group by e.EmplID
    --Method 2
    ;with cte
    as
    select distinct e.EmplID,r.Designation,count(*) over(partition by e.emplID) cnt
    from #empids e
    left join #emproles r on e.emplID=r.EmpID
    select emplID,Designation
    from cte
    where cnt=1
    UNION ALL
    select a.EmplID,l.Designation
    from
    (select distinct EmplID from cte where cnt>1) a
    join #Latestroles l on a.EmplID=l.EmpID
    order by emplID
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • Condition Record PB00 gets deleted from A018 table

    Hi Gurus-
    Could anyone of you explain how the PB00 condition is getting deleted from A018 table (Purch Org Level Condition)? It looks like some batch job is randomly setting the Valid to Date A018-DATBI to yesterday's date and today there is no valid time dependent condition.
    I don't know any process/program that accesses PB00 condition in table A018 other than MEK1 or MEK4.
    Does SD condition type change has any impact in Purchasing Price (PB00). Although all the Rate/Price is stored in the same table KONP but separated by application area and table (A017, A018, A071, A073).
    Can anybody shed some lights on this please?

    Thanks for your reply. We know the user name who is making the change in A018. It is a batch user ID that makes the change but we have about 100 differentg background batch job that is scheduled everyday and I went through every one of them but did not raise any flag.
    And the worst part is since it is done by the batch user id (batch job), there is no change record (if I try to do MEK3-Environment>display changes) not even an entry in CDHDR table or CDPOS table.
    Trying to see if you guys know of any SD or MM program that accesses that table and set the valid to field to yesterdays date and create a new condition record (KNUMH) with valid to date 31.12.9999 and rate (value) to 0.00?
    Please let me know if you have any suggestion.
    Thanks in advance.

  • SQL Select Performance - Approached to fetch data from big table

    Hi
    I just wanted to know view on different approached to fetch data from a table which has 40 billion records and which joined to another table which has 1 million record.
    e.g.
    I have two tables TableA and TableB
    TableA has 40 Billion records has 6 columns
         TableA has partitions on Date
         TableA has required indexes
    TableB has 1 Milluion record and has 10 columns
         Table A has indexes
    Now I have written query like
    select distinct TableA.column1,TableA.column2,TableB.columnA
    FROM TableA join TableB
    ON TableA.Column1=TableB.Column2
    WHERE TableA.DateColumn between StartDate and EndDate
    for a given date range it will fetch 5 billion of records which takes around 40 minutes.
    I just wanted to know what all tuning approaches I can follow. What would be the best approach to make record retrieval faster in such a scenario.
    Just wanted to know your vies/experience in such a scenario

    Sufficiently large array fetchsize
    and,
    possibly using parallel query,
    pop into my mind.
    I would be interested though in the business requirement that asks for you to write a program that gets 5 billion (!) rows out of the database...

  • Inserting multiple records into a database from a table

    I have a dynamic table with rows upto 10. i am trying to insert all the records in these rows into a database ( msaccess)
    table name: Table1 ( in my form )
    Database table : movies_comments ( as posted in stefan's forums ).
    table columns: username, movieid, comments
    i am using the following code.
    Database.ExecSQL() function is as posted in stefcamerons forums.
    var tlength = xfa.resolveNode("form1.#subform[0].Table1.Row1[*]").length;
    xfa.host.messageBox("tlength is :" +tlength);
    for ( var i = 1; i <= tlength; i++)
    var username = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].user_name").rawValue;
    var movieID = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].movie_id").rawValue;
    var commentS = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].comment_").rawValue;
    Database.ExecSQL("INSERT INTO movie_comments (username, movieId, comment) VALUES ('username','movieID', 'commentS');");
    i am trying to insert multiple records using the code above. But i am getting error
    GeneralError: Operation failed.
    XFAObject.resolveNode:1:XFA:form1[0]:#subform[0]:Button1[0]:click
    SOM expression returned list when single result was expected
    suggest me an alternate way to insert multiple records from a table into a database.
    thank Q

    figured it out. I changed the ...OR (alternative names = colname) in the recordset to ...OR (alternative names LIKE %colname%). Works like a charm now- the result of a good night's sleep.

  • Records based on time from Oracle database

    Dear Experts,
    I need some valuable suggestion from your end.
    This a synchronous scenario from Sender ECC to Oracle Database.
    In Oracle Database, the swiping entry time of employees is stored in format as 03/11/2012 08:10:22 which would be the primary key while making ECC request.
    I have to fetch all the records along with other 3 output fields for the date between 03/11/2012 00:00:01 to 04/11/2012 00:00:01.
    The Oracle view has following column EMPID,CITY,TIME,DEVICE
    1. How would be ECC and JDBC request structure so that the start time and end time are captured?
    2.How to map the ECC and Oracle Database request structure where the SQL query would look something below.
    select EMPID,CITY,TIME,DEVICE  from time_details where
    TIME > TO_DATE('03/11/2012 00:00:01', 'MM/DD/YYYY HH24:MI:SS')
    and
    TIME < TO_DATE('04/11/2012 00:00:01', 'MM/DD/YYYY HH24:MI:SS')
    3. I tried to fetch the records by putting the WILDCARD in the date input value, I am receiving the response but with no payload.Is there any other design where I can fetch all the records for 03/11/2012 from 0 hours to 24 hours.
    Quick help is highly appreciated.
    Regards
    Rebecca

    Hi Praveen,
    Genius..
    You saved my whole day by giving this input..
    I would need your help to in the Access block specially to form the JDBC request structure from where clause. Let me first try to form the Message Type.
    <access>select EMPID,CITY,TIME,DEVICE  from time_details where TIME > TO_DATE('$placeholder1$', 'MM/DD/YYYY HH24:MI:SS') and TIME < TO_DATE('$placeholder2$', 'MM/DD/YYYY HH24:MI:SS')</access>
    1. I assume for TO_DATE, I have to check in the DateTransformation Mapping function whether HH24:MI:SS is available or not.
    Thanks once again for your input.
    Regards
    Rebecca

  • Select only records where column values are not all equal to zero

    Hi everyone, this seems so easy but it's got me stumped on finding a clean, easy way to accomplish this. I'm sure when someone responds, I'll kick myself. So, assume the following is what I've got:
    with mytable as (
    select 'Type 1' as itemtype, 'JAN' as monthname, 0 as theval from dual union all
    select 'Type 1' as itemtype, 'FEB' as monthname, 1 as theval from dual union all
    select 'Type 1' as itemtype, 'MAR' as monthname, 5 as theval from dual union all
    select 'Type 1' as itemtype, 'APR' as monthname, 1 as theval from dual union all
    select 'Type 1' as itemtype, 'MAY' as monthname, 4 as theval from dual union all
    select 'Type 1' as itemtype, 'JUL' as monthname, 0 as theval from dual union all
    select 'Type 1' as itemtype, 'AUG' as monthname, 0 as theval from dual union all
    select 'Type 1' as itemtype, 'SEP' as monthname, 1 as theval from dual union all
    select 'Type 1' as itemtype, 'OCT' as monthname, 7 as theval from dual union all
    select 'Type 1' as itemtype, 'NOV' as monthname, 1 as theval from dual union all
    select 'Type 1' as itemtype, 'DEC' as monthname, 2 as theval from dual union all
    select 'Type 2' as itemtype, 'JAN' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'FEB' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'MAR' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'APR' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'MAY' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'OCT' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'NOV' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'DEC' as monthname, 0 as theval from dual
    select
      itemtype,
      sum (case monthname when 'JAN' then theval else 0 end) as JAN,
      sum (case monthname when 'FEB' then theval else 0 end) as FEB,
      sum (case monthname when 'MAR' then theval else 0 end) as MAR,
      sum (case monthname when 'APR' then theval else 0 end) as APR,
      sum (case monthname when 'MAY' then theval else 0 end) as MAY,
      sum (case monthname when 'JUN' then theval else 0 end) as JUN,
      sum (case monthname when 'JUL' then theval else 0 end) as JUL,
      sum (case monthname when 'AUG' then theval else 0 end) as AUG,
      sum (case monthname when 'SEP' then theval else 0 end) as SEP,
      sum (case monthname when 'OCT' then theval else 0 end) as OCT,
      sum (case monthname when 'NOV' then theval else 0 end) as NOV,
      sum (case monthname when 'DEC' then theval else 0 end) as DEC
    from mytable
    group by itemtype
    order by itemtypeI need an outer query around this one or something that will only select "Type 1"... i.e., if all of the months are each equal to zero, don't include the record in the result set.
    Summing them to get a total of zero is not an option, as I could have -15 and +15 in different columns, in which case, that record would need to be displayed.
    Something as simple as... "where not (oct = 0 and nov = 0 and dec = 0...) at the end is all I seem to need. I've thought about adding a case clause for each column, but that doesn't seem very efficient. Ideas?
    Thanks in advance!
    Mark
    Edit... I know the following will work using the MINUS operator, but my real query is really huge, and I don't want to have to write it twice...
    {code}
    select
    itemtype,
    sum (case monthname when 'JAN' then theval else 0 end) as JAN,
    sum (case monthname when 'FEB' then theval else 0 end) as FEB,
    sum (case monthname when 'MAR' then theval else 0 end) as MAR,
    sum (case monthname when 'APR' then theval else 0 end) as APR,
    sum (case monthname when 'MAY' then theval else 0 end) as MAY,
    sum (case monthname when 'JUN' then theval else 0 end) as JUN,
    sum (case monthname when 'JUL' then theval else 0 end) as JUL,
    sum (case monthname when 'AUG' then theval else 0 end) as AUG,
    sum (case monthname when 'SEP' then theval else 0 end) as SEP,
    sum (case monthname when 'OCT' then theval else 0 end) as OCT,
    sum (case monthname when 'NOV' then theval else 0 end) as NOV,
    sum (case monthname when 'DEC' then theval else 0 end) as DEC
    from mytable
    group by itemtype
    minus
    select
    itemtype,
    jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec
    from (
    select
    itemtype,
    sum (case monthname when 'JAN' then theval else 0 end) as JAN,
    sum (case monthname when 'FEB' then theval else 0 end) as FEB,
    sum (case monthname when 'MAR' then theval else 0 end) as MAR,
    sum (case monthname when 'APR' then theval else 0 end) as APR,
    sum (case monthname when 'MAY' then theval else 0 end) as MAY,
    sum (case monthname when 'JUN' then theval else 0 end) as JUN,
    sum (case monthname when 'JUL' then theval else 0 end) as JUL,
    sum (case monthname when 'AUG' then theval else 0 end) as AUG,
    sum (case monthname when 'SEP' then theval else 0 end) as SEP,
    sum (case monthname when 'OCT' then theval else 0 end) as OCT,
    sum (case monthname when 'NOV' then theval else 0 end) as NOV,
    sum (case monthname when 'DEC' then theval else 0 end) as DEC
    from mytable
    group by itemtype
    where ( oct = 0 and nov = 0 and dec = 0 and jan = 0 and feb = 0 and mar = 0
    and apr = 0 and may = 0 and jun = 0 and jul = 0 and aug = 0 and sep = 0
    order by itemtype
    {code}
    Edit again... Ok, I guess I'm answering my own question here, but I think using a WITH clause to write the main query once and then selecting * from it twice using the MINUS operator in between where the second query has where (oct = 0, etc.) is what I need. If anyone else has better suggestions, please do let me know! Here's the pseudo logic for what I've come up with so far...
    {code}
    WITH mainquery as (select everything)
    select * from mainquery
    minus
    select * from mainquery where (oct = 0, nov = 0, etc...)
    {code}
    Thanks again!
    Mark
    Edited by: user455268 on Mar 1, 2012 7:13 PM
    Edited by: user455268 on Mar 1, 2012 7:16 PM

    Hi,
    You can do that with a HAVING clause:
    select
      itemtype,
      sum (case monthname when 'JAN' then theval else 0 end) as JAN,
      sum (case monthname when 'FEB' then theval else 0 end) as FEB,
      sum (case monthname when 'MAR' then theval else 0 end) as MAR,
      sum (case monthname when 'APR' then theval else 0 end) as APR,
      sum (case monthname when 'MAY' then theval else 0 end) as MAY,
      sum (case monthname when 'JUN' then theval else 0 end) as JUN,
      sum (case monthname when 'JUL' then theval else 0 end) as JUL,
      sum (case monthname when 'AUG' then theval else 0 end) as AUG,
      sum (case monthname when 'SEP' then theval else 0 end) as SEP,
      sum (case monthname when 'OCT' then theval else 0 end) as OCT,
      sum (case monthname when 'NOV' then theval else 0 end) as NOV,
      sum (case monthname when 'DEC' then theval else 0 end) as DEC
    from mytable
    group by itemtype
    HAVING      MIN (theval)     != 0
    OR      MAX (theval)     != 0
    order by itemtype
    ;If the values are all 0, then the MIN and the MAX will both be 0.
    If either the MIN or the MAX is not 0, then the values are not all 0.
    This assumes that the combination (itemtype, monthname) is unique, as it is in your sample data.
    If that's not the case, start with a subquery that GROUPs BY itemtype, monthname, so that, when you get to the main query, that combination will be unique.

  • Loading 361000 records at a time from csv file

    Hi,
    One of my collegue loaded 361000 records from one file file , how is this possible as excel accepts 65536 records in one file
    and even in the infopackage the following are selected what does this mean
    Data Separator   ;
    Escape Sign      "
    Separator for Thousands   .
    Character Used for Decimal Point   ,
    Pls let me know

    hi Maya,
    it just possible, other than ms-excel, we have editor like Textpad that support more 65k rows (and windows Notepad), the file may be generated by program or edited outside in excel, or newer version of excel is used, ms-excel 2007 support more 1 million rows.
    e.g we have csv file
    customer;product;quantity;revenue
    a;x;"1.250,25";200
    b;y;"5.5";300
    data separator ;
    - char/delimeter used to separate field, e.g
    escape sign, e.g
    - "1.250,25";200 then quantity = 1.250,25
    separator for thousands = .
    - 1.250,25 means one thousand two hundred ...
    char used for decimal point
    - - 1.250<b>,</b>25
    check
    http://help.sap.com/saphelp_nw70/helpdata/en/80/1a6581e07211d2acb80000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/c2/678e3bee3c9979e10000000a11402f/frameset.htm
    hope this helps.

  • How-To allow records with Overlapping Time from SAP R/3

    Hi guys,
    Made reference to SAP Note 336229.
    Maintained my Transfer Rules of <b>Data Source 0HR_PA_PA_1</b> to <b>Info Source 0HR_PA_PA_1</b> and all is green! Unfortunately, still <b>NO</b> data and error IDOC message is " <i>The data request was a full update. In this case, the corresponding table in the source system does not contain any data</i>."
    "<i>The extractor of the DataSource reads the master data tables of the Employee (0EMPLOYEE) and person (0PERSON) InfoObjects and makes changes to these time-dependent attributes available as headcount changes</i>"...<b>says SAP</b>
    Info Object person (0PERSON) works!!!, however Info Object(0EMPLOYEE) is giving me problem whereby <b>in SAP R/3</b> Data Source (Employee - Education and Training) 0EMPLOYEE_0022_ATTR <u>allows</u> time overlapping of records, <b>BUT BW</b> generates an error " The time interval ['99991231'/'19930104'] & (from/to) for the data records 46 and 47 overlaps in characteristic 0EMPLOYEE "
    For example, lets assume there is Employee X with the following entry in SAP R/3.
    Begin Date||| End Date ||| SubType
    01.09.2003||| 01.09.2004||| Professional Cert.
    01.09.2003||| 01.09.2006||| Degree
    SAP R/3 allows this overlapping of time records however, BW does NOT. How can I tackle this overlapping issue in SAP BW?
    With much appreciation!

    Hi guys,
      Please assist to resolve this.
      I attempted to assigned 0DATETO and 0DATEFROM to my attributes of 0EMPLOYEE, but it gives me the following error
    <b>  Characteristic 0EMPLOYEE: Attribute 0DATETO cannot be used w. time-dependent attribte</b>
    <b>  InfoObject 0DATETO cannot be used as an attribute if attibutes already exist that are time-dependent. Attribute 0ANSALARY is such an attribute. A field in the InfoObject 0DATETO is automatically generated in the master data table.</b>
      Once again, what I want is to be able to allow the Records with HighDate in R/3 into my BW Cubes.
      Please please assist !

Maybe you are looking for

  • Memory upgrade | PC won't boot

    Hi everyone. I've just upgraded my memory from 256MB to 1GB, I took out the 256 one and only inserted 1GB one so that they don't clash as they are of different makes. Now when I start up my PC, my monitor says 'Monitor is working, check you PC or cab

  • Acrobat DC - wrong color when opening document

    I've set up color management via Adobe Bridge for Indesign, Photoshop, Illustrator and Acrobat. After updating to Acrobat DC I had to synchronize via bridge again. Now it says "synched". BUT: When I open a document the colors the colors are not shown

  • I have an iPad and when I FaceTime someone and they answer it continues to say connecting and will never connect how do I fix this problem

    I would like to just figure how to fix this problem it has been 2 days and I have tryed everything and FaceTime will still not work.

  • Remove password / policy block

    I got an old 8100 which has been victim to an overzealous IT department and been hacked I think to prevent users changing the IT policy.I am trying to disable the password setting, or at least change the requirements - it's currently 8 characters inc

  • Invalid Photoshop Document PLEASE HELP

    Yesterday night I was painting a picture on Photoshop, and I saved then closed my laptop to go to bed. Today I tried to open the file again, but it said that Photoshop could not complete my request due to it being an invalid document. I am both shock