Help needed for grouping.

Hi,
    Help needed .
I have an internal table having 6 .
Ex :
f1     f2    f3     f4    f5    f6
a     aa    11    p1  10    10
a     aa    12    p1  20    20
b     aa    11    p2  30    30
b     aa    12    p2  40    30
Now i want to sum the fields f5 and f6 individually and need to display based upon the fields f1 and f4.
To Display :
f1     f2    f3     f4    f5    f6
a     aa    11    p1  30    30.
b     aa    11    p2  70    60.
can anyone help me.How to do this..?
Thanks

Here you go
DATA:
  BEGIN OF cur_tab OCCURS 0,
    f1        TYPE c,
    f2(2)     TYPE c,
    f3(2)     TYPE c,
    f4(2)     TYPE c,
    f5(2)     TYPE c,
    f6(2)     TYPE n,
  END OF cur_tab.
DATA:
  BEGIN OF sum_tab OCCURS 0,
    f1        TYPE c,
    f4(2)     TYPE c,
    f5        TYPE p,
    f6        TYPE p,
  END OF sum_tab.
DATA:
  BEGIN OF final_tab OCCURS 0,
    f1        TYPE c,
    f2(2)     TYPE c,
    f3(2)     TYPE c,
    f4(2)     TYPE c,
    f5(5)     TYPE c,
    f6(5)     TYPE c,
  END OF final_tab.
START-OF-SELECTION.
  cur_tab-f1 = 'a'.
  cur_tab-f2 = 'aa'.
  cur_tab-f3 = '11'.
  cur_tab-f4 = 'p1'.
  cur_tab-f5 = '10'.
  cur_tab-f6 = '10'.
  APPEND cur_tab.
  cur_tab-f1 = 'a'.
  cur_tab-f2 = 'aa'.
  cur_tab-f3 = '11'.
  cur_tab-f4 = 'p1'.
  cur_tab-f5 = '20'.
  cur_tab-f6 = '20'.
  APPEND cur_tab.
  cur_tab-f1 = 'b'.
  cur_tab-f2 = 'aa'.
  cur_tab-f3 = '11'.
  cur_tab-f4 = 'p2'.
  cur_tab-f5 = '30'.
  cur_tab-f6 = '30'.
  APPEND cur_tab.
  cur_tab-f1 = 'b'.
  cur_tab-f2 = 'aa'.
  cur_tab-f3 = '11'.
  cur_tab-f4 = 'p2'.
  cur_tab-f5 = '40'.
  cur_tab-f6 = '30'.
  APPEND cur_tab.
  LOOP AT cur_tab.
    MOVE-CORRESPONDING cur_tab TO sum_tab.
    COLLECT sum_tab.
  ENDLOOP.
  LOOP AT sum_tab.
    READ TABLE cur_tab WITH KEY f1 = sum_tab-f1
                                f4 = sum_tab-f4.
    IF sy-subrc NE 0.
      WRITE:/ 'Something went very wrong'.
      CONTINUE.
    ENDIF.
    MOVE-CORRESPONDING cur_tab TO final_tab.
    MOVE-CORRESPONDING sum_tab TO final_tab.
    APPEND final_tab.
  ENDLOOP.
  LOOP AT final_tab.
    WRITE:/1 final_tab-f1,
          AT 5 final_tab-f2,
          AT 10 final_tab-f3,
          AT 15 final_tab-f4,
          AT 20 final_tab-f5,
          AT 25 final_tab-f6.
  ENDLOOP.
and the output
a   aa   11   p1     30   30  
b   aa   11   p2     70   60  

