ALV doesn't go back

Hi Experts,
based on the SAP ALV example for "cl_salv_table" I wrote an ALV report. The first screen is for data selection. After this the ALV grid is displayed.
The problem is that the standard back button doesn't work as expected. So after clicking on "direct processing (F8)" in SE80 the selection screen is being opened. Here the back button works fine and it switches back to SE80.
When having selected some values and processed the report so the ALV grid is being displayed the click on back button results in an empty screen just with the title headline of the report. There I would expect the selection screen to be.
When clicking on the back button at this empty screen the report is being processed again and the ALV grid pops up. From there on its something like a endless loop: back to empty screen - back to ALV grid; back to empty screen - back to ALV grid; ...
The PF Status is defined. The OK-Code is defined. After clicking on the back button the standard PAI-Module is being loaded.
The following is the part where I declare the ALV grid:
TRY.
  cl_salv_table=>factory(
      EXPORTING
        list_display = IF_SALV_C_BOOL_SAP=>FALSE
      IMPORTING r_salv_table = alv
      CHANGING t_table = lt_report_tab ).
  alv->set_screen_status(
    pfstatus = 'MAIN'
    report = sy-repid
    set_functions = alv->c_functions_all ).
  alv_events = alv->get_event( ).
  create object event_handler.
  set handler event_handler->on_double_click for alv_events.
*  Set up selections.
  g_selections = alv->get_selections( ).
  g_selections->set_selection_mode( 1 ). "Single
  alv->display( ).
CATCH cx_salv_msg.
  MESSAGE 'ALV display was not possible' TYPE 'I' DISPLAY LIKE 'E'.
ENDTRY.
Any Ideas what could be wrong with my coding?
Many thanks in advance!
Best regards
Tobias

The function code is: &F03
alternativley I already tried BACK with the same result.
Where shall I put the LEAVE TO SCREEN 0 when it's using the standard PAI Module which is NOT included within my Report?

