Grand total and total in all page

page 1
colum1 | cloum2
4 | 55
1 | 6
in Footer page1
5 | 61
page 2
colum1 | cloum2
2 | 3
1 | 6
in Footer page2
3 | 9
--------- i want
in Footer page2
8 | 70
plez help me
Message was edited by: azmi
user490620

What do you want exactly?
Your subject says other thing then your actual question.
Any how it snot difficult.
Put summery Columns calculating the SUM of both fields (reset at report)
& Set there property "print object on" to "last page".
Hope it 'll work.
Capri...

Similar Messages

  • Interactive Report Sub-total and total

    Hi friends,
    I have an employee interactive report with group by job name and also showing the salary sub-total for each and every job(group by).
    I have an requirement like to highlight the sub-total for each and every job with a background color so that the user can identify the sub-total with the color, and also whether it is possible to display an overall total @ last in the report with a label named "Total Salary" in which it calculates the overall salary is also to be highlightened with the background color.
    Also is it possible to display a text "Sub-total" besides each and every salary sub-total  of job(group by). Currently if we display a sum for the salary then im getting the total's but with out a text named total.
    Since i can see the highlighted feature in interactive report but im not sure how to apply it for the sub-total and total column.
    I have reproduced the example in apex.oracle.com
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    In the application 9494 named "test" in page1.
    Thanks in advance.
    Brgds,
    Mini

    Hi, Mini,
    style=background-color:red;
    But that Total region color dint change.The code for style should be in "Form HTML Element Attributes". However, this changes the background color only for the Total value not for the whole row.
    If you want to change for the whole row, you need to change the template that is selected for the region.
    I changed the region template in your application to "Borderless Region" and made the changes to the "Borderless Region" template, it now shows the background color for Total Value.
    <table class="t20Region t20Borderless #REGION_CSS_CLASSES#" id="#REGION_STATIC_ID#" border="0" cellpadding="0" cellspacing="0" summary="" #REGION_ATTRIBUTES#>
    <thead><tr><th class="t20RegionHeader" id="#REGION_STATIC_ID#_header">#TITLE#</th></tr></thead>
    <tbody id="#REGION_STATIC_ID#_body">
    <tr><td class="t20ButtonHolder">#CLOSE##PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</td></tr>
    <tr><td class="t20RegionBody" style="background-color:orange">#BODY#</td></tr>
    </tbody>
    </table>The below does the trick. :)
    <tr><td class="t20RegionBody" style="background-color:orange">#BODY#</td></tr>Note: I made the changes to "Borderless Template", but you can copy the template to your own and apply this change.
    Regards,
    Natarajan

  • Sub-total and Total for a column having checkboxes in WD ABAP ALV

    Hello Experts,
    I have used ALV in We bdynpro ABAP to display my output. There are 2 columns that are checkboxes in Output. I want a sub-total and total for those two columns. I know tht total and sub-total functionality is available only for numeric fields .
    Is there any other indirect way by which i can achieve the same ?

    Hi Ragini,
    Please refer this thread: [alv total and subtotal|How to display graphs;.
    I hope it helps.
    Regards
    Arjun

  • Sub totals and Totals

    I am developing a query using SQVI.
    How do I insert subtotals and totals for certain fields at the end of the query report.
    Thanks
    Sandeep

    hI SANDEEP  .....
    if you  go with  layou mode   then    there will be   3  pops  like   delete  ,  TOOL BAR  , SORT FIELDS ....etc ..
    there is  TOOL BAR   with the following  options   ...
    Background
    Heading
    Normal
    <b>Subtotals</b>
    Key Columns
    Positive
    Negative
    Control Levels
    Background (intensified
    Header (intensified)
    Normal (intensified)
    Sum totals (intensified
    Keys (intensified)
    Positive (intensified)
    Negative (intensified)
    Control lev.(intensifie
    so  that  by selecting the  fields   .....  liek sub total   acrros the  Fiscal  year  can be done  ....  Document wise   sub total  ..... vendor wise   , customer wise  ... like  based  on the fields   selection for sub total  and   total can  be  done ...
    Girish

  • Caculating page wise sub totals and totals

    Friends,
    I am working on an ADOBE form,  where i need to calculate subtotals and grand totals for the invoice lines displayed.
    I achieved the functionality in the smartforms by defining a different window under the main window(this contains line amounts). For the new window where the subtotal is expected to print i triggerred the event 'Before the end of main window' to print the totals before the lines flow to the next page by auto page break in the main window.
    I tried in the forms putting different content area(other than the main content area where table lines are printed) for the subtotals in the layout designer and manipulated using all the pagination options avialable in the table properties, but in vain. 
    What exatly is the equivalent for the event 'Before the end of main window' as that of smart forms.
    Any inputs on this?
    regards
    Nalinikanth.

    Hi Nalinikanth,
    assumed you have a table created with subforms like
    MyTable
    - Header
      (text elements)
    - Data
      (repeating subform with line elements)
    you can create a line with subtotal as following:
    1. Define a new line below "MyTable" for the subtotals with name e.g. "Subtotals" and insert elements (similar to the ones in "Data").
    2. In subform "Data": palette Object -> Pagination -> Overflow Trailer: "Subtotals"
    3. In Hierarchy palette, right-click on "Subtotals" -> Insert Script Object
    4. name this script object "tableCalcs" and insert following code
    *   Table Calculation Functions
    *     To invoke these functions:
    *   syntax:     scriptObjectSOM.obj.functionName(sFieldName, [startPage], [endPage]);
    *   example:     tableCalcs.Sum("Field1", 2, 3);
    *   notes:           
    *                    -The SOM expression of the Script Object may vary upon its position in the Hierarchy.
    *                    -The start and end page arguments are 0-based numbers or a reference to an XFA object.
    DO NOT MODIFY THE CODE BEYOND THIS POINT - 705.20051114114126.253659.250577 - tableCalcs.xfo
    var obj = new CalcObject();
    function CalcObject()
         this.Sum = _doSum;
         this.Average = _doAverage;
         this.Count = _doCount;
    *     Calculate the sum of all fields with the same name.
    *      NUMBER Sum(STRING sFieldName, [NUMBER pageNum])
    *      NUMBER Sum(STRING sFieldName, [OBJECT xfaObject])
    *      NUMBER Sum(STRING sFieldName, [NUMBER startPage], [NUMBER endPage])
    *      NUMBER Sum(STRING sFieldName, [OBJECT xfaObject], [OBJECT xfaObject])
    *     param1:     STRING; Name of field to calculate sum of
    *     param2:     NUMBER; Start page for calculation
    *     param2:     OBJECT; XFA object on the page calculation will start on
    *     param3:     NUMBER; End page for calculation
    *     param3:     OBJECT; XFA object on the page calculation will end on
    *     return: NUMBER; Sum of all fields
    function _doSum(fieldName)
         var fieldSum = null;
         var startPage = 0;
         var endPage = 0;
         var lengthOfDecimal = 0;
         if (arguments.length == 2) {
              startPage = _GetPageNum(arguments[1]);
              endPage = startPage;
         } else if (arguments.length == 3){
              startPage = _GetPageNum(arguments[1]);
              endPage = _GetPageNum(arguments[2]);
         } else {
              startPage = 0;
              endPage = xfa.layout.pageCount() - 1;
         if ((startPage < 0) || (endPage < 0) || (startPage > endPage))
              throw new PageNumberException(startPage, endPage);
         var curPage = startPage;
         while (curPage <= endPage) {
              // Get the field containers on the current page
              var oFields = xfa.layout.pageContent(curPage, "field");
              var fieldCount = oFields.length;
              // Continue if fields were found on the page
              if (fieldCount > 0) {
                   var i = 0;
                   for (i=0; i < fieldCount; i++) {
                        if (oFields.item(i).name == fieldName) {
                             //only count non-empty/numeric fields
                             var fieldVal = _GetFieldVal(oFields.item(i));
                             if (fieldVal != null) {                         
                                  fieldSum += fieldVal;
                             if (_GetLengthOfField(oFields.item(i)) > lengthOfDecimal) {
                                  lengthOfDecimal = _GetLengthOfField(oFields.item(i));
              curPage++;
         if (fieldSum == null)
              throw new FieldNotFoundException(fieldName);
         if(lengthOfDecimal > 0) {
              return fieldSum.toFixed(lengthOfDecimal);
         return fieldSum;
    *     Calculate the average of all fields with the same name.
    *      NUMBER Average(STRING sFieldName, [NUMBER pageNum])
    *      NUMBER Average(STRING sFieldName, [OBJECT xfaObject])
    *      NUMBER Average(STRING sFieldName, [NUMBER startPage], [NUMBER endPage])
    *      NUMBER Average(STRING sFieldName, [OBJECT xfaObject], [OBJECT xfaObject])
    *     param1:     STRING; Name of field to calculate average of
    *     param2:     NUMBER; Start page for calculation
    *     param2:     OBJECT; XFA object on the page calculation will start on
    *     param3:     NUMBER; End page for calculation
    *     param3:     OBJECT; XFA object on the page calculation will end on
    *     return: NUMBER; Average of all fields
    function _doAverage(fieldName)
         var fieldCount = null;
         var fieldSum = null;
         var startPage = 0;
         var endPage = 0;
         var lengthOfDecimal = 0;
         if (arguments.length == 2) {
              startPage = _GetPageNum(arguments[1]);
              endPage = startPage;
         } else if (arguments.length == 3){
              startPage = _GetPageNum(arguments[1]);
              endPage = _GetPageNum(arguments[2]);
         } else {
              startPage = 0;
              endPage = xfa.layout.pageCount() - 1;
         if ((startPage < 0) || (endPage < 0) || (startPage > endPage))
              throw new PageNumberException(startPage, endPage);
         var curPage = startPage;
         while (curPage <= endPage) {
              // Get the field containers on the current page
              var oFields = xfa.layout.pageContent(curPage, "field");
              var allFields = oFields.length;
              // Continue if fields were found on the page
              if (allFields > 0) {
                   var i = 0;
                   for (i=0; i < allFields; i++) {
                        if (oFields.item(i).name == fieldName) {
                             //only count non-empty/numeric fields
                             var fieldVal = _GetFieldVal(oFields.item(i));
                             if (fieldVal != null) {
                                  fieldCount ++;
                                  fieldSum += fieldVal;
                             if (_GetLengthOfField(oFields.item(i)) > lengthOfDecimal) {
                                  lengthOfDecimal = _GetLengthOfField(oFields.item(i));
              curPage++;
         if (fieldCount == null)
              throw new FieldNotFoundException(fieldName);
         if (fieldCount != null && fieldSum != null && fieldCount > 0) {
              var average = fieldSum / fieldCount;
              if(lengthOfDecimal > 0) {
                   return average.toFixed(lengthOfDecimal);
              return average;
         else {
              return null;
    *     Calculate the number of fields with the same name.
    *      NUMBER Count(STRING sFieldName, [NUMBER pageNum])
    *      NUMBER Count(STRING sFieldName, [OBJECT xfaObject])
    *      NUMBER Count(STRING sFieldName, [NUMBER startPage], [NUMBER endPage])
    *      NUMBER Count(STRING sFieldName, [OBJECT xfaObject], [OBJECT xfaObject])
    *     param1:     STRING; Name of field to calculate number of
    *     param2:     NUMBER; Start page for calculation
    *     param2:     OBJECT; XFA object on the page calculation will start on
    *     param3:     NUMBER; End page for calculation
    *     param3:     OBJECT; XFA object on the page calculation will end on
    *     return: NUMBER; Number of fields found
    function _doCount(fieldName)
         var fieldCount = null;
         var startPage = 0;
         var endPage = 0;
         if (arguments.length == 2) {
              startPage = _GetPageNum(arguments[1]);
              endPage = startPage;
         } else if (arguments.length == 3){
              startPage = _GetPageNum(arguments[1]);
              endPage = _GetPageNum(arguments[2]);
         } else {
              startPage = 0;
              endPage = xfa.layout.pageCount() - 1;
         if ((startPage < 0) || (endPage < 0) || (startPage > endPage))
              throw new PageNumberException(startPage, endPage);
         var curPage = startPage;
         while (curPage <= endPage) {
              // Get the field containers on the current page
              var oFields = xfa.layout.pageContent(curPage, "field");
              var allFields = oFields.length;
              // Continue if fields were found on the page
              if (allFields > 0) {
                   var i = 0;
                   for (i=0; i < allFields; i++) {
                        if (oFields.item(i).name == fieldName) {
                             //only count non-empty/numeric fields
                             var fieldVal = _GetFieldVal(oFields.item(i));
                             if (fieldVal != null) {
                                  fieldCount ++;
              curPage++;
         if (fieldCount == null)
              throw new FieldNotFoundException(fieldName);
         return fieldCount;
    function _GetFieldVal(obj)
         var fieldVal = obj.rawValue;
         if (typeof fieldVal != "number") {                         
              if (typeof fieldVal == "string" && fieldVal.length > 0) {
                   fieldVal = parseFloat(fieldVal);
                   if (isNaN(fieldVal))
                        fieldVal = null;
              } else {
                   fieldVal = null;
         return fieldVal;
    function _GetPageNum(val)
         var pageNum = -1;
         if (typeof val == "number") {                         
              pageNum = val;
         else if (typeof val == "object") {
              if (val != null) {               
                   pageNum = xfa.layout.page(val) - 1
         return pageNum;
    function _GetLengthOfField(obj)
         var fieldVal = obj.rawValue;
         if (fieldVal != null) {
              if (typeof fieldVal == "number") {
               fieldVal = new String(fieldVal);
              var index = fieldVal.indexOf(".");
              if (index > -1) {
                   return fieldVal.length - index - 1;
         return 0;
    function getExceptionString() { return this.message; }
    function FieldNotFoundException(fieldName)
         this.message = "Calculation failed: No non-empty fields found called '" + fieldName + "'.";
         this.name = "FieldNotFoundException";
         this.toString = getExceptionString;
    function PageNumberException(startPage, endPage)
         this.message = "Calculation failed: Incorrect page references (start page = " + startPage + ", end page = " + endPage + ").";
         this.name = "PageNumberException";
         this.toString = getExceptionString;
    // END OF DO NOT MODIFY     
    5. In the subtotal fields, add script for event "calculate":
    this.rawValue = this.parent.variables.tableCalcs.obj.Sum("AMOUNT", 0, this);
    where "AMOUNT" is the name of the referenced field.
    HTH & best regards,
    Carlo

  • Sub-totals and Totals calculations....?

    How to Calculate the Sub-totals and Grand totals in ABAP Programs.

    Hi Bhaskar,
    In my opinion this can be acheived in two ways:
    1. Using ALV GRID DISPLAY
    2. Using AT NEW  , ON CHANGE OF  , etc events.
    1. In the ALV field catalogue u create entries for all the fileds to b
    displayed in the output list.
    Here, we need to put DO_SUM = 'X' .
    eg
      ****************fieldcatalog*********************
    data:anytab type slis_t_fieldcat_alv with header line.
    **************pgm name**********************
    data:anypgnm type sy-repid.
    **************events*************************
    anytab-fieldname   = 'MATNR'.
      anytab-seltext_m   = 'Material Number'.
      anytab-col_pos     = 0.
      anytab-outputlen   = 20.
      anytab-emphasize   = 'X'.
      anytab-do_sum = 'X' .                  <----
    here it is.
      append anytab to anytab .
      clear  anytab .
    Now wen u call the fm REUSE_ALV_GRID_DISPLAY , plz pass anytab ie fieldcatalog  and  the tabel with records to  b displayed .
    this would  sum the fields at the end.
    2.  Alternately ....for SUb-totals ;
       Sort itab in an ascending manner.
    Data : wa_itab    like line of itab,
              wa_subtotal type i.
    " fieldname1 in itab is the key field
    " fieldname2 is the value field
    LOOP at itab into wa_itab .
      wa_subtotal = wa-subtotal  + itab-<fieldname2>.
      AT END OF <fieldname1> .
          " your programming logic for subtotal
           Write :/ wa_itab-fieldname1 , wa_subtotal.
           Clear  wa_subtotal.
       ENDAT.
       " write :/  ....if u need to write any lofgic values ....
    ENDLOOP .
    Note : plz sc if a field in itab that is left of fieldname1 changes
              the AT END OF event is triggered.
             Therefoe , see that  pur key fields towards left in itab.
    FYI : u can try ON CHANGE OF....ENDON....
                          AT NEW .....ENDAT
                           AT LAST....ENDAT
                           AT FIRST ......ENDAT  events for ur own understanding
    i hope this helps u.
    Regards
    panakj

  • Printing date and time in all pages

    hi frds
    i wants to display or print system date and time in every pages can anyone give me coding .
    by
    Pari Vendhan.R

    Hi Pari,
    Please write the system date and time in TOP-OF-PAGE event so that it will be printed in each page of output.
    Example:
    report zdatetime
    line-count 60.
    START-OF-SELECTION.
    *-- write your code here
    TOP-OF-PAGE:
    write: 'Date: ', sy-datum.
    write: / ' Time: ', sy-uzeit.
    In top of page write other details along with date and time. Here in the above declaration after each 60 lines a  new page will be triggered and TOP-OF-PAGE will be called for each page before first write statement.
    Regards,
    Yellappa.

  • Logos and Menus on all pages

    I wish to stop using frames. How can I manage logos and menus
    from a central point?

    Server-side includes.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "kwame_za" <[email protected]> wrote in
    message
    news:g9h07t$gig$[email protected]..
    >I wish to stop using frames. How can I manage logos and
    menus from a
    >central point?

  • Page break,sub total and grand total  in adobe forms

    hi,
    In adobe forms, i am displaying purchase order details in table format. internal table contains 150 records but it displaying
    only 50 records in single page. how i have to call a new page,how i have to create a page preak and i want to display only
    5 records for a page with carry forward,page total and total net value.

    Hi Sivaprasath,
    For the table content to flow onto the next pages please make sure that the outermost subform is NOT with the content property "Positioned".
    For having only 5 records per page, you can design a deep structure with fields:
    Table 1 (The table which will hold 5 records per page)
    Page total
    total net value
    Have the table type of it defined in the form.
    Put the logic for filling the table in such a way that each row of this nested table has 5 records and pagetotal and total net value.
    then put it inside a subform and check the checkbox for "rpeat subformt for each data item".
    Another way is to use Conditional breaks in Pagination tab.
    Thanks and regards,
    Priyanka

  • How to show the break totals and NOT the report totals in an SQL report

    APEX 4.0.1
    In an normal SQL report (Not interactive) with a break applied on the first column, how do you just show the break totals and NOT the extra full report totals?
    Next, Is it possible to display only some of the row totals and not for all columns that have the sum option checked against them?
    PaulP

    PaulP wrote:
    APEX 4.0.1
    In an normal SQL report (Not interactive) with a break applied on the first column, how do you just show the break totals and NOT the extra full report totals?Instead of using the APEX break feature, try doing all of this in the query using <tt>GROUPING SETS</tt> or <tt>ROLLUP</tt> to get the break rows, and <tt>GROUPING_ID</tt> in the <tt>HAVING</tt> clause to suppress the unwanted rows.
    Next, Is it possible to display only some of the row totals and not for all columns that have the sum option checked against them?Don't really understand what's meant here?

  • Totals and Sub-Totals in ALV GRID

    Could anyone advice, how to display sub-totals and totals in ALV Grid(using FM).
    Ex:           value1    value2
                      100        50
                      200        50
        subtotal   300      100
        total                    400
    Thanks in advance...

    Refer below demo code and see perform Sort_list..
    it wil serve ur purpose.
    REPORT  ZGILL_ALV    message-id rp                           .
    type-pools slis.
    tables: zgill_main,zgill_details.
    data z_fieldcat type slis_t_fieldcat_alv.
    data begin of itab occurs 0.
    DATA ICON TYPE ICON-ID.
         include structure zgill_main.
    data salary like zgill_details-salary.
    data end of itab.
    *data itab1 like table of itab with header line.
    data : WA_SORT TYPE SLIS_SORTINFO_ALV,
           IT_SORT TYPE SLIS_T_SORTINFO_ALV,
           WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
           IT_FIELDTAB TYPE SLIS_T_FIELDCAT_ALV,
           WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    PARAMETERS: p_list  radiobutton group A1,
                P_GRID  RADIOBUTTON GROUP A1.
    SELECT-OPTIONS: S_PERNR FOR ZGILL_MAIN-PERNR.
    start-of-selection.
    perform fill_itab.
    perform sort_list.
    **************Start of scenario without container******************************************
    *********Method 1***********
    perform fill_fieldcat.  " Manuallly Preparing Fiedl Catalog
    *********Method 2***********
    *perform fill_fieldcat1 changing z_fieldcat.   "Preparing field catalog with merge function
    perform display_alv.
    *****************end of scenario without container*****************************************
    *&      Form  fill_itab
          text
    -->  p1        text
    <--  p2        text
    form fill_itab .
    *select * from zgill_main up to 20 rows INTO CORRESPONDING FIELDS OF TABLE itab.
    *ITAB1[] = ITAB[].
    select apernr aname aorg adob b~salary INTO CORRESPONDING FIELDS OF TABLE itab
           from zgill_main as a join zgill_details as b on apernr = bpernr
           WHERE A~PERNR IN S_PERNR.
    LOOP AT ITAB.
    IF ITAB-PERNR < 1111.
    ITAB-ICON = '@08@'.
    ELSEIF ITAB-PERNR > 1111 AND ITAB-PERNR < 11111111.
    ITAB-ICON = '@09@'.
    ELSEIF ITAB-PERNR GE 11111111.
    ITAB-ICON = '@0A@'.
    ENDIF.
    MODIFY ITAB INDEX SY-TABIX.
    ENDLOOP.
    endform.                    " fill_itab
    *&      Form  display_alv
          text
    -->  p1        text
    <--  p2        text
    form display_alv .
    data repid like sy-repid.
    REPID = SY-REPID.
    WA_LAYOUT-ZEBRA = 'X'.
    WA_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'.
    WA_LAYOUT-SUBTOTALS_TEXT = 'SUBTOTAL'.
    WA_LAYOUT-TOTALS_TEXT = 'TOTAL'.
    IF P_GRID = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = repid
       IT_FIELDCAT                       = IT_FIELDTAB
       IT_SORT                           = IT_SORT
       IS_LAYOUT                         = WA_LAYOUT
    TABLES
        t_outtab                          = itab[]
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2.
    IF sy-subrc <> 0.
       message e016 with 'Error in Display'.
    ENDIF.
    ELSEIF P_LIST = 'X'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = repid
       IT_FIELDCAT                       = IT_FIELDTAB
       IT_SORT                           = IT_SORT
       IS_LAYOUT                         = WA_LAYOUT
    TABLES
        t_outtab                          = itab[]
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2.
    IF sy-subrc <> 0.
       message e016 with 'Error in Display'.
    ENDIF.
    ENDIF.
    endform.                    " display_alv
    *&      Form  fill_fieldcat1
          text
    -->  p1        text
    <--  p2        text
    form fill_fieldcat1  changing d_fcat type slis_t_fieldcat_alv.
    data repid like sy-repid.
    data d_fcat1 type slis_t_fieldcat_alv with header line.
    REPID = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = repid
       I_INTERNAL_TABNAME           = 'ITAB'
       I_STRUCTURE_NAME             = 'ZGILL_MAIN'
      I_CLIENT_NEVER_DISPLAY       = 'X'
      I_INCLNAME                   =
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
    CHANGING
        ct_fieldcat                  = d_fcat[]
    EXCEPTIONS
       INCONSISTENT_INTERFACE       = 1
       PROGRAM_ERROR                = 2
       OTHERS                       = 3.
    IF sy-subrc <> 0.
       message e016 with 'Error in preparing fiedl catalog'.
    ENDIF.
    loop at d_fcat into d_fcat1.
    case d_fcat1-fieldname.
    when 'NAME'.
    d_fcat1-reptext_ddic = 'Emp Name'.
    MODIFY D_FCAT FROM D_FCAT1.
    WHEN 'PERNR'.
    d_fcat1-reptext_ddic = 'Emp Num'.
    MODIFY D_FCAT FROM D_FCAT1.
    WHEN 'ORG'.
    d_fcat1-reptext_ddic = 'Org Unit'.
    MODIFY D_FCAT FROM D_FCAT1.
    endcase.
    clear d_fcat1.
    endloop.
    endform.                    " fill_fieldcat1
    *&      Form  sort_list
          text
    -->  p1        text
    <--  p2        text
    form sort_list .
    CLEAR WA_SORT.
    WA_SORT-FIELDNAME = 'DOB'.
    WA_SORT-SPOS = '1'.
    WA_SORT-UP = 'X'.
    WA_SORT-SUBTOT = 'X'.
    APPEND WA_SORT TO IT_SORT.
    CLEAR WA_SORT.
    WA_SORT-FIELDNAME = 'NAME'.
    WA_SORT-SPOS = '1'.
    WA_SORT-UP = 'X'.
    APPEND WA_SORT TO IT_SORT.
    CLEAR WA_SORT.
    endform.                    " sort_list
    *&      Form  fill_fieldcat
          text
    -->  p1        text
    <--  p2        text
    form fill_fieldcat .
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'ITAB'.
    WA_FIELDCAT-FIELDNAME = 'ICON'.
    WA_FIELDCAT-SELTEXT_L = 'TRAFFIC'.
    WA_FIELDCAT-ICON = 'X'.
    WA_FIELDCAT-ddictxt = 'l'.
    WA_FIELDCAT-COL_POS = 1.
    WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO IT_FIELDTAB.
    CLEAR WA_FIELDCAT .
    WA_FIELDCAT-TABNAME = 'ITAB'.
    WA_FIELDCAT-FIELDNAME = 'PERNR'.
    WA_FIELDCAT-SELTEXT_L = 'EMP NUMBER'.
    WA_FIELDCAT-ddictxt = 'l'.
    WA_FIELDCAT-COL_POS = 2.
    WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO IT_FIELDTAB.
    CLEAR WA_FIELDCAT .
    when 'maktx'.
    WA_FIELDCAT-TABNAME = 'ITAB'.
    WA_FIELDCAT-FIELDNAME = 'NAME'.
    WA_FIELDCAT-SELTEXT_L = 'EMP NAME'.
    WA_FIELDCAT-ddictxt = 'l'.
    WA_FIELDCAT-COL_POS = 3.
    WA_FIELDCAT-OUTPUTLEN = 15.
    APPEND WA_FIELDCAT TO IT_FIELDTAB.
    CLEAR WA_FIELDCAT .
    WA_FIELDCAT-TABNAME = 'ITAB'.
    WA_FIELDCAT-FIELDNAME = 'ORG'.
    WA_FIELDCAT-SELTEXT_L = 'ORG UNIT'.
    WA_FIELDCAT-COL_POS = 4.
    WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO IT_FIELDTAB.
    CLEAR WA_FIELDCAT .
    WA_FIELDCAT-TABNAME = 'ITAB'.
    WA_FIELDCAT-FIELDNAME = 'DOB'.
    WA_FIELDCAT-SELTEXT_L = 'BIRTH DATE'.
    WA_FIELDCAT-COL_POS = 5.
    WA_FIELDCAT-OUTPUTLEN = 12.
    APPEND WA_FIELDCAT TO IT_FIELDTAB.
    CLEAR WA_FIELDCAT .
    WA_FIELDCAT-TABNAME = 'ITAB'.
    WA_FIELDCAT-FIELDNAME = 'SALARY'.
    WA_FIELDCAT-SELTEXT_L = 'SALARY'.
    WA_FIELDCAT-COL_POS = 6.
    WA_FIELDCAT-OUTPUTLEN = 25.
    WA_FIELDCAT-do_sum = 'X'.
    APPEND WA_FIELDCAT TO IT_FIELDTAB.
    endform.                    " fill_fieldcat

  • Weekly Group Total and associated YTD total

    Hello,
    I need to show current week group total and total year to date of the same group.  My columns are Model, Department, Issue.  Currently, the report is grouped on Model, Department and Issue with a filter for date.  Can this be done?   Thank you

    Create a formula field, say {@Current Week Amount} as (basic syntax):
    if datepart("ww", {datefield}) = datepart("ww", CurrentDate) then
      formula = {amount}
    else
      formula = 0
    end if
    You can then sum() this, or place it in a detail line, or whatever.  It will only have a (non-zero) value when the date field is in the current week.
    HTH,
    Carl

  • Calculate totals and sub totals

    hi everybody
    can u plz suggest me how to write code for getting sub totals and totals
    regards
    hridhaya

    Hello hridhayanjili
    SAP provides us with the ABAP statement <b>COLLECT</b> to summarize totals.
    I will give you an example from which you should be able to develop you own solution.
    Let's assume we have an itab containing materials. The itab has the following line structure: MANDT, MATNR, QUANTITY. To calculate subtotals we require a second itab that is identical to the first one.
    Now here is the coding:
    data:
      gt_itab          TYPE STANDARD TABLE OF <structure>,
      gt_itab_collect  TYPE STANDARD TABLE OF <structure>,
      gt_itab_total    TYPE STANDARD TABLE OF <structure>.
      gs_entry         TYPE <structure>.
    * NOTE: <structure> stands for a named DDIC structure or
    * a type definition, not a field symbol.
    * gt_itab contains our materials
      LOOP AT gt_itab INTO gs_entry.
        COLLECT gs_entry INTO gt_itab_collect.
      ENDLOOP.
    * NOTE: Assuming we had 10 entries in gt_itab of
    * 3 different materials we end up with 3 entries in
    * gt_itab_collect that contain the quantities summarized.
    * To calculate the total one could LOOP over
    * gt_itab_collect and summarize the values. Another way
    * is shown here:
      CLEAR: gs_entry-matnr.
      MODIFY gt_itab FROM gs_entry
        TRANSPORTING matnr
        WHERE ( matnr IS NOT INITIAL ).
    * We clear the material no.
      LOOP AT gt_itab INTO gs_entry.
        COLLECT gs_entry INTO gt_itab_total.
      ENDLOOP. 
    * NOTE: because we have the same value for CLIENT and
    * MATNR in every line we will end up with a single line
    * in gt_itab_total.
    Please read the documentation of the COLLECT statement carefully because the structure of your itab (i.e. the order of the fields, especially those that will be summarized) is important.
    Regards
       Uwe

  • Query generator used to make general total and row total

    Dear experts/gurus,
    I have a problem how to create general total and total field in row by using query generator. In inventory in warehouse report of SBO 2004A SP 00 PL 41, there are total row of price x quantity / warehouse (if selection criteria is warehouse) and general total. I have made query report that quite similar with inventory in warehouse report using query generator and put selection criteria and item but I still can't find out the solution. is it possible using query generator to do that or if I use query analyzer, what is the code that I have to put ? is it compute sum(qty x price) by itemcode or there is stil another ? i appreciate your answer. TIA
    Rgds,

    Hi Jimmy,
    Here's one approach to solve your problem:
    = = = = = = =
    select oitm.itemcode, oitm.itemname, whs.whscode, whs.quantity
    from oitm inner join
    (select itemcode, sum(onhand) as quantity, whscode from oitw group by itemcode, whscode) whs
    on oitm.itemcode=whs.itemcode
    = = = = = = =
    ...the main query refers to the subquery as it was another table. The subquery calculates quantity per warehouse from the oitw table.
    Of course you could create a view in SQL Server instead of a subquery. That would make the query inside B1 query generator more simple and would also make it faster to execute.
    Henry

  • Fill initials/dates once and populate all pages

    Hi folks, I have a question on a fillable form. I have a 36 pages patient survey PDF. On top of each page, we have Patient's initials, Evaluator's initials and Date. These evaluators are complaining that they have to fill these boxes on every page and it's very tedious. By making these boxes fillable, using acrobat pro 9, we can populate these boxes with correct initials and dates.
    My questions is: is it feasible to populate all Patient's initials, evaluator's initials and dates on all pages just by filling the first page? I think this can be done through some scripting. Can anybody give some hints? Thank you very much in advance.

    Yes, it can be done. The exact method depends upon which product you used to create the form.
    In AcroForms you name all the fields for a given data item with the same name.
    In LiveCycle Designer you give all the field for a given data item the same name and set the fields binding to "Global"

Maybe you are looking for