Control break functionality for ALV

HI experts,
i want to know how to use control break functionality in ALV's
i 've an int table , which i am processing for AT NEW lgtyp (storage type)
for every set of same lgtyp records , iam making some calculations on itab,
and getting my final int table.
so, for every set of new lgtyp values , i've a new final int table ,
which i need to pass to ALV.
my requirement is for every new storage type
  get a block of output.
how to do this in ALV, waiting for response.

Hi,
   DOnt use AT NEW , use ON CHAGE
Refer this code
FORM sub_claculate_plug .
*--Local Variables
  DATA : lv_index LIKE sy-tabix,
         lv_total TYPE kzwi2.
  LOOP AT it_final INTO wa_final.
    lv_index = sy-tabix.
    v_month = wa_final-erdat+4(2).
    v_year  = wa_final-erdat+0(4).
    IF NOT p_bud IS INITIAL.
*--Collect all the plug numbers
      PERFORM sub_collect_plug.
    ENDIF.
    ON CHANGE OF v_month.
      v_ship = v_ship + v_wdays.
    ENDON.
    CLEAR : wa_nday.
    READ TABLE it_nday INTO wa_nday WITH KEY erdat = wa_final-erdat
                                             BINARY SEARCH.
    IF sy-subrc EQ 0.
      IF wa_nday-flag NE 'X'.
        IF v_wdays NE 0.
          wa_final-totbud = p_bud / v_wdays.
        ENDIF.
      ENDIF.
    ENDIF.
    wa_final-totrev = wa_final-corebus +
                      wa_final-onbulk  +
                      wa_final-premier +
                      wa_final-shipit  +
                      wa_final-onpromo +
                      wa_final-netrev  +
                      wa_final-storev  +
                      wa_final-connet  +
                      wa_final-sporder.
    lv_total = wa_final-corebus +
               wa_final-onpromo +
               wa_final-netrev.
    IF NOT wa_final-oltot IS INITIAL.
      wa_final-ordsize = lv_total / wa_final-oltot.
    ENDIF.
    MODIFY it_final FROM wa_final INDEX lv_index TRANSPORTING
                                        totbud totrev ordsize.
*--Clear
    CLEAR : wa_final,
            v_days,
            v_jan,
            v_wdays,
            v_ndays,
            v_count.
  ENDLOOP.
ENDFORM.                    " sub_claculate_plug
Regards,
Prashant