Similar Messages

  • URGENT HELP NEEDED FOR GROUP BY

    SELECT curve_date, curve_id, curve_type, curve_name, curve_instance, is_simple,
    comments, curve_currency, curve_generator, curve_interpolator, holidays,
    user_name, rate_index, daycount_code, frequency_code, rate_index_tenor,
    time_zone
    FROM curve a
    WHERE curve_date = (SELECT max(curve_date)
    FROM curve b
    WHERE b.curve_id = a.curve_id
    GROUP BY curve_id)
    I have this query ..This query does the FULL TABLE SCAN .....PLEASE Suggest some easier way to optimize this query.....I need it VERY VERY URGENTLY....

    SELECT curve_date, curve_id, curve_type, curve_name, curve_instance, is_simple,
    comments, curve_currency, curve_generator, curve_interpolator, holidays,
    user_name, rate_index, daycount_code, frequency_code, rate_index_tenor,
    time_zone
    FROM curve
    WHERE (curve_id, curve_date) IN (SELECT curve_id, max(curve_date)
    FROM curve
    GROUP BY curve_id)
    Be sure you have statistics collected on the table. Anyway, I am not sure that Oracle will not do the FTS for this query even if curve_id and curve_date are indexed.

  • Help needed for writing query

    help needed for writing query
    i have the following tables(with data) as mentioned below
    FK*-foregin key (SUBJECTS)
    FK**-foregin key (COMBINATION)
    1)SUBJECTS(table name)     
    SUB_ID(NUMBER) SUB_CODE(VARCHAR2) SUB_NAME (VARCHAR2)
    2           02           Computer Science
    3           03           Physics
    4           04           Chemistry
    5           05           Mathematics
    7           07           Commerce
    8           08           Computer Applications
    9           09           Biology
    2)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2) SUB_ID1(NUMBER(FK*)) SUB_ID2(NUMBER(FK*)) SUB_ID3(NUMBER(FK*)) SUBJ_ID4(NUMBER(FK*))
    383           S1      9           4           2           3
    384           S2      4           2           5           3
    ---------I actually designed the ABOVE table also like this
    3) a)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2)
    383           S1
    384           S2
    b)COMBINATION_DET
    COMBDET_ID(NUMBER) COMB_ID(FK**) SUB_ID(FK*)
    1               383          9
    2               383          4
    3               383          2
    4               383          3
    5               384          4
    6               384          2          
    7               384          5
    8               384          3
    Business rule: a combination consists of a maximum of 4 subjects (must contain)
    and the user is less relevant to a COMB_NAME(name of combinations) but user need
    the subjects contained in combinations
    i need the following output
    COMB_ID COMB_NAME SUBJECT1 SUBJECT2      SUBJECT3      SUBJECT4
    383     S1     Biology Chemistry      Computer Science Physics
    384     S2     Chemistry Computer Science Mathematics Physics
    or even this is enough(what i actually needed)
    COMB_ID     subjects
    383           Biology,Chemistry,Computer Science,Physics
    384           Chemistry,Computer Science,Mathematics,Physics
    you can use any of the COMBINATION table(either (2) or (3))
    and i want to know
    1)which design is good in this case
    (i think SUB_ID1,SUB_ID2,SUB_ID3,SUB_ID4 is not a
    good method to link with same table but if 4 subjects only(and must) comes
    detail table is not neccessary )
    now i am achieving the result by program-coding in C# after getting the rows from oracle
    i am using oracle 9i (also ODP.NET)
    i want to know how can i get the result in the stored procedure itsef.
    2)how it could be designed in any other way.
    any help/suggestion is welcome
    thanks for your time --Pradeesh

    Well I forgot the table-alias, here now with:
    SELECT C.COMB_ID
    , C.COMB_NAME
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID1) AS SUBJECT_NAME1
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID2) AS SUBJECT_NAME2
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID3) AS SUBJECT_NAME3
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID4) AS SUBJECT_NAME4
    FROM COMBINATION C;
    As you need exactly 4 subjects, the columns-solution is just fine I would say.

  • Color management help needed for adobe CS5 and Epson printer 1400-Prints coming out too dark with re

    Color management help needed for adobe CS5 and Epson printer 1400-Prints coming out too dark with reddish cast and loss of detail
    System: Windows 7
    Adobe CS5
    Printer: Epson Stylus Photo 1400
    Paper: Inkjet matte presentation paper with slight luster
    Installed latest patch for Adobe CS5
    Epson driver up to date
    After reading solutions online and trying them for my settings for 2 days I am still unable to print what I am seeing on my screen in Adobe CS5. I calibrated my monitor, but am not sure once calibration is saved if I somehow use this setting in Photoshop’s color management.
    The files I am printing are photographs of dogs with lots of detail  I digitally painted with my Wacom tablet in Photoshop CS5 and then printed with Epson Stylus 1400 on inkjet paper 20lb with slight luster.
    My Printed images lose a lot of the detail & come out way to dark with a reddish cast and loss of detail when I used these settings in the printing window:
    Color Handling: Photoshop manages color, Color management -ICM, OFF no color adjustment.
    When I change to these settings in printer window: Color Handling:  Printer manages color.  Color management- Color Controls, 1.8 Gamma and choose Epson Standard it prints lighter, but with reddish cast and very little detail and this is the best setting I have used so far.
    Based on what I have read on line, I think the issue is mainly to do with what controls are set in the Photoshop Color Settings window and the Epson Printer preferences. I have screen images attached of these windows and would appreciate knowing what you recommend I enter for each choice.
    Also I am confused as to what ICM color management system to use with this printer and CS5:
    What is the best ICM to use with PS CS5 & the Epson 1400 printer? Should I use the same ICM for both?
    Do I embed the ICM I choose into the new files I create? 
    Do I view all files in the CS5 workspace in this default ICM?
    Do I set my monitor setting to the same ICM?
    If new file opens in CS5 workspace and it has a different embedded profile than my workspace, do I convert it?
    Do I set my printer, Monitor and PS CS5 color settings to the same ICM?
    Is using the same ICM for all devices what is called a consistent workflow?
    I appreciate any and all advice that can be sent my way on this complicated issue. Thank you in advance for your time and kind help.

    It may be possible to figure out by watching a Dr.Brown video on the subject of color printing. Adobe tv
    I hope this may help...............

  • File missing (file\BCD error code 0Xc0000034 help need for work!

    file missing (file\BCD  error code 0Xc0000034 help need for work!    what can i do?
    have an p 2000 notebook pc

     Hi bobkunkle, welcome to the HP Forums. I understand you cannot boot passed the error you are receiving.
    What is the model or product number of your notebook? What version of Windows is installed?
    Guide to finding your product number
    Which Windows operating system am I running?
    TwoPointOh
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom to say “Thanks” for helping!

  • Help need for force to signout All session ! how...

    hi
         help need for force to  signout All session !  how ??
    Solved!
    Go to Solution.

    Hi and welcome to the Skype Community,
    To force a signout of all instances your Skype is signed into please change your password: https://support.skype.com/en/faq/FA95/how-do-i-change-my-password
    Follow the latest Skype Community News
    ↓ Did my reply answer your question? Accept it as a solution to help others, Thanks. ↓

  • Help needed for SQL query

    hello ,
    I am a beginner in terms of writing sql queries. I hope some body can help me out.
    I have two tables
    mysql> desc user_group_t;
    ---------------------------------------------------+
    | Field | Type | Null | Key | Default | Extra |
    ---------------------------------------------------+
    | userAccountId | char(8) | | PRI | | |
    | groupId | char(8) | | PRI | | |
    ---------------------------------------------------+
    2 rows in set (0.00 sec)
    mysql> desc group_t;
    ---------------------------------------------------+
    | Field | Type | Null | Key | Default | Extra |
    ---------------------------------------------------+
    | id | char(8) | | PRI | | |
    | name | char(50) | YES | | NULL | |
    | email | char(100) | YES | | NULL | |
    | description | char(254) | YES | | NULL | |
    | parentId | char(8) | YES | | NULL | |
    | creatorId | char(8) | YES | | NULL | |
    | createDate | char(20) | YES | | NULL | |
    | updateDate | char(20) | YES | | NULL | |
    | updatorId | char(8) | YES | | NULL | |
    ---------------------------------------------------+
    9 rows in set (0.00 sec)
    what I want is list of all groups with id,name and #of members(which is the # of rows in the user_group_t for any given id). Importantly I need the groups with 0 members also to be listed. In short my output should contain exactly the same number of rows as in group_t table with an additional column indicating # of members for that group.
    Any help would be greatly appreciated.
    Thanks in Advance.
    -Vasanth

    Thanks Donald,
    Actually I figured it out, with the following query:
    select id,name,sum(if(groupid is not null,1,0)) as members from group_t left join user_group_t on id=groupid group by id;
    I tried your solution, but mysql says there is an error at '+' . Anyway I modified your solution to the one below and it worked.
    select a.id, a.name, count(b.groupid) from group_t a left join user_group_t b on a.id=b.groupid group by a.id, a.name;
    I tried that before but then I used Count(*) instead of count on groupid. Your solution is elagant and I will go with yours.
    Thanks again.
    Vasanth

  • Help Needed For joins

    Hi All,
    I am new to oracle.I have a requirement. i need to display sales fields for a particular time as below.
    Time    Sales
    6-7 3333
    7-8 45345
    8-9 546
    But the min time and max time are coming from different query and sales fields coming from different.Now i need to join both queries to get the results.But there is no common column.I tried with sub query there also i am getting error.Please find the queries and help me
    Hour Group Query:
    select
    time1.*,
    (select if (time_format(dt.curr_time, '%H') <
    time_format(ifnull((SELECT prop_value FROM cust_conv_properties c where prop_key = 'DayStartingTime'), '00:00:00'), '%H'),
    date_format(date_add(dt.curr_time, INTERVAL 0 DAY),'%d/%m/%Y'),
    date_format(dt.curr_time,'%d/%m/%Y')) as curr_date
    from
    (select concat(date_format(str_to_date('23/10/2011','%d/%m/%Y'),'%Y-%m-%d'), ' ', '00:00:00') as curr_time) dt) as report_date
    from
    (select
    -- 'S' temp,
    cast(min(cchg.from_hour) as unsigned) as min_value,
    cast(max(cchg.to_hour) as unsigned) as max_value,
    concat(concat(min(cchg.from_hour),''),'-',concat(max(cchg.to_hour),'')) as time_diff
    from
    cust_conv_hour_group as cchg
    where
    cchg.group_value in (SELECT distinct if(group_value = (SELECT min(group_value) FROM cust_conv_hour_group),
    (SELECT max(group_value) FROM cust_conv_hour_group), group_value-1) as group_value
    FROM cust_conv_hour_group c where from_hour <= cast(time_format('23:00:00','%H') as unsigned)
    and
    to_hour > cast(time_format('00:00:00','%H') as unsigned))
    group by
    cchg.group_value
    ) time1
    Sales Fields Query:
    SELECT
    if(count(cons.wr_tarSale)=0,0, cons.wr_tarSale) wr_tarSale,
    if(count(cons.wr_actSale)=0,0, cons.wr_actSale) wr_actSale,
    if(count(cons.wr_tarTrans)=0,0, cons.wr_tarTrans) wr_tarTrans,
    if(count(cons.wr_actTrans)=0,0, cons.wr_actTrans) wr_actTrans,
    if(count(cons.tarSale)=0,0, cons.tarSale) tarSale,
    if(count(cons.actSale)=0,0, cons.actSale) actSale,
    if(count(cons.varSale)=0,0, cons.varSale) varSale,
    if(count(cons.tarTrans)=0,0, cons.tarTrans) tarTrans,
    if(count(cons.actTrans)=0,0, cons.actTrans) actTrans,
    if(count(cons.actAds)=0,0, cons.actAds) actAds,
    if(count(cons.actUpt)=0,0, cons.actUpt) actUpt,
    if(count(cons.tarAds)=0,0, cons.tarAds) tarAds,
    if(count(cons.tarUpt)=0,0, cons.tarUpt) tarUpt,
    if(count(cons.actConv)=0,0, cons.actConv) actConv,
    if(count(cons.tarTplh)=0,0, cons.tarTplh) tarTplh,
    if(count(cons.actBlank1)=0,0, cons.actBlank1) actBlank1,
    if(count(cons.actBlank2)=0,0, cons.actBlank2) actBlank2,
    if(count(cons.actTplh)=0,0, cons.actTplh) actTplh,
    if(count(cons.sDTarSale)=0,0, cons.sDTarSale)sDTarSale,
    if(count(cons.sDTarTrans)=0,0, cons.sDTarTrans)sDTarTrans,
    if(count(cons.sDTarQty)=0,0, cons.sDTarQty)sDTarQty,
    if(count(cons.sDTarFF)=0,0, cons.sDTarFF)sDTarFF
    FROM
    SELECT
    ifnull(sum(ccsr.target_sale),0) wr_tarSale,
    ifnull(sum(ccsr.actual_sale),0) wr_actSale,
    ifnull(sum(ccsr.actual_transaction_count),0) wr_actTrans,
    ifnull(sum(ccsr.target_transaction_count),0) wr_tarTrans,
    round(ifnull(sum(ccsr.target_sale),0),2) tarSale,
    round(ifnull(sum(ccsr.actual_sale),0),2) actSale,
    round(round(ifnull(sum(ccsr.actual_sale),0),2)- round(ifnull(sum(ccsr.target_sale),0),2),2) varSale,
    round(ifnull(sum(ccsr.actual_transaction_count),0),0) actTrans,
    round(ifnull(sum(ccsr.target_transaction_count),0),0) tarTrans,
    0 actBlank1,
    round(ifnull((sum(ccsr.actual_sale)/sum(ccsr.actual_transaction_count)),0),2) actAds,
    round(ifnull((sum(ccsr.target_sale)/sum(ccsr.target_transaction_count)),0),2) tarAds,
    round(ifnull((sum(ccsr.actual_quantity)/sum(ccsr.actual_transaction_count)),0),2) actUpt,
    round(ifnull((sum(ccsr.target_quantity)/sum(ccsr.target_transaction_count)),0),2) tarUpt,
    round(ifnull((sum(ccsr.actual_transaction_count)/sum(ccsr.actual_footfalls))*100,0),2) actConv,
    0 actBlank2,
    0 actBlank3,
    round(ifnull((sum(ccsr.actual_footfalls)/sum(ccsr.actual_man_hours)),0),2) actTplh,
    round(ifnull((sum(ccsr.target_footfalls)/sum(ccsr.target_man_hours)),0),2) tarTplh,
    round(ifnull(ccsrs.target_sale,0),2) as sDTarSale,
    round(ifnull(ccsrs.target_transaction_count,0),0) as sDTarTrans,
    ifnull(ccsrs.target_quantity,0) as sDTarQty,
    ifnull(ccsrs.target_footfalls,0) as sDTarFF
    FROM
    cust_conv_store_report ccsr
    inner join cust_conv_store_report_summary ccsrs on(ccsrs.brand_code=ccsr.brand_code and ccsrs.category=ccsr.category and
                                  ccsrs.store_date=ccsr.store_date and ccsrs.value_type=ccsr.value_type)
    WHERE
    ccsr.value_type='B' and
    ccsr.brand_code= ? AND
    ccsr.store_date = date_format(str_to_date(?,'%d/%m/%Y'),'%Y-%m-%d')
    AND HOUR((TIME(ccsr.transaction_time))) >= (?) AND HOUR((TIME(ccsr.transaction_time)))< (?)
    GROUP BY
    ccsr.brand_code
    ) cons;
    Edited by: 992887 on Mar 10, 2013 4:25 AM

    992887 wrote:
    Hi All,
    I am new to oracle.code below is NOT valid Oracle syntax.
    post results from valid Oracle SQL below
    SELECT * FROM V$VERSION;
    I have a requirement. i need to display sales fields for a particular time as below.
    Time    Sales
    6-7 3333
    7-8 45345
    8-9 546
    But the min time and max time are coming from different query and sales fields coming from different.Now i need to join both queries to get the results.But there is no common column.I tried with sub query there also i am getting error.Please find the queries and help me
    Hour Group Query:
    select
    time1.*,
    (select if (time_format(dt.curr_time, '%H') <
    time_format(ifnull((SELECT prop_value FROM cust_conv_properties c where prop_key = 'DayStartingTime'), '00:00:00'), '%H'),
    date_format(date_add(dt.curr_time, INTERVAL 0 DAY),'%d/%m/%Y'),
    date_format(dt.curr_time,'%d/%m/%Y')) as curr_date
    from
    (select concat(date_format(str_to_date('23/10/2011','%d/%m/%Y'),'%Y-%m-%d'), ' ', '00:00:00') as curr_time) dt) as report_date
    from
    (select
    -- 'S' temp,
    cast(min(cchg.from_hour) as unsigned) as min_value,
    cast(max(cchg.to_hour) as unsigned) as max_value,
    concat(concat(min(cchg.from_hour),''),'-',concat(max(cchg.to_hour),'')) as time_diff
    from
    cust_conv_hour_group as cchg
    where
    cchg.group_value in (SELECT distinct if(group_value = (SELECT min(group_value) FROM cust_conv_hour_group),
    (SELECT max(group_value) FROM cust_conv_hour_group), group_value-1) as group_value
    FROM cust_conv_hour_group c where from_hour <= cast(time_format('23:00:00','%H') as unsigned)
    and
    to_hour > cast(time_format('00:00:00','%H') as unsigned))
    group by
    cchg.group_value
    ) time1
    Sales Fields Query:
    SELECT
    if(count(cons.wr_tarSale)=0,0, cons.wr_tarSale) wr_tarSale,
    if(count(cons.wr_actSale)=0,0, cons.wr_actSale) wr_actSale,
    if(count(cons.wr_tarTrans)=0,0, cons.wr_tarTrans) wr_tarTrans,
    if(count(cons.wr_actTrans)=0,0, cons.wr_actTrans) wr_actTrans,
    if(count(cons.tarSale)=0,0, cons.tarSale) tarSale,
    if(count(cons.actSale)=0,0, cons.actSale) actSale,
    if(count(cons.varSale)=0,0, cons.varSale) varSale,
    if(count(cons.tarTrans)=0,0, cons.tarTrans) tarTrans,
    if(count(cons.actTrans)=0,0, cons.actTrans) actTrans,
    if(count(cons.actAds)=0,0, cons.actAds) actAds,
    if(count(cons.actUpt)=0,0, cons.actUpt) actUpt,
    if(count(cons.tarAds)=0,0, cons.tarAds) tarAds,
    if(count(cons.tarUpt)=0,0, cons.tarUpt) tarUpt,
    if(count(cons.actConv)=0,0, cons.actConv) actConv,
    if(count(cons.tarTplh)=0,0, cons.tarTplh) tarTplh,
    if(count(cons.actBlank1)=0,0, cons.actBlank1) actBlank1,
    if(count(cons.actBlank2)=0,0, cons.actBlank2) actBlank2,
    if(count(cons.actTplh)=0,0, cons.actTplh) actTplh,
    if(count(cons.sDTarSale)=0,0, cons.sDTarSale)sDTarSale,
    if(count(cons.sDTarTrans)=0,0, cons.sDTarTrans)sDTarTrans,
    if(count(cons.sDTarQty)=0,0, cons.sDTarQty)sDTarQty,
    if(count(cons.sDTarFF)=0,0, cons.sDTarFF)sDTarFF
    FROM
    SELECT
    ifnull(sum(ccsr.target_sale),0) wr_tarSale,
    ifnull(sum(ccsr.actual_sale),0) wr_actSale,
    ifnull(sum(ccsr.actual_transaction_count),0) wr_actTrans,
    ifnull(sum(ccsr.target_transaction_count),0) wr_tarTrans,
    round(ifnull(sum(ccsr.target_sale),0),2) tarSale,
    round(ifnull(sum(ccsr.actual_sale),0),2) actSale,
    round(round(ifnull(sum(ccsr.actual_sale),0),2)- round(ifnull(sum(ccsr.target_sale),0),2),2) varSale,
    round(ifnull(sum(ccsr.actual_transaction_count),0),0) actTrans,
    round(ifnull(sum(ccsr.target_transaction_count),0),0) tarTrans,
    0 actBlank1,
    round(ifnull((sum(ccsr.actual_sale)/sum(ccsr.actual_transaction_count)),0),2) actAds,
    round(ifnull((sum(ccsr.target_sale)/sum(ccsr.target_transaction_count)),0),2) tarAds,
    round(ifnull((sum(ccsr.actual_quantity)/sum(ccsr.actual_transaction_count)),0),2) actUpt,
    round(ifnull((sum(ccsr.target_quantity)/sum(ccsr.target_transaction_count)),0),2) tarUpt,
    round(ifnull((sum(ccsr.actual_transaction_count)/sum(ccsr.actual_footfalls))*100,0),2) actConv,
    0 actBlank2,
    0 actBlank3,
    round(ifnull((sum(ccsr.actual_footfalls)/sum(ccsr.actual_man_hours)),0),2) actTplh,
    round(ifnull((sum(ccsr.target_footfalls)/sum(ccsr.target_man_hours)),0),2) tarTplh,
    round(ifnull(ccsrs.target_sale,0),2) as sDTarSale,
    round(ifnull(ccsrs.target_transaction_count,0),0) as sDTarTrans,
    ifnull(ccsrs.target_quantity,0) as sDTarQty,
    ifnull(ccsrs.target_footfalls,0) as sDTarFF
    FROM
    cust_conv_store_report ccsr
    inner join cust_conv_store_report_summary ccsrs on(ccsrs.brand_code=ccsr.brand_code and ccsrs.category=ccsr.category and
                                  ccsrs.store_date=ccsr.store_date and ccsrs.value_type=ccsr.value_type)
    WHERE
    ccsr.value_type='B' and
    ccsr.brand_code= ? AND
    ccsr.store_date = date_format(str_to_date(?,'%d/%m/%Y'),'%Y-%m-%d')
    AND HOUR((TIME(ccsr.transaction_time))) >= (?) AND HOUR((TIME(ccsr.transaction_time)))< (?)
    GROUP BY
    ccsr.brand_code
    ) cons;
    Edited by: 992887 on Mar 10, 2013 4:25 AM

  • Query help needed for querybuilder to use with lcm cli

    Hi,
    I had set up several queries to run with the lcm cli in order to back up personal folders, inboxes, etc. to lcmbiar files to use as backups.  I have seen a few posts that are similar, but I have a specific question/concern.
    I just recently had to reference one of these back ups only to find it was incomplete.  Does the query used by the lcm cli also only pull the first 1000 rows? Is there a way to change this limit somwhere?
    Also, since when importing this lcmbiar file for something 'generic' like 'all personal folders', pulls in WAY too much stuff, is there a better way to limit this? I am open to suggestions, but it would almost be better if I could create individual lcmbiar output files on a per user basis.  This way, when/if I need to restore someone's personal folder contents, for example, I could find them by username and import just that lcmbiar file, as opposed to all 3000 of our users.  I am not quite sure how to accomplish this...
    Currently, with my limited windows scripting knowledge, I have set up a bat script to run each morning, that creates a 'runtime' properties file from a template, such that the lcmbiar file gets named uniquely for that day and its content.  Then I call the lcm_cli using the proper command.  The query within the properties file is currently very straightforward - select * from CI_INFOOBJECTS WHERE SI_ANCESTOR = 18.
    To do what I want to do...
    1) I'd first need a current list of usernames in a text file, that could be read (?) in and parsed to single out each user (remember we are talking about 3000) - not sure the best way to get this.
    2) Then instead of just updating the the lcmbiar file name with a unique name as I do currently, I would also update the query (which would be different altogether):  SELECT * from CI_INFOOBJECTS where SI_OWNER = '<username>' AND SI_ANCESTOR = 18.
    In theory, that would grab everything owned by that user in their personal folder - right? and write it to its own lcmbiar file to a location I specify.
    I just think chunking something like this is more effective and BO has no built in back up capability that already does this.  We are on BO 4.0 SP7 right now, move to 4.1 SP4 over the summer.
    Any thoughts on this would be much appreciated.
    thanks,
    Missy

    Just wanted to pass along that SAP Support pointed me to KBA 1969259 which had some good example queries in it (they were helping me with a concern I had over the lcmbiar file output, not with query design).  I was able to tweak one of the sample queries in this KBA to give me more of what I was after...
    SELECT TOP 10000 static, relationships, SI_PARENT_FOLDER_CUID, SI_OWNER, SI_PATH FROM CI_INFOOBJECTS,CI_APPOBJECTS,CI_SYSTEMOBJECTS WHERE (DESCENDENTS ("si_name='Folder Hierarchy'","si_name='<username>'"))
    This exports inboxes, personal folders, categories, and roles, which is more than I was after, but still necessary to back up.. so in a way, it is actually better because I have one lcmbiar file per user - contains all their 'personal' objects.
    So between narrowing down my set of users to only those who actually have saved things to their personal folder and now having a query that actually returns what I expect it to return, along with the help below for a job to clean up these excessive amounts of promotion jobs I am now creating... I am all set!
    Hopefully this can help someone else too!
    Thanks,
    missy

  • XMLAGG structure, performance help needed for odd nesting in schema

    Hello,
    I have to produce XML to look like:
    <?xml version='1.0'?>
      <enterprise>
        <membership>
          <sourcedid>
            <id>PHYS_101_001_FA2007</id>
          </sourcedid>
        <!-- NOTE: absence of "members" level tag for XMLAGG! -->
        <member>
          <sourcedid>
            <id>D2LU0001</id>
          </sourcedid>
          <role roletype="Sample Role">
            <status>1</status>
          </role>
        </member>
        <member>
          <sourcedid>
            <id>D2LU0002</id>
          </sourcedid>
          <role roletype="Sample Role">
            <status>1</status>
          </role>
        </member>
      </membership>
    </enterprise>This would be straightforward if the schema allowed for a "<members>" tag under which to nest the <member> tags. But, it does not allow for that tag or any other than those listed above.
    I have a query which does produce that output (except for the roletype attribute), but its performance is horrible; it takes about 40 minutes to return data:
    SELECT
         XMLROOT(
             XMLELEMENT("enterprise",
               XMLAGG(
                 XMLELEMENT("membership",
                   XMLFOREST( XMLELEMENT("id",cx.mapped_course_id) as "sourcedid"
                   (SELECT XMLAGG(
                     XMLELEMENT("member",
                       XMLFOREST(XMLELEMENT("id",spriden_id) AS "sourcedid",
                                 XMLELEMENT("status",'1') AS "role"
                      FROM enrollments_fall_sfrstca efs
                         , spriden sp
                         , gzv_tuid t
                     WHERE sp.spriden_change_ind IS NULL
                       AND sp.spriden_pidm       = t.pidm
                       AND t.tuid                = efs.user_name
                       AND efs.mapped_course_id  = cx.mapped_course_id
                       AND efs.term              = cx.semester
                , VERSION '1.0', STANDALONE NO VALUE)
      FROM courses_xt cx
    WHERE cx.semester = :term_code
    ;Similar queries are producing courses and users XML fine with no performance issues, but these are driven off either the courses view or the enrollments view, but not both.
    Is there some other way I can produce the nesting I need for the vendor's schema?
    The source views are basically as follows (showing relevant columns only):
    courses_xt:
    MAPPED_COURSE_ID       SEMEST
    AVFT209-13307-201210   201210
    AVFT210-13308-201210   201210enrollments_fall_sfrstca:
    MAPPED_COURSE_ID       USER_NAME
    AVFT209-13307-201210    FULLERC8
    AVFT209-13307-201210    SHUPEK
    AVFT209-13307-201210    NOMAN
    AVFT210-13308-201210    SHUPEK
    AVFT210-13308-201210    PELLONMWhen I have the query without the XML (with the subquery as a column of the outer query), this returns the correct data quickly (a couple of minutes).
    I have tried various permutations of XMLFOREST, XMLELEMENT, XMLAGG but either I get syntax errors, or the data is wrong (e.g. repeated '<membership>' for each '<member>', or I have to create an invalid tag '<members>' to be filtered later).
    Please advise!
    Thanks,
    Anita Lees

    Hi Anita,
    Have you tried with a GROUP BY and no subquery?
    Here's an example using SCOTT schema.
    I've used the same tag names and structure so that you can see the analogy :
    SELECT XMLElement("enterprise",
             XMLAgg(
               XMLElement("membership",
                 XMLElement("sourceid", xmlelement("id", d.deptno))
               , XMLAgg(
                   XMLElement("member",
                     XMLElement("sourceid",
                       XMLElement("id", e.empno)
                   , XMLElement("role",
                       XMLAttributes(e.job as "roletype")
                     , XMLElement("status", '1')
    FROM scott.dept d
         LEFT OUTER JOIN scott.emp e ON e.deptno = d.deptno
    WHERE d.deptno IN (10,20)
    GROUP BY d.deptno
    ;which gives :
    <enterprise>
      <membership>
        <sourceid>
          <id>10</id>
        </sourceid>
        <member>
          <sourceid>
            <id>7782</id>
          </sourceid>
          <role roletype="MANAGER">
            <status>1</status>
          </role>
        </member>
        <member>
          <sourceid>
            <id>7934</id>
          </sourceid>
          <role roletype="CLERK">
            <status>1</status>
          </role>
        </member>
        <member>
          <sourceid>
            <id>7839</id>
          </sourceid>
          <role roletype="PRESIDENT">
            <status>1</status>
          </role>
        </member>
      </membership>
      <membership>
        <sourceid>
          <id>20</id>
        </sourceid>
        <member>
          <sourceid>
            <id>7369</id>
          </sourceid>
          <role roletype="CLERK">
            <status>1</status>
          </role>
        </member>
        <member>
          <sourceid>
            <id>7902</id>
          </sourceid>
          <role roletype="ANALYST">
            <status>1</status>
          </role>
        </member>
        <member>
          <sourceid>
            <id>7566</id>
          </sourceid>
          <role roletype="MANAGER">
            <status>1</status>
          </role>
        </member>
      </membership>
    </enterprise>

  • Help needed for using BASIC authentication through JDBCRealm

    Help needed.
    Hello,
    I am doing a degree project, so far it works fine in my local machine, I need to try it on my virtual hosting (as it is a live server).
    My project requires JDBCRealm, that is BASIC authentication loading access data from mysql database. Normally this setup can be done in Server.xml file, because my Tomcat hosting is a virtual one, I only have permission to access the web.xml file.
    My question is: is it possible to get it done in an alternative way? In web.xml? Some properties file maybe?
    Thank you very much.

    You can set this up for your context using META-INF/context.xml instead of working with server.xml.
    Make a directory called META-INF under your webapp ( it'll be at the same level as WEB-INF ). Under this, add a context.xml with all your context specific configuration including the realm. A sample is below
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/myApp" reloadable="true">
        <Realm
            className="org.apache.catalina.realm.JDBCRealm"            
            driverName="com.microsoft.jdbc.sqlserver.SQLServerDriver"         
            connectionURL="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=myDB;SelectMethod=Cursor;"
            connectionName="username" connectionPassword="password"
            digest="MD5" userTable="users" userNameCol="userid" userCredCol="userpassword"
            userRoleTable="user_roles" roleNameCol="rolename"
        />
    </Context>Hope this helps.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

  • Help Needed for T42 Start-up Problem

    Urgent help need!!!
    I have a ThinkPad T42 with Windows XP installed.  It works perfectly for a while without ever have any problem or error message.  Then suddenly it won’t work anymore.  The symptom is following:
    After power on the laptop the Microsoft window would show up and it prompt me for window logon password.  After I type in the password it then shows “window is loading your personal setting”.  After a long while nothing would show up on the screen other than the background of the normal screen.  There is no window bar at the bottom or any icon on the screen.  If I start in safe mode then everything would show up.  I don’t know what is going on.
    This happened two months ago and I ended up restoring a backup image to get it work again.  It happens again today with the same symptom.  I am really tired of having to restore image backup every 2 months. 
    I would really appreciate it if any of your experts can offer me some insight into this problem.  I am desperate in need of help.
    Thanks very much!

    wangy26, welcome to the forum,
    Have a look at this thread to see if my post there helps. The problem seems to mostly occur at the start of a month, why I don't know. Unfortunately the member didin't report back whether or not this was a viable solution for them.
    Andy  ______________________________________
    Please remember to come back and mark the post that you feel solved your question as the solution, it earns the member + points
    Did you find a post helpfull? You can thank the member by clicking on the star to the left awarding them Kudos Please add your type, model number and OS to your signature, it helps to help you. Forum Search Option T430 2347-G7U W8 x64, Yoga 10 HD+, Tablet 1838-2BG, T61p 6460-67G W7 x64, T43p 2668-G2G XP, T23 2647-9LG XP, plus a few more. FYI Unsolicited Personal Messages will be ignored.
      Deutsche Community     Comunidad en Español    English Community Русскоязычное Сообщество
    PepperonI blog 

  • Help need for badi method me_process_po_cust~check

    Dear All expert
    Pl see following thread
    I am stuck
    Help needed
    http://scn.sap.com/thread/3610303

    See the issue here is HOLD feature in PO should not be there if it meets the error condition.
    For this you can refer another BADI for this purpose ME_HOLD_PO.
    Refer one of my previous threads below , it might be helpful :
    Held Purchase order need not be created.
    Reiterating a thread related to same topic is not a good practice.

  • W530 SSD and Memory help needed for high performanc​e systems.

    Hi Guys,
    After dealing with lots of laptops that got destroyed by daily use, our organizations is considering ordering 25 Thinkpad W530 laptops from Lenovo and we hope that they last a little longer.
    Our main usage is video editing and design so we have chosen the best that Lenovo has to offer as far as hardware.
    Since Lenovo charges arm and a leg for SSD and 16GB memories, we have decided to purchase these separately and upgrade ourselves.
    Knowing the high need for performance, what would you recommend for 128GB SSD and 16GB memory?
    The laptops are all coming with 7200 RPM drives for storage so the SSD is mainly for programs and the OS.
    For the drive bay, does this part sound right to you? http://shop.lenovo.com/us/itemdetails/0A65623/460/​89555ADB1CE946DA80E0E5D6FE77B164
    This would be used for the HDD and the SSD would be moved to main HDD location.
    Is there anything else we should know about these laptops?
    Thank you in advanced for your time and all suggestions are welcomed.
    Cheers,
    Chris
    Solved!
    Go to Solution.

    I installed 32GB (4x8GB) of Corsair Vengeance RAM, and it has been working wonderfully since day 1.
    Thinkpad W530, i7-3720QM, 1920x1080 screen, 32GB RAM, dual SSDs (Samsung 830, Crucial M4 mSATA), Quadro K2000M, 9-cell battery, DVD burner, backlit keyboard, Bluetooth, Intel 6300 wireless card

  • Help needed for THE decision

    Hi everyone ☺
    I’m finally planning to start recording what I play, and after some hours of wandering on the web I found some interesting possibilities. Now what I need is to decide which one is more suitable for my needs, and here comes the moment for apple discussions
    Basically, I will record my own music one track/instrument at a time (I’m still not able to play more than one…and I dont’ want to spend 2.000$ to buy a 24-ins device just to record drum tracks), I’d like to have a software with built-in effects for guitar/bass/voice, integrated soundtrack possibilities (to play with video recordings), mixing options for both stereo and surround mixing, and I don’t want any card to be placed into my mac. Well, and obviously the sound quality must be pro-like…as anyone probably wants.
    So, here’s what I came up with:
    a) getting logic pro studio 8 and apogee duet
    b) getting pro tools m-powered and mbox 2
    c) getting one of the two softwares and a Monster iStudioLink Instrument cable and plug instruments directly into the mac
    Now, the questions are:
    if I can plug an instrument directly into my mac and control all parameters via one of the two softwares, what do tools like duet and mbox2 serve for?
    In the case this tools are useful [ ☺ ], why ☺ … and which is the couple software/hardware that can best suit my needs?
    I assume that every software has a proprietary file extension in which audio tracks are saved, so that it should be impossible to record an audio track with one software and edit it with another that has different functions/plugins (ex. from logic to pro tools, from pro tools to cakewalk sonar which I have on a pc etc.). Am I right, or is there any “standard”, non compressed high quality file type in which track can be saved and exported to be edited with different softwares?
    I know that from this post it may easily seem that I’m a hopeless digital idiot, but I swear the situation is not really that bad so no need for the kind of explanations with drawings like the ones you find in the “for dummies” guides lol so every experts’ advice will be greatly appreciated
    Neptune

    Thank you Bee Jay and Pancenter for the lighting-fast and useful answers
    now I am aware that an interface IS NEEDED lol (that means they are not produced without a reasons, are they?). I know Pro Tools is the industry standard but I don't like anyone/anything to tie me to their choices/interests (so that's why I was asking about Pro Tools, knowing that there's some sort of "hardware threat"). What I look for is just quality and if I understood what you both mean, as far as this aspect is concerned, Logic and Pro Tools are substantially comparable...isn't it? On the interfaces side, I already checked the Saffire ones (they seem quite good, and cross-platform use is definitely a plus), I will check the others mentioned and will let you know In fact, I didn't consider the "platform problem" but, as I wrote, I also own a PC with an Audigy 2 soundcard (midi/analog/optical/digital inputs/outputs and firewire port...not Madonna's private studio, but not as sad as Mac's little hole) and Sonar 6 Producer Edition, so that has been a really good point to ponder. And now, in the middle of this software/hardware battle...any personal suggestions based on tests/personal experience?

Maybe you are looking for

  • Office 2010 home and student

    I am setting up a business that will depend on me being to change websites and some othern things so I really have multiple questions.     First. This is a very sophisticated Sales system that is using multiple computers. I have Dell Desktop. Windows

  • Associative Array error

    I am using a couple associative arrays in my code and comparing the data in one, and if it is an asterisk, I change it to use the data in the other. Here is the meat of my code. I am running into an error at the bolded line saying I have too many val

  • Synchro from ipod mini to iTunes

    I had to reinstall itunes after formation the hard drive. All my collected songs are stored in my ipod. If I now start to sychro with iTunes, do I lose all my music??

  • ImportData by "onload" event

    I am using javascript to dynamically load XML into a form using: xfa.host.importData("test.xml"); This works fine using a button after the page has loaded, but when I put this code in an Initialize event it does not work. I have also tried call the b

  • Changing BADI properties

    Hi, Can I change properties of existing BADI? Suppose, for an existing method of an existing BADI, can I add more parameters? Does it effect existing functionality?(I think NO) When I try to change the BADI proprties, it is asking for ACCESS KEY. Thn