Sub total in table footer

Hello,
I am creating an Adobe form for SD invoices.
I have a table which contains the list of invoice items.  I want to calculate a sub total per page in the table footer.
For example :
PAGE 1                                                                         
Item1   10,00 euros                                              
Item2   10,00 euros                                             
Item3   10,00 euros                  
Sub total : 30,00 euros  
PAGE 2   
Item4  10,00 euros
Item5  13,00 euros 
Item6   22,00 euros
Item7  14,00 euros
Sub total : 59,00 euros   
PAGE 3
Item8   23,00 euros 
Item9   55,00 euros
Sub total : 78,00 euros
How can I calculate this ?
I have found this code on SDN but I don't know if it matches with my problem and I don't know how to use it ....Do you have an idea ?
var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);
var total = 0;
for (var i=0; i <= fields.length-1; i++) {
if (fields.item(i).name == "PRICE") {
total = total + fields.item(i).rawValue;
this.rawValue = total;
Edited by: Laure VERE on Jul 1, 2010 9:11 AM

Hi ,
Search for the function "sum" in formcalc in the "Adobe Livecycle Designer Help". That will solve your problem.
It is something like
var total = sum( TableName.RowName[*].FieldName[*])
Thanks,
Omkar Mirvankar.

Similar Messages

  • Problem with printing the sub totals

    Hi,
    I am having a problem with smart forms in printing the line items of invoice.
    I need to print the sub total of each page and need to display the sub total in the footer, with the caption 'Balance C f/w'. It works fine in some cases.
    In some cases, the sub total is getting printed wrongly, because its adding the amount of the next page's first line item also. I checked the form page by printing SFSY-PAGE along with the line item's text. It's observed that, the vlaue of SFSY-PAGE for the first line item's  displayed in the second page is '1'. Due to this, the amount for this line item also is getting calculated with the sub total of the previous page.
    Could you please suggest a solution for this problem?
    Thanks & Regards,
    John

    Hi,
    In smartforms, in the general attributes of the FIRST page the Mode for the page counter should be 'Initialize counter' and for the NEXT page it should be 'Increase counter'.
    Please check this in your smartform.
    Regards,
    Ram

  • How to Show Total Calculation in Footer of Table

    Hi everyone, is it possible to show total calculation in footer of table in webdynpro ? For the calculation, I think i can handle it because many thread in forum and weblog discuss it but for show it in footer of table , i can't find.
    Display
    A
    B
    C
    D
    | ____Total | XX |  --> XX shows total calculation for column D
    If this is not possible, how to trick it ? Thank you
    null

    Hi,
    Even i had the same requirement once, but as this is not possible i.e displaying the total as the footeer of the table.
    the other option for this is to hav a seperate table below the main table & then displaying the total in that table.
    You can collect the value of each cell of column D in an integer variable at the time of displaying the data in the table.
    A | B | C | D |
    1
    2
    3
    for(int i = 0;i<node.lenght();i++)
    int tot = wdcontext.element
    now at the end you can create the element of the node & assign this variable "tot" to that element, then add teh element to the node
    Hope it helps you.
    Regards
    Jeet

  • Sub Total value is empty in  parent child hierarchy pivot table

    Hi All,
    I am using obiee 11.1.1.6.2 in Test environment. Is it a known issue/bug for 11.1.1.6.2 to show empty/blank values for sub total when using parent child hierarchy pivot table. The sub total for parent value is showing but sub total for child value is coming blank. However, in 11.1.1.5.0, we do not have any issue with this.
    Is it a known bug in obiee 11.1.1.6.2?
    Thanks,
    Sushil

    Yes it is a known bug...
    Thanks.

  • How to Set Precision of Column Footer Total for Table Bean?

    I am doing an OAF extension, and I have a table for which I need to increase the precision of the column values from 2 decimal places to 5. I did this successfully in the view object for the row values, but the table footer totals still have 2 decimal places. I can't seem to find anyway to set this. Anyone know how to do this?
    Thanks in Advance,
    Kurz

    Hi,
    // Get a handle to the table footer bean
    OATableBean tableBean = ...;
    OATableFooterBean tableFooterBean = tableBean.getFooter();
    if (tableFooterBean != null)
    // Get a handle to the total row bean
    OATotalRowBean totalRowBean = tableFooterBean.getTotal();
    // If you want to set text for the total button
    totalRowBean.setText("Re-Total");
    // If you want to hide the recalculate total button
    totalRowBean.setReadOnly(true);
    Format totalRow Item
    You can format the content of the totalRow item programmatically. However, setting a formatting option such as CURRENCY_CODE, on an individual web bean's text attribute, under the total column, does not format the total row's values. Instead, to format the total row's value, use the setAttributeValue(AttributeKey key, Object value) method of oracle.apps.fnd.framework.webui.beans.table.OAColumnBean in your controller, as shown in the following example:
    OAColumnBean columnBean = (OAColumnBean)webBean.findIndexedChildRecursive("Salary");
    columnBean.setAttributeValue(CURRENCY_CODE,"USD");
    User should also be able to format Total column values in Table using formatter like:
    oracle.cabu.ui.validate.Formatter formatter = new OADecimalValidater("###0.###;-###0.###","#.##0.###;-#,##0.###"); OAColumnBean columnBean = (OAColumnBean)webBean.findIndexedChildRecursive("Salary"); columnbean.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter);
    Regards,
    Guru Krishnan.

  • Displaying a total sum value in the af:table - footer

    Hello everyone,
    I have seen various threads on how to calculate a summary column based on a af:column in an af:table. I would like the value of this column to be displayed in the af:table -> footer (right undernead the af:column)
    I'm having trouble putting together the pieces. This is the last requirement I have on this page, so hopefully I won't have to start all over.
    Here this what I have:
    I have created my page. (jspx) I did not create the page with a "backing bean". I have seen in various threads that the backing bean can be used to programmatically populate the table.
    This is what I have done so far.
    For the DataModel:
    I have created my entity object, and I have a view assigned to the object. I assigned the view to my Application Module.
    For the UserInterface:
    On the layout, I dragged the instance of the view from the page definition. I created an af:table.
    My questions/train of thought are:
    I didn't create a "backing bean" when I first created my jspx page. From the various threads that I have seen, they all reference this. Can anyone explain how I can do this when the page has already been created? I'm using jdev version 10.1.3.3
    Within the backing bean, I assume this is where I would then create a method that would do the "sum" of my column.
    To display the column:
    I would then create an af:output_text and drag it to theh table footer. The binding section
    If anyone has a prior thread that I haven't found that can point me in the right direction with what I already I would really appreciate it.
    Thanks

    Kuba,
    By creating a managed bean against the page definition, you are able to access the "iterator". The iterator is an object that is based off of hte View object (which the page is build off of)... From there, you can then loop through the rows and add them together to come up with the total sum.
    You can then reference this method in the TEST.java class since it was created as a managed bean.
    I believe I got the gist of it now... Coming from an Oracle Forms perspecitive, it is actually pretty similar. Now I understand what Managed Beans are used for. Thanks again for the great example.
    Danny

  • Dynamic table sub total.

    Quite new for Jdeveloper11g 1.1.4,
    May I konw is there a solution for dynamic table sub total. eg, when i enter a row in a af:table, the sub total will also changed. any sample is welcomed, Thanks!

    check example: 64.Recalc Sum of Salary at the View Object Level
    in this link:
    http://blogs.oracle.com/smuenchadf/examples/

  • Only sub total in alv report

    hi,
    I have a report on ALV with sub totals for some fields, it is working fine but my requirement is whether i can get only the sub totals of that report.
    regards,
    Prabhu

    HI
    refer this code.
    REPORT ZALV.
    TYPE-POOLS: SLIS.
    DATA: G_REPID LIKE SY-REPID,
    GS_PRINT            TYPE SLIS_PRINT_ALV,
    GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
    GT_EVENTS           TYPE SLIS_T_EVENT,
    GT_SORT             TYPE SLIS_T_SORTINFO_ALV,
    GS_LAYOUT           TYPE SLIS_LAYOUT_ALV,
    GT_FIELDCAT         TYPE SLIS_T_FIELDCAT_ALV,
    FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
    COL_POS TYPE I.
    DATA: BEGIN OF ITAB,
      FIELD1(5) TYPE C,
      FIELD2(5) TYPE C,
      FIELD3(5) TYPE P DECIMALS 2,
    END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB1.
    DATA: BEGIN OF ITAB_FIELDCAT OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB_FIELDCAT.
    Print Parameters
    PARAMETERS:
                P_PRINT  AS CHECKBOX DEFAULT ' ', "PRINT IMMEDIATE
                P_NOSINF AS CHECKBOX DEFAULT 'X', "NO SELECTION INFO
                P_NOCOVE AS CHECKBOX DEFAULT ' ', "NO COVER PAGE
                P_NONEWP AS CHECKBOX DEFAULT ' ', "NO NEW PAGE
                P_NOLINF AS CHECKBOX DEFAULT 'X', "NO PRINT LIST INFO
                P_RESERV TYPE I.                  "NO OF FOOTER LINE
    INITIALIZATION.
    G_REPID = SY-REPID.
    PERFORM PRINT_BUILD    USING GS_PRINT.      "Print PARAMETERS
    START-OF-SELECTION.
    TEST DATA
    MOVE 'TEST1' TO ITAB1-FIELD1.
    MOVE 'TEST1' TO ITAB1-FIELD2.
    MOVE '10.00' TO ITAB1-FIELD3.
    APPEND ITAB1.
    MOVE 'TEST2' TO ITAB1-FIELD1.
    MOVE 'TEST2' TO ITAB1-FIELD2.
    MOVE '20.00' TO ITAB1-FIELD3.
    APPEND ITAB1.
    DO 50 TIMES.
      APPEND ITAB1.
    ENDDO.
    END-OF-SELECTION.
    PERFORM BUILD.
    PERFORM EVENTTAB_BUILD CHANGING GT_EVENTS.
    PERFORM COMMENT_BUILD  CHANGING GT_LIST_TOP_OF_PAGE.
    PERFORM CALL_ALV.
    FORM BUILD.
    DATA FIELD CATALOG
    Explain Field Description to ALV
    DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD1'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT    = 'X'.  "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
    FIELDCAT_LN-KEY       = ' '.   "SUBTOTAL KEY
    FIELDCAT_LN-NO_OUT    = ' '.
    FIELDCAT_LN-SELTEXT_L = 'HEAD1'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD2'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    FIELDCAT_LN-NO_OUT    = 'X'.
    FIELDCAT_LN-SELTEXT_L = 'HEAD2'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME     = 'FIELD3'.
    FIELDCAT_LN-TABNAME       = 'ITAB1'.
    FIELDCAT_LN-REF_FIELDNAME = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY
    FIELDCAT_LN-REF_TABNAME   = 'MSEG'.  "<- REF TABLE IN THE DICTIONNARY
    FIELDCAT_LN-NO_OUT        = ' '.
    FIELDCAT_LN-DO_SUM        = 'X'.   "SUM UPON DISPLAY
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    DATA SORTING AND SUBTOTAL
    DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD1'.
    GS_SORT-SPOS      = 1.
    GS_SORT-UP        = 'X'.
    GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD2'.
    GS_SORT-SPOS      = 2.
    GS_SORT-UP        = 'X'.
    *GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    ENDFORM.
    FORM CALL_ALV.
    ABAP List Viewer
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = G_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_STRUCTURE_NAME = 'ITAB1'
    IS_LAYOUT =  GS_LAYOUT
    IT_FIELDCAT = GT_FIELDCAT[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
      IT_SORT = GT_SORT[]
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
      IT_EVENTS = GT_EVENTS[]
    IT_EVENT_EXIT =
      IS_PRINT = GS_PRINT
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    T_OUTTAB = ITAB1
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    ENDFORM.
    HEADER FORM
    FORM EVENTTAB_BUILD CHANGING LT_EVENTS TYPE SLIS_T_EVENT.
    CONSTANTS:
    GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
    *GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                I_LIST_TYPE = 0
           IMPORTING
                ET_EVENTS   = LT_EVENTS.
      READ TABLE LT_EVENTS WITH KEY NAME =  SLIS_EV_TOP_OF_PAGE
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
        APPEND LS_EVENT TO LT_EVENTS.
      ENDIF.
    define END_OF_PAGE event
    READ TABLE LT_EVENTS WITH KEY NAME =  SLIS_EV_END_OF_PAGE
                             INTO LS_EVENT.
    IF SY-SUBRC = 0.
      MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
      APPEND LS_EVENT TO LT_EVENTS.
    ENDIF.
    ENDFORM.
    FORM COMMENT_BUILD CHANGING GT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
      DATA: GS_LINE TYPE SLIS_LISTHEADER.
      CLEAR GS_LINE.
      GS_LINE-TYP  = 'H'.
      GS_LINE-INFO = 'HEADER 1'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
      CLEAR GS_LINE.
      GS_LINE-TYP  = 'S'.
      GS_LINE-KEY  = 'STATUS 1'.
      GS_LINE-INFO = 'INFO 1'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
      GS_LINE-KEY  = 'STATUS 2'.
      GS_LINE-INFO = 'INFO 2'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
    CLEAR GS_LINE.
    GS_LINE-TYP  = 'A'.
    GS_LINE-INFO = 'ACTION'.
    APPEND GS_LINE TO  GT_TOP_OF_PAGE.
    ENDFORM.
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
      WRITE: SY-DATUM, 'Page No', SY-PAGNO LEFT-JUSTIFIED.
    ENDFORM.
    FORM END_OF_PAGE.
      WRITE at (sy-linsz) sy-pagno CENTERED.
    ENDFORM.
    PRINT SETTINGS
    FORM PRINT_BUILD USING LS_PRINT TYPE SLIS_PRINT_ALV.
      LS_PRINT-PRINT              = P_PRINT.  "PRINT IMMEDIATE
      LS_PRINT-NO_PRINT_SELINFOS  = P_NOSINF. "NO SELECTION INFO
      LS_PRINT-NO_COVERPAGE       = P_NOCOVE. "NO COVER PAGE
      LS_PRINT-NO_NEW_PAGE        = P_NONEWP.
      LS_PRINT-NO_PRINT_LISTINFOS = P_NOLINF. "NO PRINT LIST INFO
      LS_PRINT-RESERVE_LINES      = P_RESERV.
    ENDFORM.
    *END OF ZALV PROGRAM
    Reward all helpfull answers.
    Regards.
    Jay

  • Subtotal in Table Footer Appears in Body on the Next Page - Smartform

    Hi experts,
    I have a subtotal row in my table footer. It works find (appears correctly for each page). But when I check the body of the table, in page 2, there is a line with the subtotal amount from page 1, appearing in line 2. Do you guys know why does this happen and how to solve it?
    Thanks,
    Sam

    Hi Sam,
    1. Can you cross check whether you have coded anything which will modify the internal table content with the subtotal value?
    2. Did you keep any condition like printing the sub total at each new value for a particular field
    (Eg: If there is a field f1 in your internal table with values a, a, a, b, b, b, d, d, d - is there any condition to print sub total when f1value changes from a to b or b to d ? )
    Regards,
    Swarna Munkoti.

  • Sub Total display in Samrtforms

    Hi ,
    I need to display sub totals in my smartform.Infact I have used Calcualtions Tab Under TABLE with Operation "Total"  and Time "After Loop"  which is displaying wrong values when Internal Table values are spanned to multiple pages. Can any body help me.
    Regards,
    Srinivas

    >
    SRINI VASA wrote:
    > I can not create any text node after Main Window and according to my requirement, I need to display my sub total in footer of my table inside Main Window.
    "..............Main window
    ".......................Table with loop
    "...........................main area with flow logic calculate sum here in some temp variable
    "..................................footer, print here your temp with text node
    No need to create text node after main window

  • How to print sub total text in ALV

    Hi All,
       I have a prblem in printing sub total text in ALV. I am passing the text for sub total in ALV layout to the field SUBTOTALS_TEXT. Even then the text is not displayed where as this is working for TOTAL with the field TOTALS_TEXT.
       Could any one provide me the solution please?
    Thanks & Regards,
    S.Lakshmi

    Hi Lakshmi,
    Please refer to the following code :
    report zalv10.
    type-pools: slis.
    data: g_repid like sy-repid,
    gs_print type slis_print_alv,
    gt_list_top_of_page type slis_t_listheader,
    gt_events type slis_t_event,
    gt_sort type slis_t_sortinfo_alv,
    gs_layout type slis_layout_alv,
    gt_fieldcat type slis_t_fieldcat_alv,
    fieldcat_ln like line of gt_fieldcat,
    col_pos type i.
    data: begin of itab,
    field1(5) type c,
    field2(5) type c,
    field3(5) type p decimals 2,
    end of itab.
    data: begin of itab1 occurs 0.
    include structure itab.
    data: end of itab1.
    data: begin of itab_fieldcat occurs 0.
    include structure itab.
    data: end of itab_fieldcat.
    Print Parameters
    parameters:
    p_print as checkbox default ' ', "PRINT IMMEDIATE
    p_nosinf as checkbox default 'X', "NO SELECTION INFO
    p_nocove as checkbox default ' ', "NO COVER PAGE
    p_nonewp as checkbox default ' ', "NO NEW PAGE
    p_nolinf as checkbox default 'X', "NO PRINT LIST INFO
    p_reserv type i. "NO OF FOOTER LINE
    initialization.
    g_repid = sy-repid.
    perform print_build using gs_print. "Print PARAMETERS
    start-of-selection.
    TEST DATA
    move 'TEST1' to itab1-field1.
    move 'TEST1' to itab1-field2.
    move '10.00' to itab1-field3.
    append itab1.
    move 'TEST2' to itab1-field1.
    move 'TEST2' to itab1-field2.
    move '20.00' to itab1-field3.
    append itab1.
    do 50 times.
    append itab1.
    enddo.
    end-of-selection.
    perform build.
    perform eventtab_build changing gt_events.
    perform comment_build changing gt_list_top_of_page.
    perform call_alv.
    form build.
    DATA FIELD CATALOG
    Explain Field Description to ALV
    data: fieldcat_in type slis_fieldcat_alv.
    clear fieldcat_in.
    fieldcat_ln-fieldname = 'FIELD1'.
    fieldcat_ln-tabname = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT = 'X'. "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
    fieldcat_ln-key = ' '. "SUBTOTAL KEY
    fieldcat_ln-no_out = ' '.
    fieldcat_ln-seltext_l = 'HEAD1'.
    append fieldcat_ln to gt_fieldcat.
    clear fieldcat_in.
    fieldcat_ln-fieldname = 'FIELD2'.
    fieldcat_ln-tabname = 'ITAB1'.
    fieldcat_ln-no_out = 'X'.
    fieldcat_ln-seltext_l = 'HEAD2'.
    append fieldcat_ln to gt_fieldcat.
    clear fieldcat_in.
    fieldcat_ln-fieldname = 'FIELD3'.
    fieldcat_ln-tabname = 'ITAB1'.
    fieldcat_ln-ref_fieldname = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY
    fieldcat_ln-ref_tabname = 'MSEG'. "<- REF TABLE IN THE DICTIONNARY
    fieldcat_ln-no_out = ' '.
    fieldcat_ln-do_sum = 'X'. "SUM UPON DISPLAY
    append fieldcat_ln to gt_fieldcat.
    DATA SORTING AND SUBTOTAL
    data: gs_sort type slis_sortinfo_alv.
    clear gs_sort.
    gs_sort-fieldname = 'FIELD1'.
    gs_sort-spos = 1.
    gs_sort-up = 'X'.
    gs_sort-subtot = 'X'. ***CRUCIAL STATEMENT****
    append gs_sort to gt_sort.
    clear gs_sort.
    gs_sort-fieldname = 'FIELD2'.
    gs_sort-spos = 2.
    gs_sort-up = 'X'.
    *GS_SORT-SUBTOT = 'X'. **THIS SHOULD NOT BE UNCOMENTED*
    append gs_sort to gt_sort.
    endform.
    form call_alv.
    ABAP List Viewer
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    i_callback_program = g_repid
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    i_structure_name = 'ITAB1'
    is_layout = gs_layout
    it_fieldcat = gt_fieldcat[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    it_sort = gt_sort[]
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    it_events = gt_events[]
    IT_EVENT_EXIT =
    is_print = gs_print
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    tables
    t_outtab = itab1
    exceptions
    program_error = 1
    others = 2.
    endform.
    HEADER FORM
    form eventtab_build changing lt_events type slis_t_event.
    constants:
    gc_formname_top_of_page type slis_formname value 'TOP_OF_PAGE'.
    *GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
    data: ls_event type slis_alv_event.
    call function 'REUSE_ALV_EVENTS_GET'
    exporting
    i_list_type = 0
    importing
    et_events = lt_events.
    read table lt_events with key name = slis_ev_top_of_page
    into ls_event.
    if sy-subrc = 0.
    move gc_formname_top_of_page to ls_event-form.
    append ls_event to lt_events.
    endif.
    define END_OF_PAGE event
    READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
    INTO LS_EVENT.
    IF SY-SUBRC = 0.
    MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
    APPEND LS_EVENT TO LT_EVENTS.
    ENDIF.
    endform.
    form comment_build changing gt_top_of_page type slis_t_listheader.
    data: gs_line type slis_listheader.
    clear gs_line.
    gs_line-typ = 'H'.
    gs_line-info = 'HEADER 1'.
    append gs_line to gt_top_of_page.
    clear gs_line.
    gs_line-typ = 'S'.
    gs_line-key = 'STATUS 1'.
    gs_line-info = 'INFO 1'.
    append gs_line to gt_top_of_page.
    gs_line-key = 'STATUS 2'.
    gs_line-info = 'INFO 2'.
    append gs_line to gt_top_of_page.
    CLEAR GS_LINE.
    GS_LINE-TYP = 'A'.
    GS_LINE-INFO = 'ACTION'.
    APPEND GS_LINE TO GT_TOP_OF_PAGE.
    endform.
    form top_of_page.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = gt_list_top_of_page.
    write: sy-datum, 'Page No', sy-pagno left-justified.
    endform.
    form end_of_page.
    write at (sy-linsz) sy-pagno centered.
    endform.
    PRINT SETTINGS
    form print_build using ls_print type slis_print_alv.
    ls_print-print = p_print. "PRINT IMMEDIATE
    ls_print-no_print_selinfos = p_nosinf. "NO SELECTION INFO
    ls_print-no_coverpage = p_nocove. "NO COVER PAGE
    ls_print-no_new_page = p_nonewp.
    ls_print-no_print_listinfos = p_nolinf. "NO PRINT LIST INFO
    ls_print-reserve_lines = p_reserv.
    endform.
    <b>Please reward points if helpful.</b>
    Regards,
    Amit Mishra

  • How to add sub total

    hi
    how to add sub total in SAP Script using subroutine

    SAPscripts How to calculate Totals and Subtotals
    I have some doubs in BDC and SMART FORMS.  I want to change the material number using the transaction code MM02 through BDC.
    In scripts and smartforms how to calculate totals and subtotals?
    To calculate totals and sub totals in sap scripts you have to use subroutines.
    Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine
    /: DEFINE &TOT_PRICE&
    /: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM
    Then write the variable where ever you want it to be printed (mostly it will be in footer window)
    Then create subroutine pool program and you have to write the code.
    FORM F_GET_PRICE tables int_cond structure itcsy
                                        outt_cond structure itcsy. data : value type kbert.
    statics   value1 type kbert.
    Read int_cond table index 1.
    value = int_cond-value.
    value1 = value1 + value.
    Read outt_cond table index 1.
    outt_cond-value = value1.
    Modify outt_cond index 1.
    ENDFORM.
    I have given a rough outline, please be aware of the variable conversions as Int_cond-value and outt_cond-value are characters.

  • Calculate sub totals in SAP Script

    Hi Friends, In Sapscript,  I want to print as follows. Please help.
    Empno       Name       Dept.        Salary
    A1             AAAA       DP01       1000.00
    A2             BBBB       DP01       1500.00
                                          2500.00
    A3         CCCC    DP02    2000.00
    A4         DDDD    DP02    2200.00
                                           4200.00

    Hi
    To calculate totals and sub totals in sap scripts you have to use subroutines.
    Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine
    /: DEFINE &TOT_PRICE&
    /: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM
    Then write the variable where ever you want it to be printed (mostly it will be in footer window)
    Then create subroutine pool program and you have to write the code.
    FORM F_GET_PRICE tables int_cond structure itcsy
                                        outt_cond structure itcsy. data : value type kbert.
    statics   value1 type kbert.
    Read int_cond table index 1.
    value = int_cond-value.
    value1 = value1 + value.
    Read outt_cond table index 1.
    outt_cond-value = value1.
    Modify outt_cond index 1.
    ENDFORM.
    PLZ REWARD POINTS

  • This is regarding totals and sub totals in sap-scripts

    Hi to all...............
    1...How to print totals and subtotals in sap-scripts? where we have to code the logic.what sort of logic is needed to print the same?
    regards,
    swaminath.

    Hi
    HI,
    To calculate totals and sub totals in sap scripts you have to use subroutines.
    Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine
    /: DEFINE &TOT_PRICE&
    /: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM
    Then write the variable where ever you want it to be printed (mostly it will be in footer window)
    Then create subroutine pool program and you have to write the code.
    FORM F_GET_PRICE tables int_cond structure itcsy
    outt_cond structure itcsy. data : value type kbert.
    statics value1 type kbert.
    Read int_cond table index 1.
    value = int_cond-value.
    value1 = value1 + value.
    Read outt_cond table index 1.
    outt_cond-value = value1.
    Modify outt_cond index 1.
    ENDFORM.
    To know more, have a look at this thread ..
    Re: SAP Script: Display Total calculated  on page 2 in page 1
    <b>Reward if usefull</b>

  • Creation of Sub-Totals within Groups

    Hi - hope this is me just being a plank but I've hit a brick wall whilst trying to recreate a set of management accounts. So far the report has just two Groups - call them A & B for ease. Group B summarizes the detail and Group A neatly collects the results from Group B.
    Group A  comprises 6 parts all doing their bit and all the standard Crystal Sub-Totals (Summaries) work just fine. The problem I encounter is when I need to insert another Sub-Total into Group A which summarizes multiple parts of Group A e.g. Part 1 is Sales, Part 2 is Cost of sales, Part 3 is Labour, Part 4 is Expenses, Part 5 is Other and Part 6 is Depreciation. I need to insert a Sub-Total between Parts 3 and 4 which basically gives a total of Sales minus Cost of Sales minus Labour and to then continue with Parts 4 to 6. This is obviously a huge simplification of the issue but an answer to this would let me proceed with everything else.
    I've tried creating an line so I can add a formula for this by giving it a name of its own in Group A but it fails to appear on the report. I've also tried the 'Insert Section Below' option and whilst I can suppress it where necessary the formula just picks up values from the last entry on the Detail Section.
    Any ideas where I am making some elementary mistakes and is there an easy solution? Many thanks

    Hi,
      Try to create a manual running total formula for summing the fields with a condition.
    Create a @reset formula and place it report header:
    formula:
    whileprintingrecords;
    numbervar i:=0;
    Create a @eval formula and place it in group header A:
    formula:
    whileprintingrecords;
    numbervar i;
    if {groupname.field} = 'Labour' or {groupname.field} = 'Expenses'  then
    i:= i + {summary.field};
    Create a @display formula and place it in report footer;
    formula:
    whileprintingrecords;
    numbervar i;
    Hope this helps!
    Regards,
    Vinay

Maybe you are looking for

  • Share button disabled for I cloud

    Share button disabled on I cloud. Can't share video in message.

  • Incorrect unread message counter

    My iphone shows that I have one unread messages when no messages are marked as unread (no blue dots). I've opened and read every message; I have only one account on the phone. I've tried resetting the iphone, deleting the account and starting from sc

  • UI problems when accessing UWL

    Hi Portal experts and friends, We are implementing the UWL in our company. Constraint: The managers ( who are crazy   ) sometimes will be approving the flow being outside the company premises. For example, they might stay in a hotel with low bandwidt

  • Possible to download already purchased Audiobooks a second time?

    I've been searching the discussions but found no clear answer. I accidentally erased some audiobooks while, ironically enough, making backups. Ha HA! EEEeeediot. I see that the policy as stated: "When you buy a song, video, iPod Game, or album from t

  • WLC 5508 LAG setup

    Hi, I'm trying to setup a 5508 to put multiple management ports into LAG configuration for Etherchannel to the connected switch. I have not found where to configure that in the GUI. Is that a CLI-only command? Thanks.