Similar Messages

  • I have a iPhone 4 and lately it has been shutting down randomly when I still have battery left. It also doesn't turn back on, until I plug it in to the charger. But when I plug it in, the low battery sign shows up then comes to the lock screen with 68%.

    I have a iPhone 4 and lately it has been shutting down randomly when I still have battery left. It also doesn't turn back on, until I plug it in to the charger. But when I plug it in, the low battery sign shows up then comes to the lock screen with like 68% left.

    Morning Clementine Lin,
    For more information this, please see this article:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/ts2802
    Take a look at the Will not turn on, will not turn on unless connected to power, or unexpected power off section.
    Have a nice day,
    Mario

  • Hi, I upgraded my girlfriend's iPad 2 using my iMac, however, her iPad was sync with her PC. Although I've made backup earlier, when I restore from backup the apps doesn't sync back, neither her documents on pages. How can I put then back to her iPad?

    Hi, I upgraded my girlfriend's iPad 2 using my iMac, however, her iPad was sync with her PC. Although I've made backup earlier, when I restore from backup the apps doesn't sync back, neither her documents on pages. How can I put then back to her iPad?

    The backup saves many settings, but it copies photos and other files from the computer back to the iPad after IOS5 wipes the disk.   Plugging it into her computer will re-sync it.

  • IPad Calendar doesn't sync back to iCloud nor Mac

    Hello all,
    I have a strange issue that, since a few days, the iPad-based, iCloud-linked calendar doesn't sync back to iCloud. Hence, for that reason, the calendar on the Mac isn't in sync, and this is, as you can guess, pretty annoying. iPad runs iPhone OS 6.1, and the Mac runs Snow Leopard. I manually configured the calendar portion of iCloud as indicated, and sync between iCal (Mac) and iCloud doesn't suffer any delay.
    Additional information: when initially reinstalled, the iPad has two sets of calendars: one locally synced with the Mac, the other being iCloud, and there's overlap between the two, thanks to this pesky sync problem. I really appreciate the convenience of iCloud, but can't go without the safety of local sync. I may go days without manually syncing the iPad with iTunes but still, iCal is my lifeline, and any defect in keeping updated or worse, losing events will result in serious profesional consequences. It already happened in the days before iCloud.
    iCloud-related information: my Apple ID is an email that has been dead for years. Since I used it heavily before the mailing privider ceased activities, I couldn't practically restart from scratch, so I am currently using this "fossil" login along with an updated Yahoo contact adress, and recently added an @me.com adress from iCloud. The latter is the adress is the one used to connect to iCloud's calendar from iCal, and works nicely.
    However, the iPad, despite being configured with iCloud natively, doesn't update. I restarted it, but since the most up-to-date calendar is on the iPad and un-synced, so far I didn't try deleting and re-adding iCloud to the iPad as it would delete events added since.
    What could cause the iPad to lose sync with iCloud, and how to solve that and prevent it from happening again?

    David, nice to hear from you again, hope you are well.
    This user tip might help you understand how accounts work with Address Book.
    I believe you have duplicates because you have two sets of contacts. "iCloud" and "On My Mac". Once you have created all your contacts in the iCloud account, you should delete them from On My Mac.
    You can move contacts simply by dragging and dropping from one account to the other, you don't need to export them all to the desktop (although doind so will serve as a good back up if all goes wrong). You should note that this copies them though rather than simply move them, so you'll need to delete the old set when you are done.
    As for preserving groups from the On My Mac Account, you can't but you can simplify recreating them by copying contacts (drag and drop) from an on my mac group to an empty group in iCloud.
    Not sure about the contacts that you are struggling to move.
    Many aspects of iCloud are difficult to understand, have a mull through what I've said so far and come back if everything still doesn't fall into place.

  • Why doesn't the "back" button work all the time in Safari?

    Why doesn't the "back" button work all the time in Safari?

    thanks for the reply. You prompted me to check and I realised it wasn't installed on my test laptop and opening in Microsoft Reader. I've installed it now and it works.
    My next challenge is to prevent the mailto: command opening Microsoft Mail instead of Outlook, but I guess every user will have a different default.
    Thank you

  • Sql query is hung, doesn't comes back

    Hello Every one,
    Two node Rac on Linux 5 64-bit, 11.2.0.1.0
    In our data ware housing environment, i have a sql query which doesn't comes back at all, when i run, it is just hung for a long time with no output. I did following basic testing
    1. All the indexes are valid and stats are up to date(count(*) matches num rows)
    2. There is a union clause in the query, i divided the query in two parts - the first part prior to union and second part after union, then i ran those two parts separately - the first part comes back quickly with no rows selected but the second part has a main problem(its just hung).
    Please note that one table in the query has a partitioned table. following is the query and the tables involved in it.
    Please let me know if you need any further information, it will be of great help if i get through this. Thanks in advance.
    OWNER                          TABLE_NAME                     STATUS   LAST_ANAL   NUM_ROWS
    MAINTENANCE_DM                 D_VEHICLE                      VALID    21-NOV-12     752590
    PTL_HOLD                       R_COMP_CODES                   VALID    21-NOV-12        108
    PTL_HOLD                       USER_GEO                       VALID    20-DEC-12        300
    PTL_EDW                        D_CUSTOMER                     VALID    20-DEC-12     219498
    PTL_EDW                        D_LOCN                         VALID    20-DEC-12      19456
    PTL_EDW                        D_VEHICLE                      VALID    20-DEC-12    3973271
    PTL_EDW                        F_VEH_LOCN                     VALID    20-DEC-12    3131138
    PTL_EDW                        F_RO_DETL                      VALID    21-NOV-12   29234052
    8 rows selected.
    SELECT
      '../../opendoc/',
      '&hideSave=true&hideEdit=true&hideRefresh=true&hideUserPromptInput=true',
      'Data As Of:',
      'Run Date:',
      ptl_hold.get_stgextr_time('FACT_FPNA_RO'),
      'RO Date',
      PTL_EDW.F_RO_DETL.RO_TYP,
      PTL_EDW.D_CUSTOMER.CUST_NUM,
      (PTL_EDW.D_CUSTOMER.CUST_NUM )||' - '||( PTL_EDW.D_CUSTOMER.CUST_PRIME_NM),
      PTL_EDW.D_CUSTOMER.BILL_GRP,
      CASE WHEN PTL_EDW.D_LOCN.CORP_CD='HPTL' THEN 'US' ELSE CASE WHEN  PTL_EDW.D_LOCN.CORP_CD='2000' THEN 'CANADA' ELSE 'UNKNOWN' END END,
      PTL_EDW.D_LOCN.REGN_NUM,
      PTL_EDW.D_LOCN.REGN_NUM ||' - '||PTL_EDW.D_LOCN.REGN_NM,
      PTL_EDW.D_LOCN.AREA_NUM,
      PTL_EDW.D_LOCN.AREA_NUM||' - '||PTL_EDW.D_LOCN.AREA_NM,
      PTL_EDW.D_LOCN.RDIST_NUM,
      PTL_EDW.D_LOCN.RDIST_NUM||' - '||PTL_EDW.D_LOCN.RDIST_NM,
      PTL_EDW.D_LOCN.DIST_NUM,
      PTL_EDW.D_LOCN.DIST_NUM||' - '||PTL_EDW.D_LOCN.DIST_NM,
      CASE WHEN TRIM(PTL_EDW.D_VEHICLE.VEH_CAP_STAT) IN ('ACTIVE','ACCRUED') THEN 'Active' ELSE 'Inactive' END,
      DECODE(PTL_EDW.D_VEHICLE.CONTR_GRP, 'X' ,'NON-CONTRACT',PTL_EDW.D_VEHICLE.VEH_CAT),
      PTL_EDW.D_VEHICLE.VEH_UNIT_TYP,
      PTL_EDW.D_VEHICLE.VEH_MODL_YR,
      PTL_EDW.D_VEHICLE.VEH_MAKE,
      PTL_EDW.D_VEHICLE.VEH_MODEL,
      CASE WHEN ( PTL_HOLD.R_COMP_CODES.COMP_CD ) IN ('057','061') THEN 'Accident/Incident' ELSE 'Non-Accident/Incident' END,
      PTL_HOLD.R_COMP_CODES.COMP_CD,
      PTL_HOLD.R_COMP_CODES.COMP_DESC,
      PTL_HOLD.R_COMP_CODES.COMP_CD||' - '||PTL_HOLD.R_COMP_CODES.COMP_DESC,
      PTL_EDW.D_VEHICLE.UNIT_NUM,
      PTL_EDW_D_RO_LOCN.DIST_NUM || PTL_EDW_D_RO_LOCN.DIST_SUFX ||  PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM,
      PTL_EDW_D_RO_LOCN.DIST_NUM || PTL_EDW_D_RO_LOCN.DIST_SUFX || PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM || PTL_EDW.F_RO_DETL.RO_SEQ_NUM
      PTL_EDW.F_RO_DETL.RO_SRC,
      PTL_EDW.F_RO_DETL.TOTAL_LABOR_HRS,
      PTL_EDW.F_RO_DETL.TOTAL_LABOR_COST,
      PTL_EDW.F_RO_DETL.OUT_COST,
      PTL_EDW.F_RO_DETL.PARTS_COST,
      PTL_EDW.F_RO_DETL.RO_COST,
      TO_CHAR(PTL_EDW_D_RO_LOCN.LOCN_KEY),
      PTL_EDW.F_RO_DETL.RO_NUM,
      PTL_EDW.F_RO_DETL.RO_SEQ_NUM,
      PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM
    FROM
      PTL_EDW.F_RO_DETL,
      PTL_EDW.D_CUSTOMER,
      PTL_EDW.D_LOCN,
      PTL_EDW.D_VEHICLE,
      PTL_HOLD.R_COMP_CODES,
      PTL_EDW.D_LOCN  PTL_EDW_D_RO_LOCN,
      PTL_EDW.D_LOCN  PTL_EDW_D_CHRG_LOCN,
      PTL_EDW.D_TIME,
      PTL_EDW.D_LOCN  CURRENT_VEH_LOCN,
      PTL_EDW.F_VEH_LOCN,
      PTL_EDW.D_VEHICLE  CURRENT_VEH
    WHERE
      ( PTL_EDW.F_RO_DETL.CUST_KEY=PTL_EDW.D_CUSTOMER.CUST_KEY  )
      AND  ( PTL_EDW.F_RO_DETL.LOCN_KEY=PTL_EDW.D_LOCN.LOCN_KEY  )
      AND  ( PTL_EDW.D_TIME.TIME_KEY=PTL_EDW.F_RO_DETL.RO_TIME_KEY  )
      AND  ( PTL_EDW.D_VEHICLE.VEH_KEY=PTL_EDW.F_RO_DETL.VEH_KEY  )
      AND  ( PTL_EDW_D_RO_LOCN.LOCN_KEY=PTL_EDW.F_RO_DETL.RO_LOCN_KEY  )
      AND  ( PTL_EDW.F_RO_DETL.CHRG_LOCN_KEY=PTL_EDW_D_CHRG_LOCN.LOCN_KEY  )
      AND  ( CURRENT_VEH_LOCN.LOCN_KEY=PTL_EDW.F_VEH_LOCN.LOCN_KEY  )
      AND  ( CURRENT_VEH.SCD_FLG='A'  )
      AND  ( CURRENT_VEH.CONTR_GRP='P'  )
      AND  ( CURRENT_VEH.CORP_CD=PTL_EDW.D_VEHICLE.CORP_CD and CURRENT_VEH.UNIT_NUM=PTL_EDW.D_VEHICLE.UNIT_NUM  )
      AND  ( CURRENT_VEH.VEH_KEY=PTL_EDW.F_VEH_LOCN.VEH_KEY  )
      AND  ( PTL_HOLD.R_COMP_CODES.COMP_CD=PTL_EDW.F_RO_DETL.COMP_CD  )
      AND 
       ( 'Accounting Month' = 'RO Date'  )
       AND
       ( '2500' = 'NO-MIN'
    OR    EXISTS(SELECT RO_TOTAL_COST.RO_LOCN_KEY, RO_TOTAL_COST.ORIGINAL_RO_NUM 
    FROM      PTL_EDW.F_RO_DETL RO_TOTAL_COST,
        PTL_EDW.D_TIME DTIME
    WHERE
        ('I' = 'I'
        OR ('I' = 'E'
            AND RO_TOTAL_COST.RO_TYP  <>  'W'))
        AND RO_TOTAL_COST.RO_LOCN_KEY = PTL_EDW.F_RO_DETL.RO_LOCN_KEY
        AND RO_TOTAL_COST.ORIGINAL_RO_NUM = PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM
        AND RO_TOTAL_COST.RO_TIME_KEY = DTIME.TIME_KEY
        AND DTIME.CALENDAR_DT BETWEEN to_date('2011-JAN-01') AND to_date('2012-SEP-24')
    GROUP BY
        RO_TOTAL_COST.RO_LOCN_KEY,
        RO_TOTAL_COST.ORIGINAL_RO_NUM
    HAVING
    Sum(RO_TOTAL_COST.RO_COST) >= TO_NUMBER(translate('2500','NO-MIN',' ')))
       AND
       PTL_EDW_D_CHRG_LOCN.DIST_NUM_SUFX  IN  ('014810')
       AND
       ( PTL_EDW.D_TIME.CALENDAR_DT  BETWEEN  to_date('2011-JAN-01') AND to_date('2012-SEP-24')  )
       AND
       ( 'I'  = 'I'
      OR
      ( 'I' = 'E'
         And ( ( PTL_EDW.F_RO_DETL.RO_TYP ) <> 'W'
       AND
       ( EXISTS(SELECT *  FROM PTL_HOLD.USER_GEO WHERE USERID='600125729' AND PTL_HOLD.USER_GEO.GEO IN (CURRENT_VEH_LOCN.CORP_CD, CURRENT_VEH_LOCN.REGN_NUM, CURRENT_VEH_LOCN.AREA_NUM, CURRENT_VEH_LOCN.RDIST_NUM, CURRENT_VEH_LOCN.DIST_NUM))  )
    UNION 
    SELECT
      '../../opendoc/',
      '&hideSave=true&hideEdit=true&hideRefresh=true&hideUserPromptInput=true',
      'Data As Of:',
      'Run Date:',
      ptl_hold.get_stgextr_time('FACT_FPNA_RO'),
      'Accounting Month',
      PTL_EDW.F_RO_DETL.RO_TYP,
      PTL_EDW.D_CUSTOMER.CUST_NUM,
      (PTL_EDW.D_CUSTOMER.CUST_NUM )||' - '||( PTL_EDW.D_CUSTOMER.CUST_PRIME_NM),
      PTL_EDW.D_CUSTOMER.BILL_GRP,
      CASE WHEN PTL_EDW.D_LOCN.CORP_CD='HPTL' THEN 'US' ELSE CASE WHEN  PTL_EDW.D_LOCN.CORP_CD='2000' THEN 'CANADA' ELSE 'UNKNOWN' END END,
      PTL_EDW.D_LOCN.REGN_NUM,
      PTL_EDW.D_LOCN.REGN_NUM ||' - '||PTL_EDW.D_LOCN.REGN_NM,
      PTL_EDW.D_LOCN.AREA_NUM,
      PTL_EDW.D_LOCN.AREA_NUM||' - '||PTL_EDW.D_LOCN.AREA_NM,
      PTL_EDW.D_LOCN.RDIST_NUM,
      PTL_EDW.D_LOCN.RDIST_NUM||' - '||PTL_EDW.D_LOCN.RDIST_NM,
      PTL_EDW.D_LOCN.DIST_NUM,
      PTL_EDW.D_LOCN.DIST_NUM||' - '||PTL_EDW.D_LOCN.DIST_NM,
      CASE WHEN TRIM(PTL_EDW.D_VEHICLE.VEH_CAP_STAT) IN ('ACTIVE','ACCRUED') THEN 'Active' ELSE 'Inactive' END,
      DECODE(PTL_EDW.D_VEHICLE.CONTR_GRP, 'X' ,'NON-CONTRACT',PTL_EDW.D_VEHICLE.VEH_CAT),
      PTL_EDW.D_VEHICLE.VEH_UNIT_TYP,
      PTL_EDW.D_VEHICLE.VEH_MODL_YR,
      PTL_EDW.D_VEHICLE.VEH_MAKE,
      PTL_EDW.D_VEHICLE.VEH_MODEL,
      CASE WHEN ( PTL_HOLD.R_COMP_CODES.COMP_CD ) IN ('057','061') THEN 'Accident/Incident' ELSE 'Non-Accident/Incident' END,
      PTL_HOLD.R_COMP_CODES.COMP_CD,
      PTL_HOLD.R_COMP_CODES.COMP_DESC,
      PTL_HOLD.R_COMP_CODES.COMP_CD||' - '||PTL_HOLD.R_COMP_CODES.COMP_DESC,
      PTL_EDW.D_VEHICLE.UNIT_NUM,
      PTL_EDW_D_RO_LOCN.DIST_NUM || PTL_EDW_D_RO_LOCN.DIST_SUFX ||  PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM,
      PTL_EDW_D_RO_LOCN.DIST_NUM || PTL_EDW_D_RO_LOCN.DIST_SUFX || PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM || PTL_EDW.F_RO_DETL.RO_SEQ_NUM
      PTL_EDW.F_RO_DETL.RO_SRC,
      PTL_EDW.F_RO_DETL.TOTAL_LABOR_HRS,
      PTL_EDW.F_RO_DETL.TOTAL_LABOR_COST,
      PTL_EDW.F_RO_DETL.OUT_COST,
      PTL_EDW.F_RO_DETL.PARTS_COST,
      PTL_EDW.F_RO_DETL.RO_COST,
      TO_CHAR(PTL_EDW_D_RO_LOCN.LOCN_KEY),
      PTL_EDW.F_RO_DETL.RO_NUM,
      PTL_EDW.F_RO_DETL.RO_SEQ_NUM,
      PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM
    FROM
      PTL_EDW.F_RO_DETL,
      PTL_EDW.D_CUSTOMER,
      PTL_EDW.D_LOCN,
      PTL_EDW.D_VEHICLE,
      PTL_HOLD.R_COMP_CODES,
      PTL_EDW.D_LOCN  PTL_EDW_D_RO_LOCN,
      PTL_EDW.D_LOCN  PTL_EDW_D_CHRG_LOCN,
      PTL_EDW.D_LOCN  CURRENT_VEH_LOCN,
      PTL_EDW.F_VEH_LOCN,
      PTL_EDW.D_VEHICLE  CURRENT_VEH
    WHERE
      ( PTL_EDW.F_RO_DETL.CUST_KEY=PTL_EDW.D_CUSTOMER.CUST_KEY  )
      AND  ( PTL_EDW.F_RO_DETL.LOCN_KEY=PTL_EDW.D_LOCN.LOCN_KEY  )
      AND  ( PTL_EDW.D_VEHICLE.VEH_KEY=PTL_EDW.F_RO_DETL.VEH_KEY  )
      AND  ( PTL_EDW_D_RO_LOCN.LOCN_KEY=PTL_EDW.F_RO_DETL.RO_LOCN_KEY  )
      AND  ( PTL_EDW.F_RO_DETL.CHRG_LOCN_KEY=PTL_EDW_D_CHRG_LOCN.LOCN_KEY  )
      AND  ( CURRENT_VEH_LOCN.LOCN_KEY=PTL_EDW.F_VEH_LOCN.LOCN_KEY  )
      AND  ( CURRENT_VEH.SCD_FLG='A'  )
      AND  ( CURRENT_VEH.CONTR_GRP='P'  )
      AND  ( CURRENT_VEH.CORP_CD=PTL_EDW.D_VEHICLE.CORP_CD and CURRENT_VEH.UNIT_NUM=PTL_EDW.D_VEHICLE.UNIT_NUM  )
      AND  ( CURRENT_VEH.VEH_KEY=PTL_EDW.F_VEH_LOCN.VEH_KEY  )
      AND  ( PTL_HOLD.R_COMP_CODES.COMP_CD=PTL_EDW.F_RO_DETL.COMP_CD  )
      AND 
       ( 'Accounting Month' = 'Accounting Month'  )
       AND
       ( '2500' = 'NO-MIN'
    OR           EXISTS(SELECT RO_TOTAL_COST.RO_LOCN_KEY, RO_TOTAL_COST.ORIGINAL_RO_NUM
    FROM      PTL_EDW.F_RO_DETL RO_TOTAL_COST
    WHERE
        ('I' = 'I'
        OR ('I' = 'E'
            AND RO_TOTAL_COST.RO_TYP  <>  'W'))
        AND RO_TOTAL_COST.RO_LOCN_KEY = PTL_EDW.F_RO_DETL.RO_LOCN_KEY
        AND RO_TOTAL_COST.ORIGINAL_RO_NUM = PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM
        AND RO_TOTAL_COST.PARTITION_KEY BETWEEN 
           to_number(to_char(to_date('2011-JAN-01','YYYY-MON-DD'),'yyyymm')) 
           AND  to_number(to_char(to_date('2012-SEP-24','YYYY-MON-DD'),'yyyymm'))
    GROUP BY
        RO_TOTAL_COST.RO_LOCN_KEY,
        RO_TOTAL_COST.ORIGINAL_RO_NUM
    HAVING
    Sum(RO_TOTAL_COST.RO_COST) >= TO_NUMBER(translate('2500','NO-MIN',' ')))  )
       AND
       PTL_EDW_D_CHRG_LOCN.DIST_NUM_SUFX  IN  ('014810')
       AND
       ( (PTL_EDW.F_RO_DETL.PARTITION_KEY BETWEEN 
           to_number(to_char(to_date('2011-JAN-01','YYYY-MON-DD'),'yyyymm')) 
           AND  to_number(to_char(to_date('2012-SEP-24','YYYY-MON-DD'),'yyyymm'))
       AND
       ( 'I'  = 'I'
      OR
      ( 'I' = 'E'
         And ( ( PTL_EDW.F_RO_DETL.RO_TYP ) <> 'W'
       AND
       ( EXISTS(SELECT *  FROM PTL_HOLD.USER_GEO WHERE USERID='600125729' AND PTL_HOLD.USER_GEO.GEO IN (CURRENT_VEH_LOCN.CORP_CD, CURRENT_VEH_LOCN.REGN_NUM, CURRENT_VEH_LOCN.AREA_NUM, CURRENT_VEH_LOCN.RDIST_NUM, CURRENT_VEH_LOCN.DIST_NUM))  )
    );Thank you.

    For your own sanity, you should learn to format your code. For the sake of the forum members, you should preserve the formatting by using the \ tags. 
    I've done that for you here, and some other questions popped right out.  Look for my embedded comments near the bottomSELECT
    '../../opendoc/',
    '&hideSave=true&hideEdit=true&hideRefresh=true&hideUserPromptInput=true'
    'Data As Of:' ,
    'Run Date:' ,
    ptl_hold.get_stgextr_time('FACT_FPNA_RO'),
    'RO Date' ,
    PTL_EDW.F_RO_DETL.RO_TYP ,
    PTL_EDW.D_CUSTOMER.CUST_NUM ,
    (PTL_EDW.D_CUSTOMER.CUST_NUM )
    ||' - '
    ||( PTL_EDW.D_CUSTOMER.CUST_PRIME_NM),
    PTL_EDW.D_CUSTOMER.BILL_GRP ,
    CASE
    WHEN PTL_EDW.D_LOCN.CORP_CD='HPTL'
    THEN 'US'
    ELSE
    CASE
    WHEN PTL_EDW.D_LOCN.CORP_CD='2000'
    THEN 'CANADA'
    ELSE 'UNKNOWN'
    END
    END ,
    PTL_EDW.D_LOCN.REGN_NUM,
    PTL_EDW.D_LOCN.REGN_NUM
    ||' - '
    ||PTL_EDW.D_LOCN.REGN_NM,
    PTL_EDW.D_LOCN.AREA_NUM ,
    PTL_EDW.D_LOCN.AREA_NUM
    ||' - '
    ||PTL_EDW.D_LOCN.AREA_NM,
    PTL_EDW.D_LOCN.RDIST_NUM,
    PTL_EDW.D_LOCN.RDIST_NUM
    ||' - '
    ||PTL_EDW.D_LOCN.RDIST_NM,
    PTL_EDW.D_LOCN.DIST_NUM ,
    PTL_EDW.D_LOCN.DIST_NUM
    ||' - '
    ||PTL_EDW.D_LOCN.DIST_NM,
    CASE
    WHEN TRIM(PTL_EDW.D_VEHICLE.VEH_CAP_STAT) IN
    ('ACTIVE','ACCRUED')
    THEN 'Active'
    ELSE 'Inactive'
    END,
    DECODE(PTL_EDW.D_VEHICLE.CONTR_GRP, 'X' ,
    'NON-CONTRACT',PTL_EDW.D_VEHICLE.VEH_CAT),
    PTL_EDW.D_VEHICLE.VEH_UNIT_TYP ,
    PTL_EDW.D_VEHICLE.VEH_MODL_YR ,
    PTL_EDW.D_VEHICLE.VEH_MAKE ,
    PTL_EDW.D_VEHICLE.VEH_MODEL ,
    CASE
    WHEN
    PTL_HOLD.R_COMP_CODES.COMP_CD
    IN ('057','061')
    THEN 'Accident/Incident'
    ELSE 'Non-Accident/Incident'
    END ,
    PTL_HOLD.R_COMP_CODES.COMP_CD ,
    PTL_HOLD.R_COMP_CODES.COMP_DESC,
    PTL_HOLD.R_COMP_CODES.COMP_CD
    ||' - '
    ||PTL_HOLD.R_COMP_CODES.COMP_DESC,
    PTL_EDW.D_VEHICLE.UNIT_NUM ,
    PTL_EDW_D_RO_LOCN.DIST_NUM
    || PTL_EDW_D_RO_LOCN.DIST_SUFX
    || PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM,
    PTL_EDW_D_RO_LOCN.DIST_NUM
    || PTL_EDW_D_RO_LOCN.DIST_SUFX
    || PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM
    || PTL_EDW.F_RO_DETL.RO_SEQ_NUM ,
    PTL_EDW.F_RO_DETL.RO_SRC ,
    PTL_EDW.F_RO_DETL.TOTAL_LABOR_HRS ,
    PTL_EDW.F_RO_DETL.TOTAL_LABOR_COST ,
    PTL_EDW.F_RO_DETL.OUT_COST ,
    PTL_EDW.F_RO_DETL.PARTS_COST ,
    PTL_EDW.F_RO_DETL.RO_COST ,
    TO_CHAR(PTL_EDW_D_RO_LOCN.LOCN_KEY),
    PTL_EDW.F_RO_DETL.RO_NUM ,
    PTL_EDW.F_RO_DETL.RO_SEQ_NUM ,
    PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM
    FROM
    PTL_EDW.F_RO_DETL ,
    PTL_EDW.D_CUSTOMER ,
    PTL_EDW.D_LOCN ,
    PTL_EDW.D_VEHICLE ,
    PTL_HOLD.R_COMP_CODES ,
    PTL_EDW.D_LOCN PTL_EDW_D_RO_LOCN ,
    PTL_EDW.D_LOCN PTL_EDW_D_CHRG_LOCN,
    PTL_EDW.D_TIME ,
    PTL_EDW.D_LOCN CURRENT_VEH_LOCN ,
    PTL_EDW.F_VEH_LOCN ,
    PTL_EDW.D_VEHICLE CURRENT_VEH
    WHERE
    PTL_EDW.F_RO_DETL.CUST_KEY =
    PTL_EDW.D_CUSTOMER.CUST_KEY
    AND
    PTL_EDW.F_RO_DETL.LOCN_KEY =
    PTL_EDW.D_LOCN.LOCN_KEY
    AND
    PTL_EDW.D_TIME.TIME_KEY =
    PTL_EDW.F_RO_DETL.RO_TIME_KEY
    AND
    PTL_EDW.D_VEHICLE.VEH_KEY =
    PTL_EDW.F_RO_DETL.VEH_KEY
    AND
    PTL_EDW_D_RO_LOCN.LOCN_KEY =
    PTL_EDW.F_RO_DETL.RO_LOCN_KEY
    AND
    PTL_EDW.F_RO_DETL.CHRG_LOCN_KEY=
    PTL_EDW_D_CHRG_LOCN.LOCN_KEY
    AND
    CURRENT_VEH_LOCN.LOCN_KEY =
    PTL_EDW.F_VEH_LOCN.LOCN_KEY
    AND
    CURRENT_VEH.SCD_FLG ='A'
    AND
    CURRENT_VEH.CONTR_GRP ='P'
    AND
    CURRENT_VEH.CORP_CD =
    PTL_EDW.D_VEHICLE.CORP_CD
    AND CURRENT_VEH.UNIT_NUM =
    PTL_EDW.D_VEHICLE.UNIT_NUM
    AND
    CURRENT_VEH.VEH_KEY =
    PTL_EDW.F_VEH_LOCN.VEH_KEY
    AND
    PTL_HOLD.R_COMP_CODES.COMP_CD =
    PTL_EDW.F_RO_DETL.COMP_CD
    AND
    'Accounting Month' = 'RO Date'
    AND
    '2500' = 'NO-MIN'
    OR EXISTS
    SELECT
    RO_TOTAL_COST.RO_LOCN_KEY,
    RO_TOTAL_COST.ORIGINAL_RO_NUM
    FROM
    PTL_EDW.F_RO_DETL RO_TOTAL_COST,
    PTL_EDW.D_TIME DTIME
    WHERE
    'I' = 'I'
    OR
    'I' = 'E'
    AND RO_TOTAL_COST.RO_TYP 'W'
    AND RO_TOTAL_COST.RO_LOCN_KEY =
    PTL_EDW.F_RO_DETL.RO_LOCN_KEY
    AND RO_TOTAL_COST.ORIGINAL_RO_NUM =
    PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM
    AND RO_TOTAL_COST.RO_TIME_KEY =
    DTIME.TIME_KEY
    AND DTIME.CALENDAR_DT BETWEEN to_date(
    '2011-JAN-01') AND to_date(
    '2012-SEP-24')
    GROUP BY
    RO_TOTAL_COST.RO_LOCN_KEY,
    RO_TOTAL_COST.ORIGINAL_RO_NUM
    HAVING
    SUM(RO_TOTAL_COST.RO_COST) >= TO_NUMBER
    (TRANSLATE('2500','NO-MIN',' '))
    AND PTL_EDW_D_CHRG_LOCN.DIST_NUM_SUFX IN (
    '014810')
    AND
    PTL_EDW.D_TIME.CALENDAR_DT BETWEEN to_date(
    '2011-JAN-01') AND to_date('2012-SEP-24')
    AND
    'I' = 'I'
    OR
    'I' = 'E'
    AND
    PTL_EDW.F_RO_DETL.RO_TYP
    'W'
    AND
    EXISTS
    SELECT
    FROM
    PTL_HOLD.USER_GEO
    WHERE
    USERID ='600125729'
    AND PTL_HOLD.USER_GEO.GEO IN (
    CURRENT_VEH_LOCN.CORP_CD,
    CURRENT_VEH_LOCN.REGN_NUM,
    CURRENT_VEH_LOCN.AREA_NUM,
    CURRENT_VEH_LOCN.RDIST_NUM,
    CURRENT_VEH_LOCN.DIST_NUM)
    UNION
    SELECT
    '../../opendoc/',
    '&hideSave=true&hideEdit=true&hideRefresh=true&hideUserPromptInput=true'
    'Data As Of:' ,
    'Run Date:' ,
    ptl_hold.get_stgextr_time('FACT_FPNA_RO'),
    'Accounting Month' ,
    PTL_EDW.F_RO_DETL.RO_TYP ,
    PTL_EDW.D_CUSTOMER.CUST_NUM ,
    (PTL_EDW.D_CUSTOMER.CUST_NUM )
    ||' - '
    ||( PTL_EDW.D_CUSTOMER.CUST_PRIME_NM),
    PTL_EDW.D_CUSTOMER.BILL_GRP ,
    CASE
    WHEN PTL_EDW.D_LOCN.CORP_CD='HPTL'
    THEN 'US'
    ELSE
    CASE
    WHEN PTL_EDW.D_LOCN.CORP_CD='2000'
    THEN 'CANADA'
    ELSE 'UNKNOWN'
    END
    END ,
    PTL_EDW.D_LOCN.REGN_NUM,
    PTL_EDW.D_LOCN.REGN_NUM
    ||' - '
    ||PTL_EDW.D_LOCN.REGN_NM,
    PTL_EDW.D_LOCN.AREA_NUM ,
    PTL_EDW.D_LOCN.AREA_NUM
    ||' - '
    ||PTL_EDW.D_LOCN.AREA_NM,
    PTL_EDW.D_LOCN.RDIST_NUM,
    PTL_EDW.D_LOCN.RDIST_NUM
    ||' - '
    ||PTL_EDW.D_LOCN.RDIST_NM,
    PTL_EDW.D_LOCN.DIST_NUM ,
    PTL_EDW.D_LOCN.DIST_NUM
    ||' - '
    ||PTL_EDW.D_LOCN.DIST_NM,
    CASE
    WHEN TRIM(PTL_EDW.D_VEHICLE.VEH_CAP_STAT) IN
    ('ACTIVE','ACCRUED')
    THEN 'Active'
    ELSE 'Inactive'
    END,
    DECODE(PTL_EDW.D_VEHICLE.CONTR_GRP, 'X' ,
    'NON-CONTRACT',PTL_EDW.D_VEHICLE.VEH_CAT),
    PTL_EDW.D_VEHICLE.VEH_UNIT_TYP ,
    PTL_EDW.D_VEHICLE.VEH_MODL_YR ,
    PTL_EDW.D_VEHICLE.VEH_MAKE ,
    PTL_EDW.D_VEHICLE.VEH_MODEL ,
    CASE
    WHEN
    PTL_HOLD.R_COMP_CODES.COMP_CD
    IN ('057','061')
    THEN 'Accident/Incident'
    ELSE 'Non-Accident/Incident'
    END ,
    PTL_HOLD.R_COMP_CODES.COMP_CD ,
    PTL_HOLD.R_COMP_CODES.COMP_DESC,
    PTL_HOLD.R_COMP_CODES.COMP_CD
    ||' - '
    ||PTL_HOLD.R_COMP_CODES.COMP_DESC,
    PTL_EDW.D_VEHICLE.UNIT_NUM ,
    PTL_EDW_D_RO_LOCN.DIST_NUM
    || PTL_EDW_D_RO_LOCN.DIST_SUFX
    || PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM,
    PTL_EDW_D_RO_LOCN.DIST_NUM
    || PTL_EDW_D_RO_LOCN.DIST_SUFX
    || PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM
    || PTL_EDW.F_RO_DETL.RO_SEQ_NUM ,
    PTL_EDW.F_RO_DETL.RO_SRC ,
    PTL_EDW.F_RO_DETL.TOTAL_LABOR_HRS ,
    PTL_EDW.F_RO_DETL.TOTAL_LABOR_COST ,
    PTL_EDW.F_RO_DETL.OUT_COST ,
    PTL_EDW.F_RO_DETL.PARTS_COST ,
    PTL_EDW.F_RO_DETL.RO_COST ,
    TO_CHAR(PTL_EDW_D_RO_LOCN.LOCN_KEY),
    PTL_EDW.F_RO_DETL.RO_NUM ,
    PTL_EDW.F_RO_DETL.RO_SEQ_NUM ,
    PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM
    FROM
    PTL_EDW.F_RO_DETL ,
    PTL_EDW.D_CUSTOMER ,
    PTL_EDW.D_LOCN ,
    PTL_EDW.D_VEHICLE ,
    PTL_HOLD.R_COMP_CODES ,
    PTL_EDW.D_LOCN PTL_EDW_D_RO_LOCN ,
    PTL_EDW.D_LOCN PTL_EDW_D_CHRG_LOCN,
    PTL_EDW.D_LOCN CURRENT_VEH_LOCN ,
    PTL_EDW.F_VEH_LOCN ,
    PTL_EDW.D_VEHICLE CURRENT_VEH
    WHERE
    PTL_EDW.F_RO_DETL.CUST_KEY =
    PTL_EDW.D_CUSTOMER.CUST_KEY
    AND
    PTL_EDW.F_RO_DETL.LOCN_KEY =
    PTL_EDW.D_LOCN.LOCN_KEY
    AND
    PTL_EDW.D_VEHICLE.VEH_KEY =
    PTL_EDW.F_RO_DETL.VEH_KEY
    AND
    PTL_EDW_D_RO_LOCN.LOCN_KEY =
    PTL_EDW.F_RO_DETL.RO_LOCN_KEY
    AND
    PTL_EDW.F_RO_DETL.CHRG_LOCN_KEY=
    PTL_EDW_D_CHRG_LOCN.LOCN_KEY
    AND
    CURRENT_VEH_LOCN.LOCN_KEY =
    PTL_EDW.F_VEH_LOCN.LOCN_KEY
    AND
    CURRENT_VEH.SCD_FLG ='A'
    AND
    CURRENT_VEH.CONTR_GRP ='P'
    AND
    CURRENT_VEH.CORP_CD =
    PTL_EDW.D_VEHICLE.CORP_CD
    AND CURRENT_VEH.UNIT_NUM =
    PTL_EDW.D_VEHICLE.UNIT_NUM
    AND
    CURRENT_VEH.VEH_KEY =
    PTL_EDW.F_VEH_LOCN.VEH_KEY
    AND
    PTL_HOLD.R_COMP_CODES.COMP_CD =
    PTL_EDW.F_RO_DETL.COMP_CD
    AND
    'Accounting Month' = 'Accounting Month'
    AND
    '2500' = 'NO-MIN'
    OR EXISTS
    SELECT
    RO_TOTAL_COST.RO_LOCN_KEY,
    RO_TOTAL_COST.ORIGINAL_RO_NUM
    FROM
    PTL_EDW.F_RO_DETL RO_TOTAL_COST
    WHERE
    'I' = 'I'
    /* what's the point? A literal always equals itself. /*
    OR
    'I' = 'E'
    /* again, what's the point? This will never be true */
    AND RO_TOTAL_COST.RO_TYP 'W'
    AND RO_TOTAL_COST.RO_LOCN_KEY =
    PTL_EDW.F_RO_DETL.RO_LOCN_KEY
    AND RO_TOTAL_COST.ORIGINAL_RO_NUM =
    PTL_EDW.F_RO_DETL.ORIGINAL_RO_NUM
    AND RO_TOTAL_COST.PARTITION_KEY BETWEEN
    to_number(TO_CHAR(to_date('2011-JAN-01','YYYY-MON-DD'),'yyyymm')) AND
    to_number(TO_CHAR(to_date('2012-SEP-24','YYYY-MON-DD'),'yyyymm'))
    /* what is the data type of PARTITION_KEY? This manipulation strongly suggests that it should be DATE and isn't.
    GROUP BY
    RO_TOTAL_COST.RO_LOCN_KEY,
    RO_TOTAL_COST.ORIGINAL_RO_NUM
    HAVING
    SUM(RO_TOTAL_COST.RO_COST) >= TO_NUMBER(TRANSLATE('2500','NO-MIN',' '))
    AND PTL_EDW_D_CHRG_LOCN.DIST_NUM_SUFX IN (
    '014810')
    AND
    PTL_EDW.F_RO_DETL.PARTITION_KEY BETWEEN
    to_number(TO_CHAR(to_date('2011-JAN-01',
    'YYYY-MON-DD'),'yyyymm')) AND to_number(
    TO_CHAR(to_date('2012-SEP-24',
    'YYYY-MON-DD'),'yyyymm'))
    AND
    'I' = 'I'
    OR
    'I' = 'E'
    AND
    PTL_EDW.F_RO_DETL.RO_TYP
    'W'
    AND
    EXISTS
    SELECT
    FROM
    PTL_HOLD.USER_GEO
    WHERE
    USERID ='600125729'
    AND PTL_HOLD.USER_GEO.GEO IN (
    CURRENT_VEH_LOCN.CORP_CD,
    CURRENT_VEH_LOCN.REGN_NUM,
    CURRENT_VEH_LOCN.AREA_NUM,
    CURRENT_VEH_LOCN.RDIST_NUM,
    CURRENT_VEH_LOCN.DIST_NUM)

  • Screen doesn't come back after sleeping

    Occassionally I find that after closing my MPB to put it to sleep the screen doesn't come back up after re-opening the laptop. The pulsing white light which tells you the machine is sleeping goes off, so it seems as if the machine has woken up.... but there's nothing on the screen. I'm forced to use the power button to shut the machine down and start up again.
    Something to worry about?
    (p.s. I just tested it again and noticed that when I close the lid the white light isn't pulsing, but rather stays lit)
    Message was edited by: Scott F.

    I just recently (within the last two days) started having this problem myself. I've only owned the Macbook for a few months (purchased it from Apple online store right before the new ones came out). I am thinking it might be due to a recent update or something.
    When I close the lid, laptop sleeps but when you open it you can hear the CD tray spin up like it's trying to wake but doesn't. I've tried adjusting screen brightness via f-keys, changing the volume, etc. but seems like system is just locked up. I've been having to hold down the power button and force a reboot.

  • New iPad (3rd gen) keyboard doesn't slide back in

    My new iPad keyboard (i.e. the default virtual keyboard of iOS) when it comes up (slides up) it doesn't slide back in when the typing mode is no longer needed.
    E.g. when I swipe all the way to the left and reach the search screen, the keyboard pops up, and when I swipe back to the home screen the keyboard stays up until I press the 'hide keyboard' button.
    Appreciate if anyone knows how to solve this and could share his/her solution.
    many thanks in advace

  • SC doesn't go back to approver again after changed by requester

    Hello Experts,
    We are implementing SRM 5.5 with N step Item base approval (WS14500015) process for SC.
    SC created by requester goes to approver for approval. Approver Changes the price in SC & Approves SC. This SC comes back to Requester again. Requester goes into his inbox, change SC price back to origional & Save again.
    Now  Ideally SC should go back to approval again however in our case SC is getting approved  straight a way & PO is getting created in SRM ( Ex-classic Scenario)
    Wondering why SC doesn't goe back to approver again for approval?
    Any help is highly appreciated..
    Thnaks & regards,
    Chris

    Did you check the security settings of the creator.
    There are 4 options, depending on that the workflow is restarted or just continues if the user changes the cart.
    SU01 - personalization tab--> BBP_WFL_SECURITY - check all the options high, medium,low, new.
    Regards,
    PR.

  • HT4528 I am having trouble with the touch screen.  When I press - on the glass surface sometimes it doesn't respond back.  I updated my software.

    I am having trouble with the touch screen.  When I press - on the glass surface sometimes it doesn't respond back.  I updated my software.

    This Apple doc might help ya out -> iPhone, iPad, iPod touch: Troubleshooting touchscreen response

  • HT201269 Still trying to get old saved voicemail from deceased mom. Doesn't go back far enough....what to do?

    Still trying to get old saved voicemail from deceased mom. Doesn't go back far enough....what to do?

    Still trying to get old saved voicemail from deceased mom. Doesn't go back far enough....what to do?

  • Palm Pre Plus turned off and it doesn't turn back on

    OK yesterday I was using my phone and I left it lying on my bed, 5 minutes later I try and use it and it's like turned off, it doesn't turn back on, I know the battery isn't dead because the battery was at 70 %, I didn't drop any liquids on it and when I called it, it's like its turned off but I can't turn it back on and I can't charge it either and I know it's not disconnected so I don't know what the problem is so any help would be nice and I'm new to this community so I don't know if this is the right section to post this but again help me out please
    PS I've only dropped it once and that drop wasn't enough to break it or anything
    Post relates to: Pre Plus p101vzw (Verizon)

    Hello lafan and welcome to the forums,
    I'm sorry your having this issue.  You could try holding the power button down and switching the ringer switch back and forth 3 times.
    If this doesn't work, you could also try pulling the battery and re-seting it to see if the device powers back up. 
    If this does not work, I would suggest replacing the battery, possibly the device.
    Let us know if this helps..
    Thanks,
    Colapop

  • Why property doesn't change back to unspecified?

    A serious flaw in forms is that after changing property of items from unspecified to sth. it doesn't change back to unspecified and doesn't take blank either although it says enter blank if u don't want to specify any property.
    if i specify some property it mayn't suit my original settings. though a small problem, this may sometimes cause delay in work.

    Hi palmetto2008, <br>
    check this article: [[Font size and zoom - increase the size of web pages]]
    <br>
    Shortly, you can configure Firefox to display all text at a minimum font size. If a web page contains text that is smaller than your defined minimum size, Firefox increases the font size of the text to this minimum. To set a minimum text size:
    * On the menu bar, click on the Firefox menu and select Preferences...
    * Select the Content panel.
    * In the Fonts & Colors pane, click Advanced....
    * In the Minimum Font Size drop-down, select the minimum size in pixels in which all text must be displayed.
    <br>
    Regarding NoSquint addon, you should be able to override the default zoom options and keep your settings between Firefox restarts. <br>
    See also here: [https://urandom.ca/nosquint/help.php NoSquint Help Page]
    <br>
    Apparently, there are many addons offering your desired feature like:
    * Default FullZoom Level
    * Zoom Page
    <br>
    Hope that helped you! Please report back!

  • Droid email account doesn't sync back to online account.

    Does anyone know how to fix an email account that doesn't sync back to the original account on line?  I have my Comcast email account set up on my Droid, and I get my emails with no problems.  But when I send an email from the Droid, it doesn't show up online.

    I don't have a COMCAST account, but I do have an AT&T Yahoo account, but I am using the stock Email Yahoo App - not a 3rd party app. (You said you're using the ATT Mobile App - what is that?) For my Yahoo account, I didn't have to specify anything in settings on either side (phone or online). Email sent from my phone are in the SENT folder online. Same with the TRASH folder. Any Folders I set up online appear on my phone automatically.
    How long has this been going on? Just start happening?  Have you tried deleting the Account(s) from your phone, clearing System Cache, rebooting, and reinstalling the APP? I believe there are special configuration steps required of COMCAST - but I don't have them and can't find them anymore in this new forum's Search feature.

  • IMac display doesn't turn back on after sleep

    This is a new problem on my two-year old iMac, and didn't happen before. What is happening with my iMac is that when it goes to sleep and the display turns off, the display doesn't turn back on when I move the mouse, press the keys or the power button.
    It happens only after around 12 hours or so of inactivity, it seems. I have to reboot the iMac to force the display to turn back on. I think it is display issue, not the computer lockup because I checked which logs were written in /var/log - system.log was being written until I rebooted the iMac. However, I didn't see any information in there around the same time that I tried to turn the iMac back on.
    Any ideas on how to debug the issue.

    Hi dailyjoe
    1. Reset your SMC exactly as instructed in the following article:
    http://support.apple.com/kb/HT1543
    2. It would be normal for you to have to startup your iMac if it lost power while in sleep mode, look at the box "Start up automatically after a power failure" in the Energy Saver preference.
    I have always left the box for "Start up automatically after a power failure" unchecked and do occasionally find the iMac is shutdown because the power has gone off. I would suggest leaving the box unchecked, it's better than having the iMac going off & restarting multiple times if you are having bad weather or power issues.
    Dennis

Maybe you are looking for