Similar Messages

  • Control break statement for more than one fields

    How can I accomodate more than 2 fields in control break statement?
    e.g. if I want to have control on these fields land1 plant , how can I use it in At statement?
    Thanks

    Hey Marcin,
    If you define the table as:
    DATA:
    BEGIN OF ITAB OCCURS 0,
    LAND TYPE LAND1,
    WERKS TYPE WERKS_D,
    END OF ITAB.
    Then AT NEW WERKS will be triggered whenever there is change in either LAND or WERKS:
    LOOP AT ITAB.
    AT NEW WERKS.
    ENDAT.
    ENDLOOP.
    So
    If you want to use both field as one, you will need to create another field and hold there concatenation of LAND1 and PLANT
    is not required.
    Correct me if i am wrong
    BR,
    Suhas
    Edited by: Suhas Saha on Feb 15, 2010 3:14 PM

  • "Control + F5"  standard filter functionality for ALV Grids

    Hi all,
    After an ALV Grid is displayed on screen there is a standard functionality to filter a selected column.
    You can select a column (click on the head) of the ALV, then "Control + F5" and a pop-up appears to insert a value or a range by which the filtration is going to be done.
    But a I have problem with a concrete field. It doesn`t seem different on comparison with other fields (CHAR30), but I don`t know why it doesn`t work correctly as others.
    Have you had any situation like this ??
    Thanks & sorry for my bad english,
    Rubè

    Hi Frank,
    When you are entering  89012  and pressing enter the additional zeros are adding up because of the data type of VBELN We have standard conversion routine attached with this .So when ever u wrtie any text that routine will works.
    Can you please check what data type are you using in the internal table that you are binding  to the node?
    Thanks and Regards,
    NSingh
    Edited by: Nsingh on Feb 17, 2012 4:52 AM

  • Enhancing print functionality for ALV report

    Our client requires a special Print at click button in few reports and screens in such a way that there is no effort in setting page sizes etc. 
    For one particular report, there are many columns.  When I try to use List -> Print, only first few columns are printed.  I want that all the columns are printed in landscape manner in different pages and the first column is repeated in both pages (it is frozen in report). 
    How to make these happen?

    HI,
    You can try following steps,
    1) Goto transaction SPAD and create Page formate according to your requirement.
    2) Create format and copy action from standard format.
    3) create device type
    4) assign that device type to custamize output type.
    When ever you take print out of that ALV use your custamize Output Type

  • Cant use Export to Excel functionality for ALV if I add a custom button

    Hi,
      I have added a custom button the the ALV toolbar by creating a GUI status and using the USER_COMMAND event. However. Now I dont the get the standard ALV toolbar with all the options for sorting, exporting to excel etc.
      Can someone show me how I can do both, add my own button to the toolbar as well as use ALV Grid toolbar. Currently the ALV grid standard toolbar has disappeared
    Thanks for reading

    Hello,
    I am not sure how you are creating your ALV report.  If you are using FM REUSE_ALV_GRID_DISPLAY there is a parameter callled I_CALLBACK_PF_STATUS .  Read the documentation for this field from the doc for the FM.  It tells you to copy a standard PF status from fucn group SLVC_FULLSCREEN and then add your new button to that staus.
    If you are using class CL_SALV_MODEL_BASE there is a method called set_screen_status that lets you do a similar thing - copy an existing PF status and add your button.
    Hope that helps
    Regards
    Greg Kern

  • 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.

  • Hiding Control Break icon in IR

    How do I disable the delete option from the control break icon on IR's . I know you can use span.pb to hide the delete for highlighting.

    Go to your Page -> Interactive Report -> Report Attributes and scroll down to the section "Search Bar".
    There you'll see a number of checkboxes, one of them beeing "Control Break". Uncheck it and the user won't have the Control-Break Function anymore.
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    Work: http://www.click-click.at

  • Doubt in control break statement

    Hi All,
    Is there any way to trigger control break statements at new & at end of for non primary key fields.
    i want to trigger both control break statements for my requirement , not at change of, because i want to trigger at end of also. Please let me know if any possibility. Thanks
    regards
    vishal

    hi vishal,
    Variants:
    1. AT NEW f.
    2. AT END OF f.
    3. AT FIRST.
    4. AT LAST.
    Effect
    In a LOOP which processes an internal table, 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 them is then executed if a control break occurs.
    You can use these key words for control break processing with internal tables only if a loop is actively processing an internal table and reference is to the innermost currently active loop.
    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.
    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.
    Between AT and ENDAT, you can use SUM to insert the appropriate control totals in the numeric fields (see also ABAP Number Types) of the LOOP output area (on the right) after the current control level key. Summing is supported both at the beginning of a control level (AT FIRST, AT NEW f) and also the end of a control level (AT END OF f, AT LAST).
    At the end of the control level processing (i.e. after ENDAT), the old contents of the LOOP output area are restored.
    Notes
    When calculating totals, you must ensure that the totals are inserted into the same sub-fields of the LOOP output area as those where the single values otherwise occur. If there is an overflow, processing terminates with a runtime error.
    If an internal table is processed only in a restricted form (using the additions FROM, TO and/or WHERE with the LOOP statement), you should not use the control structures for control level processing because the interaction of a restricted LOOP with the AT statement is currenly not properly defined.
    With LOOPs on extracts, there are also special control break control structures you can use.
    Note
    Non-Catchable Exceptions:
    SUM_OVERFLOW: Overflow when calculating totals with SUM.
    Variant 1
    AT NEW f.
    Variant 2
    AT END OF f.
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas.See Compatible Work Area with Control Level Processing and Field Symbols Not Allowed as Control Level Criterion.
    Effect
    f is a sub-field of an internal table processed with LOOP. The sequence of statements which follow it is executed if the sub-field f or a sub-field in the current LOOP line defined (on the left) before fhas a different value than in the preceding (AT NEW) or subsequent (AT END OF) table line.
    Example
    TYPES: BEGIN OF COMPANIES_TYPE,
            NAME(30),
            PRODUCT(20),
            SALES TYPE I,
          END   OF COMPANIES_TYPE.
    DATA: COMPANIES TYPE STANDARD TABLE OF COMPANIES_TYPE WITH
                         NON-UNIQUE DEFAULT KEY INITIAL SIZE 20,
          WA_COMPANIES TYPE COMPANIES_TYPE.
    LOOP AT COMPANIES INTO WA_COMPANIES.
      AT NEW NAME.
        NEW-PAGE.
        WRITE / WA_COMPANIES-NAME.
      ENDAT.
      WRITE: / WA_COMPANIES-PRODUCT, WA_COMPANIES-SALES.
      AT END OF NAME.
        SUM.
        WRITE: / WA_COMPANIES-NAME, WA_COMPANIES-SALES.
      ENDAT.
    ENDLOOP.
    The AT statements refer to the field COMPANIES-NAME.
    Notes
    If a control break criterion is not known until runtime, you can use AT NEW (name) or AT END OF (name) to specify it dynamically as the contents of the field name. If name is blank at runtime, the control break criterion is ignored and the sequence of statements is not executed. If name contains an invalid component name, a runtime error occurs.
    By defining an offset and/or length, you can further restrict control break criteria - regardless of whether they are specified statically or dynamically.
    A field symbol pointing to the LOOP output area can also be used as a dynamic control break criterion. If the field symbol does not point to the LOOP output area, a runtime error occurs.
    If you use AT within a LOOP with an explicitly-specified output area, the area must be compatible with the line type of the internal table so that it can be initialized properly (as described above) at the start of a new control level.
    You can restrict control break criteria further, regardless of whether they were defined statically or dynamically, by specifying offset and/or length.
    Variant 3
    AT FIRST.
    Variant 4
    AT LAST.
    Effect
    Executes the appropriate sequence of statements once during the first (AT FIRST) or last (AT LAST) loop pass.
    Example
    TYPES: BEGIN OF COMPANIES_TYPE,
            NAME(30),
            PRODUCT(20),
            SALES TYPE I,
          END   OF COMPANIES_TYPE.
    DATA: COMPANIES TYPE STANDARD TABLE OF COMPANIES_TYPE WITH
                         NON-UNIQUE DEFAULT KEY INITIAL SIZE 20,
          WA_COMPANIES TYPE COMPANIES_TYPE.
    LOOP AT COMPANIES INTO WA_COMPANIES.
    AT FIRST.
    SUM.
    WRITE: 'Sum of all SALES:',
    55 WA_COMPANIES-SALES.
    ENDAT.
    WRITE: / WA_COMPANIES-NAME, WA_COMPANIES-PRODUCT,
    55 WA_COMPANIES-SALES.
    ENDLOOP.

  • Control breaks and field concatenation

    can we concatenate fields  when using control break statements
    for eg :
    AT NEW waers.
            SUM.
            CONCATENATE
                       tbl_final_temp-text
                       tbl_final_temp-waers
                       v_tbl_final-wrbtr
                       v_tbl_final-wrbtr
                       INTO tbl_download-data
                       SEPARATED BY c_comma.
            APPEND tbl_download.
            CLEAR tbl_download.
            CLEAR v_tbl_final-wrbtr.
          ENDAT.

    check this
    REPORT zforum12 .
    data : begin of itab occurs 0,
           f1(10) type c,
           f2(20) type c,
           end of itab.
    DATA : VAL(50) TYPE C,
           V_F1(10) TYPE C,
           V_F2(10) TYPE C.
    DATA: C TYPE I.
           itab-f1 = '12345'.
           itab-f2 = 'CM'.
           APPEND ITAB.
           itab-f1 = '12345'.
           itab-f2 = '23-73276453'.
           APPEND ITAB.
           itab-f1 = '12345'.
           itab-f2 = '00000160867'.
           APPEND ITAB.
           itab-f1 = '12345'.
           itab-f2 = 'CMT'.
           APPEND ITAB.
           C = 10.
           SORT ITAB BY F1 .
           LOOP AT ITAB.
           V_F1 = ITAB-F1.
           V_F2 = ITAB-F2.
           AT NEW F1.
           CONCATENATE V_F1 SPACE INTO  VAL+0(10).
           ENDAT.
           CONCATENATE V_F2 SPACE INTO VAL+C(10).
           C = C + 10.
           AT END OF F1.
           CONDENSE VAL.
           WRITE:/ VAL NO-GAP.
           CLEAR C.
           ENDAT.
           ENDLOOP.
    regards,
    vijay.

  • ALV Control break events

    Hi all,
    I have a requirement in ALV ,
    100 abc
    100 xyz
    using control break statement how we remove two hundreds and display output only one 100 ,names
    100 abc
        xyz.
    regrads,
    Praveen

    Hi,
    with the help of sort option you can get that. just check this sample.
    REPORT  ZTEST_ALV1                              .
    TYPE-POOLS: SLIS.
    DATA:
      LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
      LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      LT_SORT     TYPE SLIS_T_SORTINFO_ALV,
      LS_SORT     TYPE SLIS_SORTINFO_ALV.
    DATA: BEGIN OF ITAB OCCURS 0,
           VBELN LIKE VBAK-VBELN,
           POSNR LIKE VBAP-POSNR,
          END OF ITAB.
    ITAB-VBELN  = '12345'.
    ITAB-POSNR = '10'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-VBELN = '12345'.
    ITAB-POSNR = '11'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-VBELN = '12345'.
    ITAB-POSNR = '12'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-VBELN = '12356'.
    ITAB-POSNR = '10'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-VBELN = '12356'.
    ITAB-POSNR = '11'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-VBELN = '12356'.
    ITAB-POSNR = '12'.
    APPEND ITAB.
    CLEAR ITAB.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        I_PROGRAM_NAME         = SY-REPID
        I_INTERNAL_TABNAME     = 'ITAB'
        I_INCLNAME             = SY-REPID
      CHANGING
        CT_FIELDCAT            = LT_FIELDCAT
      EXCEPTIONS
        INCONSISTENT_INTERFACE = 1
        PROGRAM_ERROR          = 2
        OTHERS                 = 3.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LS_SORT-FIELDNAME = 'VBELN'.
    LS_SORT-UP        = 'X'.
    *ls_sort-group = 'UL'.  "using this you can get new lines
    APPEND LS_SORT TO LT_SORT.
    CLEAR LS_SORT.
    LS_SORT-FIELDNAME = 'POSNR'.
    LS_SORT-UP        = 'X'.
    *ls_sort-group = '*'."using this you get new pages
    APPEND LS_SORT TO LT_SORT.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        IT_FIELDCAT = LT_FIELDCAT
        IT_SORT     = LT_SORT
      TABLES
        T_OUTTAB    = ITAB.
    Regards
    vijay

  • Is there any functionality for AVERAGE in ALV, like do_sum, subtot?

    Hi Experts,
    In my_alv report, am doing sub/totals for prices, by using do_sum, subtot functions.........fine. But, I need to do/display the AVERAGE value for Discount % column?
    Is there any functionality for AVERAGE in ALV, like do_sum, subtot?
    thanq

    hi
    check these links out
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    regards
    vijay
    reward points if helpful

  • Qosmio X300 - Remote control and function bar for windows seven

    Hi,
    I have bought this PC with Vista x64. I have upgraded it to windows 7 (x64)
    But I didn??t find driver for remote control and function bar. The drivers for Vista *64 don't work.
    Help me plz.
    Thanks for reading
    (Sry for my bad English)

    Hi
    The Win 7 drivers are not available for this unit at this time.
    But I found some Win 7 drivers on the Toshiba US driver page.
    Of course you will not find exactly the same X300 series but you can choose the drives released for Qosmio X305-xxxx
    There is no big difference between X300 and X305 so the Win 7 drivers should work too

  • Enable Dual control function for FBZ2

    Hi,
    Its related to Dual control functionality for vendor master data.  I got a issue, if I change the sensitive fields for a vendor master and run F110, then it shows exception that vendor master not yet confirmed.
    IS it possible to post outgoing payment through transaction FBZ2, in this case?
    I have seen some transactions where the clearing document was posted by transfering the payable amount to intercompany or offsetting account and making payment later, without getting any exception, eventhough vendor master change not yet confirmed.

    hello, anisha.
    like you, i have also wondered what the payment block in the customer master is for.  after reading the documentation and asking an FI consultant, i gather that this block is apparently used to prevent automatic payment transactions for a customer.
    again, why anyone would want to automatically post payments for a customer is an issue i wish to explore.  perhaps this applies to scenarios where very many customers pay the exact invoice amount or have the payments guaranteed?  or perhaps to prevent automatic offsetting of a customer/vendor account?
    regards.
    Edited by: jonathan y on May 6, 2009 10:23 AM

  • Maximum Number of Columns for Control Break on APEX Reports

    Hi
    I'm new to APEX. I just want to ask if the number of maximum columns for control break in Reports can be adjusted? I have noticed that it can only handle up to six columns for Control Break, I just want to know if it can have more than six columns.
    Thank you very much.

    Are you sure it's the number of columns? It may be one of the columns that is causing this problem.

  • Need a multi-level control break report displaying a cross-tab for each ...

    I need a multi-level control break report that displays a cross-tab report for each
    detail and subtotal. The individual cross-tabs are no problem. There are two issues:
    1) How to get many cross-tabs (thousands) to appear in one report.
    2) How to provide cross-tabs in-line on the multi-level subtotal lines.
    Here is a concrete example.
    Suppose the data base contains this table:
    road (
    id_number number, -- this is an artificial PK
    city varchar2,
    county varchar2,
    state varchar2,
    length number,
    owner varchar2, -- roads may be owned by cities, counties, states, and others
    surface_type varchar2 -- the surface type may be gravel, asphalt, concrete, and others
    The table is populated with several million records that include every
    length of road in a US city.
    It is OK to suppose that all the attributes in all the records are not null.
    Without the PK, there would be millions of duplicates,
    which should all contribute to the summed lengths.
    The report I need is like a control break report with a detail line for each
    city together with subtotals for each county and state and
    a grand total for the US at the end.
    However, each detail and total line needs to be a cross-tab report
    summing the length over the city, county, state or US
    (whichever is called for at that location)
    for each combination of owner and surface_type.
    so the report would have the following structure:
    a city cross-tab for the first city in county 1/state 1
    a city cross tab for the last city in county 1/state 1
    a cross-tab for count 1
    a city cross tab for the first city in county 2/state 1
    a city cross tab for the last city in county 2/state 1
    a cross tab for state 1
    a cross-tab for the US
    Any suggestions will be appreciated.
    This problem comes up because my client's legacy system,
    which is being replaced,
    already has such a report (in COBOL).
    Thanks!!!
    Steve
    PS, I know one ugly way to do it. Namely, make a variable for each
    possible combination of owner and surface. Then code an ordinary control
    break report. However, I am looking for something better.

    Hi Jenna_Fire,
    According to your description, you have a matrix contains total for each group on each level. Now your requirement is, when you click on any number (data field or total), it will go to the detail report which returns all the detail information of the people
    within the group scope. For example, if you click on the total of Active users in United States, it will return the detail information of Active users in New York and Texas. Right?
    In this scenario, we should set the parameter (@Country, @State, @City) allow multiple values in both main and detail report. And in Default Value (@Country, @State, @City), query out all distinct values. In the textbox which contains
    those total values, when set use these parameters to run the report, we only need to pass the parameters of parent groups. For example, if we click on the total of Active users in New York, we only need to pass Country, State, Status to detail report, and
    in the detail report, the City parameter will use all distinct values (Default Values) because we don't pass the City parameter. We have tested this case with sample data in our local environment. Here are steps and screenshots for your reference:
    1. Create parameter Country, State, City and Status in both main report and detail report. Set both Available Value and Default Value get values from query (Create a dataset for each parameter, use "select distinct [column] from [table]" as query). Set allow
    multiple values for parameter Country, State and City in both reports.
    2. In corresponding textbox, pass appropriate parameters in go to report Action.
    4. Filter data in detail report (in where clause or using filters).
    5. Save and preview. It looks like below:
    Reference:
    Using Parameters to Connect to Other Reports
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

Maybe you are looking for

  • Batch file renaming in Aperture??

    I have need to rename several files as a batch. Aperture can get me 99% of the way there, but there´s one thing I can´t seem to do... The naming scheme I need is [filname]_[yyyymmdd-hhmmss].jpg Where yyyymmdd is year, month, day and hhmmss is hours,

  • Difficulty with Licensing Android apps developed with Flash CS6

    Hi, I'm heading down many a blind alley with this one. I have developed an Android app using Flash CS6 and it is ready to be published on Google Play. However, as it is a paid app, it is strongly advised to license it to protect it. There is a bit of

  • Compile error in win-ME

    i jus installed jdk1.2 on my windows me system but when i compile the program .. it gives me an error.. "javac has caused an error in msvcrt.dll.. will close now" can someone tell me the solution for this... Thanx

  • Styles disappearing from the drawer after scrolling

    I have more styles in my document than fit in the styles drawer. But when I try to scroll, the drawer becomes empty. I tried this on two different Macs with 10.9 and Pages 5.2. The document was imported from an older version of pager. After moving a

  • Support After Implementing Custom Update to Private Oracle API?

    A third party (non Oracle partner) stated the following. "**Note: The use of the private APIs will not cause Oracle to stop support altogether for #####'s ERP.  Oracle Support will see this as a non-supported integration and #### would be responsible