Control break behavior

Hi,
Can anyone tell if there's a way to override the default behavior of Control Break?
In my report (a schedule), I have a column that holds the values for days (monday, tuesday, etc.).
I want to control break on that column but keep the resulting grups ordered in a natural order (monday first, tuesday second and so on).
I can write the sql that generates my report that way by using decode, but once I Control Break apex is applying a new order by clause on my report, destroying my order.
Any ideas on how to tell apex how to order for control break using decode, or how to disable ordering entirely when I use Control Break on a specific column?
Thank you!
Edited by: user2130586 on May 17, 2012 6:40 AM
Edited by: user2130586 on May 17, 2012 6:41 AM

Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already).
When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB/version/edition/host OS
<li>Web server architecture (EPG, OHS or APEX listener/host OS)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s)
With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
When asking a question about "reports" it's firstly essential to differentiate between standard and interactive reports. Which is it?
I suggest you take advantage of the opportunities provided by apex.oracle.com and reproduce the problem there...

Similar Messages

  • Control break statements

    Hi friends,
           pls explain , what is the use of control break statements( at first, at last, at new, at end of, on change of ) ? and practical difference applying at new and on change.
    Pls send me material or links related to control break statements.
    Thanks in advance.
    SR K

    Hello SR K,
    Just go through the following documentation.
    AT - Control breaks with extracts
                  Variants:
                  1. AT NEW f.
                  2. AT END OF f.
                  3. AT FIRST.
                  4. AT LAST.
                  5. AT fg.
    Effect        In a LOOP which processes a dataset created with EXTRACT, you
                  can use special control structures for control break
                  processing. All these structures begin with AT and end with
                  ENDAT. The sequence of statements which lies between is
                  executed whenever a control break occurs.
                  You can use these key words for control break processing with
                  extract datasets only if the active LOOP statement is
                  processing an extract dataset.
                  The control level structure with extract datasets is dynamic.
                  It corresponds exactly to the sort key of the extract dataset,
                  i.e. to the order of fields in the field group HEADER by which
                  the extract dataset was sorted.
                  At the end of a control group (AT END OF, AT LAST), there are
                  two types of control level information between AT and ENDAT:
                  -  If the sort key of the extract dataset contains a
                     non-numeric field h (particularly in the field group
                     HEADER), the field CNT(h) contains the number of control
                     breaks in the (subordinate) control level h.
                  -  For extracted number fields g (see also ABAP Number Types),
                     the fields SUM(g) contain the relevant control totals.
    Notes         1. The fields CNT(h) and SUM(g) can only be addressed after
                     they have been sorted. Otherwise, a runtime error may
                     occur.
                  2. The fields CNT(h) and SUM(g) are filled with the relevant
                     values for a control level at the end of each control group
                     (AT END OF, AT LAST), not at the beginning (AT FIRST, AT
                     NEW).
                  3. When calculating totals with SUM(g), the system
                     automatically chooses the maximum field sizes so that an
                     overflow occurs only if the absolute value area limits are
                     exceeded.
                  4. You can also use special control break control structures
                     with LOOPs on internal tables.
    Variant 1     AT NEW f.
    Variant 2     AT END OF f.
    Effect        f is a field from the field group HEADER. The enclosed
                  sequence of statements is executed if
                  -  the field f occurs in the sort key of the extract dataset
                     (and thus also in the field group HEADER) and
                  -  the field f or a superior sort criterion has a different
                     value in the current LOOP line than in the preceding (AT
                     NEW) or subsequent (AT END OF) record of the extract
                     dataset.
                  If f is not an assigned field symbol, the control break
                  criterion is ignored, and the subsequent sequence of
                  statements is not executed. If a field symbol is assigned, but
                  does not point to the HEADER field group, the system triggers
                  a runtime error.
    Example
                  DATA: NAME(30),
                        SALES TYPE I.
                  FIELD-GROUPS: HEADER, INFOS.
                  INSERT: NAME  INTO HEADER,
                          SALES INTO INFOS.
                  LOOP.
                    AT NEW NAME.
                      NEW-PAGE.
                    ENDAT.
                    AT END OF NAME.
                      WRITE: / NAME, SUM(SALES).
                    ENDAT.
                  ENDLOOP.
    Notes         1. If the extract dataset is not sorted before processing with
                     LOOP, no control level structure is defined and the
                     statements following AT NEW or AT END OF are not executed.
                  2. Fields which stand at hex zero are ignored by the control
                     break check with AT NEW or AT END OF. This corresponds to
                     the behavior of the SORT statement, which always places
                     unoccupied fields (i.e. fields which stand at hex zero)
                     before all occupied fields when sorting extract datasets,
                     regardless of whether the sort sequence is in ascending or
                     descending order.
    Variant 3     AT FIRST.
    Variant 4     AT LAST.
    Effect        Executes the relevant series of statements just once - either
                  on the first loop pass (with AT FIRST) or on the last loop
                   pass (with AT LAST).
    Variant 5     AT fg.
                   Addition:
                   ... WITH fg1
    Effect        This statement makes single record processing dependent on the
                   type of extracted record.
                   The sequence of statements following AT fg are executed
                   whenever the current LOOP record is created with EXTRACT fg
                   (in other words: when the current record is a fg record).
    Addition      ... WITH fg1
    Effect        Executes the sequence of statements belonging to AT fg WITH
                   fg1 only if the record of the field group fg in the dataset is
                   immediately followed by a record of the field group fg1.
    Reward If Helpful
    Regards
    Sasidhar Reddy Matli.

  • ANY SY-INDEX REFLECT CHANGES WHEN CONTROL BREAK STATEMENT PROCESS

    Dear Guru's,
                     I have a requirement where i have to move the values to variable when control break (AT END OF) process. So i want to move the values according to the end of Vendor so for that  i want to know is there any sy-index available which reflects changes when Control break (AT end of) process.
    LIKE Sy-subrc = 0 when select statement fetches record or sy-tabix is like counter for loop.
    Hope to get reply soon.
    Regards,
    Himanshu Rangappa

    Hi,
    There is no system Fields for it.
    But your requirement can be done with 'AT NEW' and 'AT END' statement.
    Refer this sample example,
    loop at otab.
        at new module.
          move otab-module to otab2-module.
        ENDAT.
          at END OF effort.
          sum.               "Do your calculations here
          move otab-count to otab2-count.
          append otab2.
        endat.
      endloop.

  • In alv report can i use control break events? if no .whay?

    Hi all,
    in alv report can i use control break events? if no .whay?

    hi,
    you can use control break statements in ALV report.
    for example: if one PO is having more than one line item, that time you need to display PO only once.

  • Doubts with control break statements on internal table loops (AT/ENDAT)

    Hi, i've had a couple of doubts for a long while which I hope someone can clarify today:
    1) I know how to use the AT statements, however, i'm not sure I get correctly what this part of help regarding this commands means:
    <i>"The control level structure with internal tables is static. It corresponds exactly to the sequence of columns in the internal table (from left to right). In this context, the criteria according to which you sort the internal table are unimportant."</i>
    I've always sorted the internal table before the control break and it works that way. For example:
    SORT ITAB BY EBELN EBELP.
    LOOP AT ITAB.
      AT NEW EBELN.
    *   Code for the order header
      ENDAT.
    ENDLOOP.
    If I <b>don't</b> sort the internal table, it doesn't work! (i get dupplicated processing). In the example, if i have more than one register with the same EBELN and they're not consecutive, the header gets processed twice. I really don't get that part of the help text.
    2) I know this: <i>"At the start of a new control level (i.e. immediately after AT), the following occurs in the output area of the current LOOP statement:
    All character type fields (on the right) are filled with "*" after the current control level key.
    All other fields (on the right) are set to their initial values after the current control level key."</i>
    My doubt is: WHY is that this way? Because sometimes (most times) I need those fields INSIDE the statement! So when that happened i've solved it in one of three ways:
    LOOP AT ITAB INTO WA_ITAB.
      WA_ITAB_AUX = WA_ITAB.
      AT NEW FIELD.
        WA_ITAB = WA_ITAB_AUX.
    *   ...Rest of the code for the first register
      ENDAT.
    ENDLOOP.
    LOOP AT ITAB INTO WA_ITAB.
      AT NEW FIELD.
        READ TABLE ITAB INDEX SY-TABIX INTO WA_ITAB.
    *   ...Rest of the code for the first register
      ENDAT.
    ENDLOOP.
    * (Without AT)
    LOOP AT ITAB INTO WA_ITAB.
      IF WA_ITAB-FIELD <> FIELD_AUX.
        FIELD_AUX = WA_ITAB_FIELD.
    *   ...Rest of the code for the first register
      ENDIF.
    ENDLOOP.
    Is there any problem with this way of coding? Can be done better?
    Thank you very much in advance.

    Hi..,
    1)
    See if u sort the table on a field on which u r using AT ENDAT .. then all the records which are having the same value for that field will form a group or those reocrds will be at one place.. so when u sort the table for all the records  AT ENDAT  will get executed onli once..
    If u dont sort this table on this field then all these records will be at different places and in between there may be records with different value for this field.. so this AT ENDAT will get executed for each record !!
    2)
    No u cannot use the Right hand fields of the field in the table .. Because these AT events work as Group based operations... So till that field on which AT ENDAT is working it breaks that record into two groups.. One is the left hand fields including that field.. and right hand fields as another group.. and makes the right hand group as stars ****.  Thats y u can observe that even any one field in the left hand group changes the AT ENDAT will get executed  !!!!
    Hope u understood !!!
    regards,
    sai ramesh

  • Problem with the control break statement  - AT END OF

    data : IT_DATA   TYPE STANDARD TABLE OF /BIC/OH0SPA_OHD WITH  KEY /B28/S_D1DVOX5 ,
    FIELD-SYMBOLS :   <ls_data> TYPE any,
    SELECT * FROM (c_open_hub) INTO TABLE IT_DATA .
    *IF sy-subrc = 0.
    *ENDIF.
    Create the GUID for header
    CALL FUNCTION 'GUID_CREATE'
      IMPORTING
        EV_GUID_32 = LV_GUID.
    TRY.
        CALL METHOD CL_GDT_CONVERSION=>GUID_OUTBOUND
          EXPORTING
            IM_GUID_C = LV_GUID
          IMPORTING
            EX_VALUE  = LV_UUID.
      CATCH CX_GDT_CONVERSION  INTO go_exc .
        gv_text = go_exc->get_text( ).
    Application log for errors
        IF gv_text IS NOT INITIAL.
          PERFORM add_msg_to_log CHANGING lt_return.
          CALL FUNCTION '/SPA/APPL_LOG'
            EXPORTING
              LV_OBJECT    = '/SPA/APPL'
              LV_SUBOBJECT = '/SPA/ESOA'
              IT_RETURN    = lt_return.
        ENDIF.
    ENDTRY.
    OUTPUT-TRADE_PROMOTION_CRMBULK_CREATE-MESSAGE_HEADER-ID-CONTENT = LV_GUID.
    OUTPUT-TRADE_PROMOTION_CRMBULK_CREATE-MESSAGE_HEADER-UUID-CONTENT = LV_UUID.
    SELECT * FROM DD03T INTO TABLE lt_dd03t WHERE TABNAME = c_open_hub AND DDLANGUAGE = 'E' AND AS4LOCAL = 'A'.
    *IF sy-subrc = 0.
    *ENDIF.
    Sort the delta table
    SORT it_data.
    populate the output structure
    LOOP AT IT_DATA ASSIGNING <ls_data>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_keyfigures.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_keyfigures>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_signdata.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_signdata>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_bbtype.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_bbtype>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_customer.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_customer>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_product.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_product>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_territory.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_territory>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_time.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_time>.
      CASE <l_keyfigures>.
        WHEN c_sd.
          PERFORM DATE_CALC USING <l_signdata> CHANGING  LV_DATE.
          ls_period_term-start_date = lv_date.
        WHEN c_ed.
          PERFORM DATE_CALC USING <l_signdata> CHANGING  LV_DATE.
          ls_period_term-end_date = lv_date.
        WHEN c_uplift.
          LS_PRODUCT_KF-ID-CONTENT = c_uplift_qyts.
          LS_PRODUCT_KF-VALUE = <l_signdata>.
         LS_PRODUCT_KF-YEAR = lv_week(4).
         LS_PRODUCT_KF-CALENDAR_PERIOD_ORDINAL_NUMBER = lv_week+4.
          APPEND LS_PRODUCT_KF TO LT_PRODUCT_KF.
        WHEN OTHERS.
        PERFORM DATE_CALC USING <l_signdata> CHANGING  LV_DATE.
         ls_period_term-start_date = lv_date.
    Get week
         CALL FUNCTION 'DATE_GET_WEEK'
           EXPORTING
             DATE = LS_PERIOD_TERM-START_DATE
           IMPORTING
             WEEK = LV_WEEK.
    append Keyfigure
          LS_PRODUCT_KF-ID-CONTENT = <l_keyfigures> .
          LS_PRODUCT_KF-VALUE = <l_signdata>.
         LS_PRODUCT_KF-YEAR = lv_week(4).
         LS_PRODUCT_KF-CALENDAR_PERIOD_ORDINAL_NUMBER = lv_week+4.
          APPEND LS_PRODUCT_KF TO LT_PRODUCT_KF.
    append tradespend
          SELECT SINGLE * FROM /SPA/SPEND_MAP INTO CORRESPONDING FIELDS OF LV_/SPA/SPEND_MAP
                 WHERE KEY_FIGURE = <l_keyfigures>.
          IF sy-subrc = 0.
            LS_TRADE_SPEND-TYPE_CODE-CONTENT = LV_/SPA/SPEND_MAP-SPEND_TYPE.
            LS_TRADE_SPEND-CATEGORY_CODE-CONTENT = LV_/SPA/SPEND_MAP-SPEND_CATEGORY.
            LS_TRADE_SPEND-METHOD_CODE-CONTENT = LV_/SPA/SPEND_MAP-SPEND_METHOD.
            APPEND LS_TRADE_SPEND TO LT_TRADE_SPEND.
          else.
            lv_flg = 'X'.
          ENDIF.
      ENDCASE.
    AT END OF /B28/S_D1DVOX5.   "
        SELECT SINGLE * FROM  /SPA/SO_TER_MAP INTO LS_/SPA/SO_TER_MAP WHERE TERRITORY = <l_territory>.
        IF sy-subrc = 0 AND lv_flg IS INITIAL.
    Create the GUID for TP's
          CALL FUNCTION 'GUID_CREATE'
            IMPORTING
              EV_GUID_32 = LV_GUID_MESSAGE.
          TRY.
              CALL METHOD CL_GDT_CONVERSION=>GUID_OUTBOUND
                EXPORTING
                  IM_GUID_C = LV_GUID_MESSAGE
                IMPORTING
                  EX_VALUE  = LV_UUID_MESSAGE.
            CATCH CX_GDT_CONVERSION .
          ENDTRY.
    populate the product
          LS_PRODUCT-ID-CONTENT = <l_product>.
          LS_CUSTOMER-ID-CONTENT = '300022'.
          LS_CUSTOMER-ROLE_CODE = '00000105'.
          LS_PRODUCT-KEY_FIGURE = LT_PRODUCT_KF.
          APPEND LS_PRODUCT TO LT_PRODUCT.
          APPEND LS_CUSTOMER TO LT_CUSTOMER.
          APPEND LS_DESCRIPTION TO LT_DESCRIPTION.
          APPEND LS_PERIOD_TERM TO LT_PERIOD_TERM.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-SALES_AREA-ORGANISATIONAL_CENTRE_ID = LS_/SPA/SO_TER_MAP-SALES__ORG.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-SALES_AREA-DISTRIBUTION_CHANNEL_CODE-CONTENT = LS_/SPA/SO_TER_MAP-DIST_CHANNEL.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_ACCOUNT-CUSTOMER_INTERNAL_ID = <l_customer>.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_PROFILE_GROUP_CODE-CONTENT = '4TPM'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-TYPE_CODE-CONTENT = 'Z002'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-UPLIFT_ACTIVE_INDICATOR = 'X'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_INFORMATION-MARKETING_PROJECT_PLANNING_PRO = '5'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_INFORMATION-CALENDAR_UNIT_CODE = 'WEE'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-TRADE_SPEND = LT_TRADE_SPEND.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PARTY = LT_CUSTOMER.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-DESCRIPTION = LT_DESCRIPTION.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_INFORMATION-PRODUCT = LT_PRODUCT.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PERIOD_TERM = LT_PERIOD_TERM.
          LS_TRADE_PROMOTION-MESSAGE_HEADER-ID-CONTENT = LV_GUID_MESSAGE.
          LS_TRADE_PROMOTION-MESSAGE_HEADER-UUID-CONTENT = LV_UUID_MESSAGE.
          LS_/SPA/REPORT_TAB-SPA_TP_ID = <l_bbtype>.
          LS_/SPA/REPORT_TAB-MESSAGE_ID = LV_GUID_MESSAGE.
          LS_/SPA/REPORT_TAB-CREATE_DATE = SY-DATUM.
          INSERT /SPA/REPORT_TAB FROM LS_/SPA/REPORT_TAB.
          APPEND LS_TRADE_PROMOTION TO LT_TRADE_PROMOTION.
          OUTPUT-TRADE_PROMOTION_CRMBULK_CREATE-TRADE_PROMOTION_CRMCREATE_REQU = LT_TRADE_PROMOTION.
          CLEAR : LT_DESCRIPTION, LT_PERIOD_TERM,LT_CUSTOMER, LT_PRODUCT, LT_PRODUCT_KF, LT_TRADE_SPEND,LS_/SPA/HEADER_TAB.
        ENDIF.
        CLEAR lv_flg .
      ENDAT.
    ENDLOOP.
    My problem is AT-END OF STATEMENT IS executing for each and every record of same /B28/S_D1DVOX5.
    Please help me from this problem

    Hello,
    First of all to know clearly about AT END.
    Let's say In IT_DATA fields are F1 F2 F3 /B28/S_D1DVOX5 F5.
    then AT END of /B28/S_D1DVOX5 means for each new value of this field at the end it will trigger.
    Please ensure thet IT_DATA is sorted by this field and then used Control break.
    Thanks,
    Pramod

  • What happen if i use controll break statement in between select & endselect

    Hi all,
    what happen if i use controll break statement in between select & endselect ?
    Thanks in Advance
    KR

    Hi for reference u can go through this code example
    data:
      fs_tab like sflight.
      data:
       t_tab like standard table of fs_tab.
       select * from sflight into table t_tab.
       loop at t_tab into fs_tab.
         write: / fs_tab-carrid.
       endloop.
       refresh t_tab.
       clear fs_tab.
       select * from sflight into fs_tab.
         at new fs_tab-carrid.
           append fs_tab to t_tab.
         endat.
       endselect.

  • Smartforms, how to use control break events

    Please help with this requirement.
    Purchase Docu No.111
    Pur Item No       Mat no       Quantity 
    1                        2356      2000
    2                     1256      2000
    3                     8556      2000
    Purchase Docu No.112
    Pur Item No    Mat no    Quantity 
    1                      9656      2000
    2                      7356      2000
    3                      1356      2000
    Purchase Docu No.113
    Pur Item No    Mat no    Quantity 
    1                      5356      2000
    2                      8356      2000
    This i have to design for the smartform.
    1 header data then its item data.
    like is Script i can call the WIndow elements using control break events in the driver prog but how to get this kind of output in Smartforms.???????
    Thanks

    I dont want trigger new page.
    In the same page i want like this
    I have purchase docu data in only 1 internal table.
    So, for every new VBELN, under this i want its corresponding item details.
    I have created the command node for the main window with 2 rows, in the 1st row i am giving VBELN and in the 2nd row i am giving in item details like item no, matnr etc etc and in the condition its askng Field name and Comparison Value.
    How shold i give condition.??????
    Thanks
    Edited by: Jalaaluddin Syed on May 1, 2008 5:03 PM

  • Interactive report with control break displays no data, until control break is unchecked

    Hello,
    I have an interactive report that is base upon a collection. When one first access the page the report shows no data(no errors are given) and the control break box is red. Once the control break box is unchecked, all the data is shown. Furthermore, navigating to another page causes the same issue.
    Any idea into how I can solve this issue will be appreciated.
    Thank you,
    Apex 4.2
    Oracle 11g 2.0.3
    Apache Tomcat
    Guyenko

    Vincent,
    The aggregates are applied to each control break group, or, if you don't have any, then they're applied to the full report. So, in your case the "count" (= count of non-null values for a column, same as in SQL) should mean there is 1 non-null value in each group.
    Does that description match what you're seeing?
    - Marco

  • Is there any way to use Control Break in a SQL Query

    Hi,
    Is there any way to use a control break on Dept column in a SQL query to have a Output-2 instead of Output-1.
    Is there any way to modify the SQL query.
    SQL
    select dept, loc, count(*)
      from dept
    group by dept, locOutput-1
      Dept      Loc       Count(*)
      10         AA        1
      10         BB        2
      10         CC        2
      20         AA        2
      20         BB        2Output-2
      Dept      Loc       Count(*)
      10         AA        1
                 BB        2
                 CC        2
      20         AA        2
                 BB        2Thanks,
    Deepak

    DeepakJ wrote:
    Hi,
    Is there any way to use a control break on Dept column in a SQL query to have a Output-2 instead of Output-1.
    Is there any way to modify the SQL query.
    SQL
    select dept, loc, count(*)
    from dept
    group by dept, locOutput-1
    Dept      Loc       Count(*)
    10         AA        1
    10         BB        2
    10         CC        2
    20         AA        2
    20         BB        2Output-2
    Dept      Loc       Count(*)
    10         AA        1
    BB        2
    CC        2
    20         AA        2
    BB        2
    Yes, using the <tt>lag</tt> analytic function and specified ordering of the data:
    select
        nullif(d.deptno, lag(d.deptno) over (order by d.deptno, d.loc, e.mgr nulls first)) deptno
      , nullif(d.loc, lag(d.loc) over (order by d.deptno, d.loc, e.mgr nulls first)) loc
      , e.mgr
      , count(*) n
    from
        dept d
          join emp e
            on d.deptno = e.deptno
    group by
        d.deptno
      , d.loc
      , e.mgr
    order by
        d.deptno
      , d.loc
      , e.mgr nulls first;
    DEPTNO  LOC       MGR   N
        10  NEW YORK         1
                      7782   1
                      7839   1
        20  DALLAS    7566   2
                      7788   1
                      7839   1
        30  CHICAGO   7698   4
                      7839   1
        40  BOSTON    7698   2
                      7902   1

  • How can I use control break statement in my requirement

    Hi ABAPers,
    In my requirement, I have 4 fields in sorted internal table, (audat, prdha, ipnum, netwr). In that i need to do summation of netwr field falling under same prdha(BU) for the same month
    internal table fields :
    audat  prdha  ipnum  netwr
    02      abc     1      100
    02      abc     2      200
    02      xyz     3      300
    03      abc     4      100
    03      xyz     5      300
    03      xyz     6      200
    i need output like this:
    audat  prdha  ipnum  netwr
    02      abc     1,2      300
    02      xyz     3         300
    03      abc     4         100
    03      xyz     5,6      500
    Can anyone suggest me logic for this by using control break statements
    Thanks in advance,
    Ankita
    Moderator Message: Duplciate Post.
    Edited by: kishan P on Apr 14, 2011 3:03 PM

    Hi ABAPers,
    In my requirement, I have 4 fields in sorted internal table, (audat, prdha, ipnum, netwr). In that i need to do summation of netwr field falling under same prdha(BU) for the same month
    internal table fields :
    audat  prdha  ipnum  netwr
    02      abc     1      100
    02      abc     2      200
    02      xyz     3      300
    03      abc     4      100
    03      xyz     5      300
    03      xyz     6      200
    i need output like this:
    audat  prdha  ipnum  netwr
    02      abc     1,2      300
    02      xyz     3         300
    03      abc     4         100
    03      xyz     5,6      500
    Can anyone suggest me logic for this by using control break statements
    Thanks in advance,
    Ankita
    Moderator Message: Duplciate Post.
    Edited by: kishan P on Apr 14, 2011 3:03 PM

  • At new control break statement

    hi all,
    I have a requirement where I have to display records for non duplicate matnr.
    I have used this control break statement and got
    stars for all other fields except matn in the outputr.
    code:    at new matnr.
                              write: /10 sy-vline , wa_mara-matnr COLOR 5,
                                      30 sy-vline , wa_mara-ersda COLOR 5 ,
                                      50 sy-vline , wa_mara-ernam COLOR 5 ,
                                      70 sy-vline , wa_mara-laeda COLOR 5 ,
                                      90 sy-vline , wa_mara-mtart COLOR 5 ,
                                      110 sy-vline , wa_mara-matkl COLOR 5 ,
                                      130 sy-vline , wa_mara-meins COLOR 5 ,
                                      150 sy-vline.
                            ENDAT.
    plese do send me solution for this.
    with regards,
    ASHA.

    FAQ. This has been discussed many times in the forum. Please search.

  • PDF Printing and preserving Control Breaks

    I'm testing PDF printing with apache FOP. it works, but I've searched on here and am not finding a solution to preserve control breaks. Is there an easy way to set this up? I'm trying to replace reports with Apex, and one of my developer. we wrote these custom reports, that work very nicely, but are tedious... user has ability to control break, etc. I can achieve all this from interactive reports, but printing is the problem.
    My thought if I can do this, is to generate the report on a printer friendly page, and just print from there.
    any other suggestions?
    Thanks,
    Scott

    I am having trouble, too, getting PDF reporting to users in a way that they're satisfied with.
    1. Example of vanilla PDF without BI publisher.
    https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B5IT1IH9Rb7NNzM2MjgyODQtOTEzMC00NDJiLTg4MzgtOTExYmQ2OTJlODA1&hl=en&authkey=CNKg9bkD
    I have not found a way to change the margins or other column settings. So the reports will have minimal utility for our users, who are auditors and who like to save their analyses.
    I welcom help on how to use and override the Print Attributes > Page Attributes settings for PDF? Paper Size , Orientation, and width/height seem to work, but have no impact on the actual body printing. E.g. setting tabloid landscape 17x11 " works, but the report is still the same size as with letter landscape 11x8.5 setting. There's no way to set the margin.
    2. Example of my best work around. Here, the user prints from browser - Google Chrome - to PDF. I use free Windows PDF utility Bullzip PDF Printer. The same look and feel goes to a physical paper printer.
    https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B5IT1IH9Rb7NMDBhM2NiOTEtZmUwOC00NDY2LWFmOGYtYjJiMTVkZjgyZmQy&hl=en&authkey=CPm818sC
    Chrome however does not now have the option to print the background colors, so you can't get your tabs and other graphic elements to look identical to on-screen pages. You have to adjust the row count on the Apex page so all rows are displayed - if you do, the browser will print multiple pages until all rows have been put into the pdf. Another advantage for the users is that they can choose to display all the filter and grouping selections on screen and capture them in the PDF output, similar to what we do in one of our Oracle Forms and Oracle Reports applications.
    Other browsers (Internet Explorer and Firefox) seem not to be able to print all the rows.
    Skip

  • Preserving control break formatting in report downloads with BI Publisher

    Hello,
    I am using APEX 4.0.2 and would like to know if anyone has a step by step process or tutorial for preserving control break formatting in an interactive report that has been downloaded to any or all of the available file formats. I am using BI Publisher, to which I am very new, to do the report printing of the Reports Region to a PDF, RTF, XLS, CSV or HTML file. Currently, when we download the report to any of the file formats, the formatting is stripped out and only standard row/columns are being saved.
    BTW, I have changed my username to something more friendly but it has not yet taken effect.
    Thanks,
    Marcy

    Hi Venkat,
    Thanks for your quick respond.
    1.) Auto Run is enabled. And the report runs automatically as well. But then it ignores the dashboard prompt (as a regular report would do as well). But when I choose some values in the prompt and then press go. Then it says I have to press on view as well.
    2.) no that is not the case. My report is so big that it always need a scroll bar ;) also adjusting the size settings in the dashboard doesn't help. The only occurs when viewing in HTML, when previewing in excel or RTF it all just work fine.
    3.) true, but ow well this is the least importetant one ;) so if this doesn't work, than it doesn't work ;)
    4.) Ok, I will have a look on that.
    5.) I did enabled HTML and EXCEL outputs in my BIP report. But when the first point is working, then I don't want to see the control bar anymore and I want to have the output on the dashboard in HTML and then I want to build a button, or a link or something that exports the request to excel. Is that possible?

  • Control break on column displayed as link in Interactive Report

    Hi,
    If someone can help me, i'd greatly appreciate it!
    I created an interactive report - one of the columns has a link attached to url specified in the Report Attributes/ link section.
    When I use the control break feature in the gear icon, the report seems to be grouped by the url/link and not by the actual column value.
    When I remove the link from the column - all is fine and the break does work.
    This column must get displayed as a link. Is there any workaround for this problem?
    Thanks,
    Hindy
    Edited by: hindyp on Dec 2, 2009 7:33 AM

    Hi,
    I don't know the details of the procedure, but you would have something like:
    CREATE OR REPLACE PROCEDURE "print_model_change"
      v_acctnum NUMBER,
      v_model VARCHAR2,
      v_rrcode NUMBER
    AS
    BEGIN
      .. DO SOMETHING WITH v_acctnum, v_model, v_rrcode
    END;This needs to be updated to something like:
    CREATE OR REPLACE PROCEDURE "print_model_change"
      v_manager_model NUMBER
    AS
    BEGIN
      DECLARE
        v_acctnum NUMBER;
        v_model VARCHAR2;
        v_rrcode NUMBER;
      BEGIN
        SELECT ACCTNUM, MODEL, RRCODE
        INTO v_acctnum, v_model, v_rrcode
        FROM .. your report's FROM statement plus ..
        WHERE MANAGER_MODEL = v_manager_model;
        .. DO SOMETHING WITH v_acctnum, v_model, v_rrcode
      END;
    END;and followed by:
    GRANT EXECUTE ON "print_model_change" TO PUBLICto make it available
    The existing code receives all the data it would need (presumably). The updated code receives the manager_model value and, using the same FROM clause that you have for your report PLUS a WHERE clause (or, if you are using a WHERE clause in your report, change this to AND), finds the data that it needs for v_acctnum etc. After it has that data, the rest of the existing code can be used unchanged.
    Andy

Maybe you are looking for