Subtotals in a table

Hi, I have data which has been formatted as a table - how can I use subtotals with this data?
Viv Haig

Hi,
You would use it just as you would normally. Place the cursor below the cell you want to subtotal and typ:
=subtotal(9,<your range here>)
The above example uses the sum. something like =subtotal(9, A1:B12).
When you filter the data the output will be filtered as well.
Maurice
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. Thank You

Similar Messages

  • How to get subtotals on my table

    Hello,
    Could any one please tell me how can i get subtotals on my table. i am new to the tool trying to get subtotals and grand totals for my analysis. please advice

    Hi,
    Can you post how you achieved this? It can help other users in the future. And also remember to close the thread.
    J.-

  • Total of several subtotals outside of table

    I have a table that is grouped by expenditure types. Every expenditure type has a subtotal. At end of report, outside of table and grouping, I want to total those subtotals and display total.
    I have tried running page totals. I also tried the syntax in Tim's My Total Follow Up but could not get that to work. I am a bit of a newbie..... : )
    Thanks in advance for any help,
    Nancy

    Links of interest and for understanding:
    http://blogs.oracle.com/xmlpublisher/2007/10/29#a607
    Display of Report Totals of different groups
    How do I get a grand total in my template?
    Doing Subtotals and Totals in the template
    Where's my Total question
    Without your xml , and the rtf xsl code , its little difficult to help you.
    if possible drop me a mail, with xml and template to fusionDOTobjectATgmailDOTcom
    or paste your xml here and RTF xsl code

  • Placing Subtotals within a Table - assistance needed!

    Hi Experts,
    I have a requirement for a change in a report that is created using XML Publisher and the output is from Release 12.
    There are a table of values where the output presently looks like this (not every column included, to ease clarity):
    Payee     Site     Amount Discount Payment Total Payable
    GROUP A     MILTON KE .00     70.50     .00     70.50
    GROUP A     MILTON KE .00     483.06     .00     483.06
    GROUP B     DIRECT DE .00     209.40     .00     209.40
    GROUP B     DIRECT DE .00     209.40     .00     209.40
    GROUP A     MILTON KE .00     141.00     .00     141.00
    GROUP B     DIRECT DE .00     172.98     .00     172.98
    GROUP B     DIRECT DE .00     244.65     .00     244.65
    GROUP A     MILTON KE .00     512.95     .00     512.95
    Totals          GBP     40,519.87     .00     .00     40,519.87     .00     40,519.87
    The code for this presently is:
    <?for-each:PARENT?>
    -- Output each row with the fields listed in table
    <?end for-each?>
    -- The output the Final Totals row (this is not a calculated total, but a total field listed in the XML output)
    An example of the XML is:
    - <PARENT>
    <PARTY_SITE_NAME>MILTON KEYNES</PARTY_SITE_NAME>
    <PAYEE>GROUP A</PAYEE>
    <INVOICE_NUM>A10008075</INVOICE_NUM>
    <DUE_DATE>19-SEP-07</DUE_DATE>
    <AMOUNT_REMAINING>739.92</AMOUNT_REMAINING>
    <WITHHELD_AMOUNT>0</WITHHELD_AMOUNT>
    <DISCOUNT_AMOUNT>0</DISCOUNT_AMOUNT>
    <INTEREST_AMOUNT>0</INTEREST_AMOUNT>
    <PAYMENT_AMOUNT>739.92</PAYMENT_AMOUNT>
    <AMOUNT_REMAINING_FM>739.92</AMOUNT_REMAINING_FM>
    <WITHHELD_AMOUNT_FM>0.00</WITHHELD_AMOUNT_FM>
    <DISCOUNT_AMOUNT_FM>0.00</DISCOUNT_AMOUNT_FM>
    <INTEREST_AMOUNT_FM>0.00</INTEREST_AMOUNT_FM>
    <PAYMENT_AMOUNT_FM>739.92</PAYMENT_AMOUNT_FM>
    <SELECTED_PS_TOTALS>739.92</SELECTED_PS_TOTALS>
    <SELECTED_PS_TOTALS_FM>739.92</SELECTED_PS_TOTALS_FM>
    </PARENT>
    - <PARENT>
    <PARTY_SITE_NAME>MILTON KEYNES</PARTY_SITE_NAME>
    <PAYEE>GROUP A</PAYEE>
    <INVOICE_NUM>H10001663</INVOICE_NUM>
    <DUE_DATE>07-SEP-07</DUE_DATE>
    <AMOUNT_REMAINING>66.24</AMOUNT_REMAINING>
    <WITHHELD_AMOUNT>0</WITHHELD_AMOUNT>
    <DISCOUNT_AMOUNT>0</DISCOUNT_AMOUNT>
    <INTEREST_AMOUNT>0</INTEREST_AMOUNT>
    <PAYMENT_AMOUNT>66.24</PAYMENT_AMOUNT>
    <AMOUNT_REMAINING_FM>66.24</AMOUNT_REMAINING_FM>
    <WITHHELD_AMOUNT_FM>0.00</WITHHELD_AMOUNT_FM>
    <DISCOUNT_AMOUNT_FM>0.00</DISCOUNT_AMOUNT_FM>
    <INTEREST_AMOUNT_FM>0.00</INTEREST_AMOUNT_FM>
    <PAYMENT_AMOUNT_FM>66.24</PAYMENT_AMOUNT_FM>
    <SELECTED_PS_TOTALS>66.24</SELECTED_PS_TOTALS>
    <SELECTED_PS_TOTALS_FM>66.24</SELECTED_PS_TOTALS_FM>
    </PARENT>
    My requirements for this are:
    1) To sort the table by Payee, grouping similar Payees together. This I have achieved by adding the below after <?for-each:PARENT?>.
    <?sort:PAYEE?>
    2) With the Payees grouped, to add a subtotal of each of the groups WITHIN the main table, something like this:
    Payee     Site     Amount Discount     Payment      Total Payable
    GROUP A     MILTON KE .00     70.50     .00     70.50
    GROUP A     MILTON KE .00     483.06     .00     483.06
    Subtotal= 553.46
    GROUP B     DIRECT DE .00     209.40     .00     209.40
    GROUP B     DIRECT DE .00     209.40     .00     209.40
    Subtotal= 418.80
    ..etc
    Totals          GBP     40,519.87     .00     .00     40,519.87     .00     40,519.87
    I am having trouble with getting this subtotal of each group to be within the table. My Psuedo-code I was thinging of was:
    Declare variable sub_total = 0
    Declare variable temp
    For-Each Row
    temp = this_row_payee
    if(temp = next_row_payee) then
    sub_total = sub_total + Total_Payable
    Output this row
    else
    Output the subtotal
    temp = next_row_payee
    sub_total = 0
    end if
    End For-Each Row
    I have tried using the for-each-group and using the Sum with current_group() but I am new to XML Publisher and would greatly welcome any feedback.
    Thanks!
    Mark

    I have solved it, many thanks for your reply which has provided me with the solution.
    <?for-each-group:PARENT; PARTY_NAME1?>
    <?sort: PARTY_NAME1?>
    <?for-each: current-group()?>
    -- Then list the placeholder fields e.g.
    <?PARTY_SITE_NAME?>
    <?INVOICE_NUM?>
    ... etc
    <?end for-each?>
    <?sum (current-group()/TOTAL_PAYABLES)?>
    <?end for-each-group?>
    This sorts the Payees into alphebetical order and then groups, then lists every row within the group, then and at the end of the group, the total pyables field is added up and provided as a subtotal.
    Thanks,
    Mark

  • Adobe pdf subtotals on each page of table

    Hi All.
    I use Adobe pdf for  reporting
    There is table In one of my reports continuing on several pages.
    Prompt me how create the subtotals of the table on each page?

    Hi, I'm facing same problem. Maybe after 6 years past you've found th solution and share it here

  • Subtotals in ALV

    Hi
    SAP Guru s
    I am facing a dump when i pass the Gt_sort in reuse alv display FM
    I am tryingto display the subtotals on the kunnr for dollars and count  via ALV
    following is the code
    ur advice is highly appreciated
    thanks
    report orders .
                       DICTIONARY TABLES
    tables: vbak,            "Sales Document: Header Data
            vbpa,            "Sales Document: Partner
            vbuk,  "Sales Document: Header Status and Administrative Data
            adrc.
    ALV Declarations                                                     *
    type-pools: slis, kkblo.
    data: g_repid      like  sy-repid,
          gs_layout    type  slis_layout_alv,
          gt_fieldcat  type  slis_t_fieldcat_alv,
          fieldcat_in  like  line of  gt_fieldcat,
          cos_pos      type  i,
          gt_events           type slis_t_event,
          gt_sort             type slis_t_sortinfo_alv,
          months like komp-anz_monate.
    data: g_anzlines  type  i.
    data : t_list_top_of_page type slis_t_listheader.
    data : t_list_end_of_list type slis_t_listheader.
    data : t_events type slis_t_event.
                      DATA
    data: gv_netwr like vbak-netwr,
          gv_netwr0 like vbak-netwr,
          zvbeln like vbak-vbeln,
          gv_count(6) type n,
          gv_count0(6) type n,
          erdat1 like vbak-erdat,
          temp like vbak-erdat,
          temp1(10),
          erdat2 like vbak-erdat,
          vkorg like vbak-vkorg,
          erdat(25),
          hyphen(3) value '---',
          p_name1 like adrc-name1,
          zlines type i,
          g_tabix like sy-tabix,
          month_nme(10),
          zline type i,
          gv_tot like vbak-netwr,
          gv_kcount type i,
          gv_ktot like vbak-netwr,
          l_tabix like sy-tabix.
                      INTERNAL TABLES
    data: begin of zvbak occurs 0,
           vbeln like vbak-vbeln,                "order no
           erdat like vbak-erdat,
           vgbel like vbak-vgbel,                "reference doc num
           netwr like vbak-netwr,                " amount
          end of zvbak.
    data: zvbak0 like zvbak occurs 0 with header line.
    data: begin of zvbpa occurs 0,
            name1 like adrc-name1,
            month(2),
            vbeln like vbpa-vbeln,
            parvw like vbpa-parvw,        " partner function
            kunnr like vbpa-kunnr,
            adrnr like vbpa-adrnr,
            netwr like vbak-netwr,
            erdat like vbak-erdat,
         end of zvbpa.
    data: zvbpa0 like zvbpa occurs 0 with header line.
    data: alv_dat like zvbpa occurs 0 with header line,
          alv_data0 like zvbpa occurs 0 with header line.
    data: begin of alv0  occurs 0,
          kunnr like vbak-kunnr,
          name1 like adrc-name1,
          count type i,
          dollars like vbak-netwr ,
          kcount type i,
          kdollars like vbak-netwr,
          month_nme(10),
          erdat like vbak-erdat,
          netwr like vbak-netwr,
          vbeln like vbpa-vbeln,
          end of alv0.
    data: begin of zvbuk occurs 0,
           vbeln like vbak-vbeln,
           netwr like vbak-netwr,
           erdat like vbak-erdat,
    end of zvbuk.
    data: begin of ztab_period occurs 0,
            sindex like  scscp_period_str-sindex,
            datuv  like scscp_period_str-datuv,
            datub like scscp_period_str-datub,
            id like scscp_period_str-id,
            name(10) type c,
          end of ztab_period.
    data: begin of ztab_perio0 occurs 0,
            sindex like  scscp_period_str-sindex,
            datuv  like scscp_period_str-datuv,
            id like scscp_period_str-id,
            name(10) type c,
          end of ztab_perio0.
                      SELECTION SCREEN
    selection-screen begin of block b with frame title text-001 .
    select-options:  s_erdat for vbak-erdat obligatory,
                     s_vkorg for vbak-vkorg obligatory.
    selection-screen end of block b.
    *INITIALIZATION.
    initialization.
      g_repid = sy-repid.
    *START-OF-SELECTION.
    start-of-selection.
      data:t_index like sy-tabix.
      perform select_orders tables alv_data0.
      loop at alv_data0.
        t_index = sy-tabix.
        move alv_data0-erdat+4(2) to alv_data0-month.
        modify alv_data0 index t_index transporting month.
        clear alv_data0.
      endloop.
      sort alv_data0 by name1 month.
      loop at alv_data0.
        if alv_data0-name1 = space.
          delete alv_data0.
        endif.
        move alv_data0-kunnr to alv0-kunnr.
        at new name1.
          move: alv_data0-name1 to alv0-name1.
        endat.
        gv_netwr = alv_data0-netwr + gv_netwr.
        gv_count = gv_count + 1.
        at end of month.
          call function 'MONTH_TO_MONTHNAME'
               exporting
                    monthnum  = alv_data0-month
               importing
                    monthname = month_nme.
          move month_nme to alv0-month_nme.
          move gv_count to alv0-count.
          move gv_netwr to alv0-dollars.
          append alv0.
          clear: alv0, gv_netwr, gv_count.
        endat.
      endloop.
    **END-OF-SELECTION.
    end-of-selection.
      loop at alv0 .
        gv_tot = gv_tot + alv0-dollars.
      endloop.
      describe table alv0 lines g_anzlines.
      if g_anzlines gt 0.
        perform display_list.
      endif.
    *&      Form  select_orders
          text
    -->  p1        text
    <--  p2        text
    form select_orders tables alv_dat structure zvbpa.
      data: gv_index like sy-tabix,
           ztab like ztab_period,
           erdath like vbak-erdat,
           erdat_h like vbak-erdat.
      erdat1 = s_erdat-low(8).
      erdath = s_erdat-high(8).
      concatenate erdat1 hyphen erdat_h erdath into erdat.
      vkorg = s_vkorg+3(4).
    *calculate the no of orders and dollars month wise from the selection
    *date
      call function 'CSCP_PARA1_GET_PERIODS'
           exporting
                i_datuv    = s_erdat-low
                i_datub    = s_erdat-high
                i_timeunit = 'D'
           tables
                et_dates   = ztab_period.
      clear ztab_period.
      clear gv_index.
      describe table ztab_period lines zlines.
      loop at ztab_period.
        move-corresponding ztab_period to ztab_perio0.
        append ztab_perio0.
        clear ztab_perio0.
      endloop.
      sort ztab_perio0 by datuv.
      loop at ztab_perio0.
        if zlines = 2 and ztab_perio0-sindex = 1.
          delete ztab_perio0.
          clear ztab_perio0.
          exit.
        endif.
      endloop.
    *always delete first and last records in the internal table
      loop at ztab_perio0.
        if  ( ztab_perio0-sindex = 1 ) .
          delete ztab_perio0.
        endif.
      endloop.
    *Assign Month name and calculate no of orders
      clear gv_index.
      clear: ztab, ztab_perio0.
      describe table ztab_perio0 lines zline.
      loop at ztab_perio0 into ztab.
        gv_index = sy-tabix.
        if ( ( ztab-datuv+4(2) = '01' ) or
             ( ztab-datuv+4(2) = '02' ) or
             ( ztab-datuv+4(2) = '03' ) or
             ( ztab-datuv+4(2) = '04' ) or
             ( ztab-datuv+4(2) = '05' ) or
             ( ztab-datuv+4(2) = '06' ) or
             ( ztab-datuv+4(2) = '07' ) or
             ( ztab-datuv+4(2) = '08' ) or
             ( ztab-datuv+4(2) = '09' ) or
             ( ztab-datuv+4(2) = '10' ) or
             ( ztab-datuv+4(2) = '11' ) or
             ( ztab-datuv+4(2) = '12' ) ).
          erdat1 = ztab-datuv.
          perform cal_no_of_orders tables    alv_dat
                                  using     erdat1
                                  changing  gv_count0 gv_netwr0.
          clear : erdat1 , ztab.
        endif.
        clear ztab.
      endloop.
    endform.                    " select_orders
    *&      Form  DISPLAY_LIST
          text
    -->  p1        text
    <--  p2        text
    form display_list.
      g_repid = sy-repid.
    sort alv0 by kunnr.
    loop at alv0.
       gv_ktot = gv_ktot + alv0-dollars.
       gv_kcount = gv_kcount + alv0-count.
       at end of kunnr.
         move gv_ktot to alv0-kdollars.
         move gv_kcount to alv0-kcount.
         append alv0.
         clear: alv0, gv_kcount, gv_ktot.
       endat.
    endloop.
      perform fillevents.
      perform comment_build using  t_list_top_of_page.
      perform create_layout.
      perform create_fieldcat.
      call function 'REUSE_ALV_GRID_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_callback_top_of_page            =  'TOP_OF_PAGE'
        I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
        I_CALLBACK_HTML_END_OF_LIST       = ' '
        I_STRUCTURE_NAME                  =
        I_BACKGROUND_ID                   = ' '
        I_GRID_TITLE                      =
        I_GRID_SETTINGS                   = gs_settings
         is_layout                         = gs_layout
         it_fieldcat                       = gt_fieldcat
        IT_EXCLUDING                      =
        IT_SPECIAL_GROUPS                 =
         it_sort                           = gt_sort[]     ===========================>[ a dump is created here 
        IT_FILTER                         =
        IS_SEL_HIDE                       =
        I_DEFAULT                         = 'X'
         i_save                            = 'A'
        IS_VARIANT                        =
         it_events                         = t_events
        IT_EVENT_EXIT                     =
        IS_PRINT                          =
        IS_REPREP_ID                      =
        I_SCREEN_START_COLUMN             = 0
        I_SCREEN_START_LINE               = 0
        I_SCREEN_END_COLUMN               = 0
        I_SCREEN_END_LINE                 = 0
        IT_ALV_GRAPHICS                   =
        IT_ADD_FIELDCAT                   =
        IT_HYPERLINK                      =
        I_HTML_HEIGHT_TOP                 =
        I_HTML_HEIGHT_END                 =
        IT_EXCEPT_QINFO                   =
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER           =
        ES_EXIT_CAUSED_BY_USER            =
        tables
          t_outtab                          = alv0
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " DISPLAY_LIST
    *&      Form  comment_build
          text
         -->P_t_list_top_of_page  text
    form comment_build using     t_list_top_of_page type slis_t_listheader.
      data : ls_line type slis_listheader.
      data : ldate(10),hdate(10).
      data : lv_dat(20).
      clear lv_dat.
      refresh :  t_list_top_of_page.
      clear ls_line.
      ls_line-info = sy-repid.
      ls_line-typ  = 'H'.
      ls_line-info = 'ORDERS AND DOLLARS REPORT'.
      append ls_line to  t_list_top_of_page.
      write sy-datum to ldate using edit mask '__.__.____' .
      clear ls_line.
      ls_line-typ  = 'A'.
      concatenate 'Run Date :' ldate
                    into ls_line-info separated by space.
      append ls_line to  t_list_top_of_page.
      clear ls_line.
      ls_line-typ  = 'A'.
      ls_line-info = 'User ID   :'.
      ls_line-info+12 = sy-uname.
      append ls_line to  t_list_top_of_page.
    clear ls_line.
    ls_line-typ = 'A'.
    ls_line-info = 'No OF ORDERS   :'.
    ls_line-info+17 = gv_count.
    append ls_line to  t_list_top_of_page.
      clear ls_line.
      ls_line-typ = 'A'.
      ls_line-info = 'TOTAL dOLLAR AMOUNT   :'.
      ls_line-info+25 = gv_tot.
      append ls_line to  t_list_top_of_page.
      clear ls_line.
      concatenate s_erdat3(8) '----' s_erdat11(8) into lv_dat.
      ls_line-typ = 'A'.
      ls_line-info = 'Date Range for Documents   :'.
      ls_line-info+25 = lv_dat.
      append ls_line to  t_list_top_of_page.
      clear ls_line.
      ls_line-typ = 'A'.
      ls_line-info = 'Sales Organization   :'.
      ls_line-info+25 = vkorg.
      append ls_line to  t_list_top_of_page.
    endform.                    " comment_build
    *&      Form  fillevents
          text
    -->  p1        text
    <--  p2        text
    form fillevents.
      data l_events type line of slis_t_event.
      clear l_events.
      l_events-name = 'TOP_OF_PAGE'.
      l_events-form = 'TOP_OF_PAGE'.
      append l_events to t_events.
    *perform top-of-page1.
    endform.                    " fillevents
    *&      Form  create_fieldcat
          text
    -->  p1        text
    <--  p2        text
    form create_fieldcat.
      perform fill_fieldcat using:
                       'NAME1'     'ALV0' 'NAME'         '1' '',
                       'MONTH_NME' 'ALV0' 'EDIMONTH'     '2' '',
                       'DOLLARS'   'ALV0' 'DOLLARS'      '3' '',
                       'COUNT'     'ALV0' 'COUNT'        '4' ''.
    endform.                    " create_fieldcat
    *&      Form  create_layout
          text
    -->  p1        text
    <--  p2        text
    form create_layout.
      gs_layout-colwidth_optimize = 'X'.
      gs_layout-zebra             = 'X'.
      gs_layout-no_totalline      = 'X'.
    endform.                    " create_layout
    *&      Form  fill_fieldcat
          text
         -->P_0564   text
         -->P_0565   text
         -->P_0566   text
         -->P_0567   text
         -->P_0568   text
    form fill_fieldcat using    p_fname
                       p_tabname
                       p_seltext
                       p_colpos
                       p_do_sum.
      clear fieldcat_in.
      fieldcat_in-fieldname  =  p_fname.
      fieldcat_in-tabname    =  p_tabname.
      fieldcat_in-seltext_m  =  p_seltext.
      fieldcat_in-col_pos    =  p_colpos.
      fieldcat_in-do_sum     = p_do_sum.
      append fieldcat_in to gt_fieldcat.
      clear fieldcat_in.
      fieldcat_in-fieldname     = 'DOLLARS'.
      fieldcat_in-tabname       = 'ALV0'.
      fieldcat_in-no_out        = ' '.
      fieldcat_in-do_sum        = 'X'.   "SUM UPON DISPLAY
      append fieldcat_in to gt_fieldcat.
    clear fieldcat_in.
      fieldcat_in-fieldname     = 'COUNT'.
      fieldcat_in-tabname       = 'ALV0'.
      fieldcat_in-no_out        = ' '.
      fieldcat_in-do_sum        = 'X'.   "SUM UPON DISPLAY
      append fieldcat_in to gt_fieldcat.
    data sorting and subtotal
      data: gs_sort type slis_sortinfo_alv.
      clear gs_sort.
      gs_sort-tabname = 'ALV0'.
      gs_sort-fieldname = 'KUNNR'.
      gs_sort-spos      = 1.
      gs_sort-up        = 'X'.
      gs_sort-subtot    = 'X'.
      append gs_sort to gt_sort.
      gs_sort-tabname = 'ALV0'.
      gs_sort-fieldname = 'DOLLARS'.
      gs_sort-spos      = 3.
      gs_sort-up        = 'X'.
      gs_sort-subtot    = 'X'.
      append gs_sort to gt_sort.
      gs_sort-tabname = 'ALV0'.
      gs_sort-fieldname = 'COUNT'.
      gs_sort-spos      = 4.
      gs_sort-up        = 'X'.
      gs_sort-subtot    = 'X'.
      append gs_sort to gt_sort.
    Gs_layout-cell_merge = 'X'.
    endform.                    " fill_fieldcat
    *&      Form TOP_OF_PAGE
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                i_logo             = 'ENJOYSAP_LOGO'
                it_list_commentary = t_list_top_of_page.
    endform.
    *&      Form  cal_no_of_orders
          text
         -->P_ALV_dat  text
         -->P_ERDAT1  text
         <--P_KUNNR  text
         <--P_GV_COUNT  text
         <--P_GV_NETWR  text
         <--P_GV_NAME1  text
    form cal_no_of_orders tables alv_tab structure zvbpa
                          using    p_erdat1
                          changing p_gv_count
                                   p_gv_netwr.
      clear: alv_tab, p_gv_count, p_gv_netwr, g_tabix, zvbak, zvbpa.
      refresh: zvbak, zvbpa.
      data: g_tabix  like sy-tabix,
              gv_index like sy-tabix.
      data: av_tab like zvbpa occurs 0 with header line.
    *Select Orders Processed
      select  vbeln erdat netwr vgbel from vbak
            into corresponding fields of table zvbak where
            erdat = p_erdat1  and
            vkorg in s_vkorg and
            auart = 'ZEDI'   and
            (  ( bsark = 'DFUA' ) or
              ( bsark = 'DFUE' ) or
              ( bsark = 'DFUI' )  ).
      if sy-subrc = 0.
        clear sy-subrc .
        sort zvbak by vbeln.
        select vbeln parvw kunnr adrnr from vbpa
                into corresponding fields of table zvbpa
                for all entries  in zvbak
                where vbeln = zvbak-vbeln
                and  parvw = 'AG'.
        if sy-subrc = 0.
          clear zvbpa.
          loop at zvbpa.
            g_tabix = sy-tabix.
            read table zvbak with key vbeln = zvbpa-vbeln binary search.
            if sy-subrc eq 0.
              move :zvbak-netwr to zvbpa-netwr,
                    zvbak-erdat to zvbpa-erdat.
              modify zvbpa index g_tabix.
            endif.
            select single name1 into (p_name1 )
                                from adrc
                                where addrnumber = zvbpa-adrnr.
            if sy-subrc = 0.
              move p_name1 to zvbpa-name1.
              modify zvbpa index g_tabix.
            endif.
          endloop.
        endif.
      endif.
    move Processed Orders to ALV display table
      clear zvbpa.
      loop at zvbpa.
        move-corresponding zvbpa to alv_tab.
        append alv_tab.
        clear alv_tab.
      endloop.
    endform.                    "  cal_no_of_orders<i></i>
    Message was edited by:
            sap learner

    this is the short dump
    What happened?                                                                               
    The current application program detected a situation which really                
    should not occur. Therefore, a termination with a short dump was                 
    triggered on purpose by the key word MESSAGE (type X).                                                                               
    What can you do?                                                                               
    0060   *"       CHANGING                                                        
    0070   *"             VALUE(CT_SORT) TYPE  LVC_T_SORT                           
    0080   *"                                                                       
    0090   -
    &#61664;                                                                         
    0100     FIELD-SYMBOLS: <LS_FIELDCAT> TYPE LVC_S_FCAT.                          
    000110     DATA: LS_SORT     TYPE LVC_S_SORT.                                
    000120     DATA: LFLG_MODIFY(1) TYPE C.                                      
    000130     DATA: LFLG_EXPA_DEFAULT_SET(1) TYPE C.                            
    000140     DATA: L_COUNT LIKE SY-TABIX.                                      
    000150                                                                       
    000160     SORT IT_FIELDCAT BY FIELDNAME.                                    
    000170     SORT CT_SORT STABLE BY SPOS ASCENDING.                            
    000180     LOOP AT CT_SORT INTO LS_SORT.                                     
    000190       LS_SORT-SPOS = SY-TABIX.                                        
    000200       MODIFY CT_SORT FROM LS_SORT.                                    
    000210     ENDLOOP.                                                          
    000220                                                                       
    000230     SORT CT_SORT BY SPOS DESCENDING.                                  
    000240                                                                       
    000250   * Default settings for subtotals                                    
    000260     READ TABLE CT_SORT WITH KEY COMP = 'X' TRANSPORTING NO FIELDS.    
    000270     IF SY-SUBRC NE 0.                                                 
    000280       LFLG_MODIFY = 'X'.                                              
    000290     ENDIF.                                                            
    000300                                                                       
    000310     LOOP AT CT_SORT INTO LS_SORT.                                     
    000320                                                                       
    000330       READ TABLE IT_FIELDCAT ASSIGNING <LS_FIELDCAT>                  
    000340            WITH KEY FIELDNAME = LS_SORT-FIELDNAME BINARY SEARCH.      
    000350       IF SY-SUBRC NE 0.                                               
      >         MESSAGE X000(0K).                                             
    000370       ENDIF.                                                          
    000380                                                                       
    000390       LS_SORT-SELTEXT = <LS_FIELDCAT>-SELTEXT.                        
    000400                                                                       
    000410   *     Zwischensummenstufen ermitteln                                
    000420       IF NOT LS_SORT-SUBTOT IS INITIAL.                               
    000430         L_COUNT = L_COUNT + 1.                                        
    000440       ENDIF.                                                          
    000450                                                                       
    000460       IF L_COUNT = 1 AND LFLG_EXPA_DEFAULT_SET = 'X'.                 
    000470         LS_SORT-EXPA = 'X'.                                           
    000480       ENDIF.                                                          
    000490   *     Default setzten (s.o.)                                        
    000500       IF LFLG_MODIFY = 'X'.                                           
    000510         LS_SORT-COMP = 'X'.                                           
    000520       ENDIF.                                                          
    000530                                                                       
    000540       MODIFY CT_SORT FROM LS_SORT.                                    
    000550     ENDLOOP.

  • Arabic SubTotals in Adobe Form Page.

    Hi Everyone,
    I have a requirement of printing Subtotals of a table in Arabic as well as English on the same page for all pages in the form.
    FYI i have made a function module to convert english digits into arabic, which i use in my code to convert english amounts to arabic amounts.
    Like -
    CALL FUNCTION 'ZJP_M_ARABIC_NUMERALS'
    EXPORTING ENGLISH = V_AMOUNT
    IMPORTING ARABIC = V_AMOUNT_AR.
    This gives me the arabic amount.
    Now i am printing english subtotals using the javascript code :
    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 == "AMOUNT") {
    total = total + fields.item(i).rawValue;
    this.rawValue = total;
    Through this code i am able to get the english subtotal in my offline adobe form.
    My PROBLEM is - how do i use this english subtotal generated via javascript to convert it into arabic subtotal (using the FM)
    for each page.
    Any help is highly appreciated..!!
    Thanks,
    Piyush.

    Hi Piyush,
    Check this below link set locales for a field using java script this might help if you are looking for @ scripting
    /people/raghavendra.prabhu/blog/2010/12/17/currencynumber-formatting-in-hcm-forms
    I have 2 approaches (hopefully both of them will work).
    1)  Have a hidden field with arabic locale, in your loop keep adding values to this field.
    2) have the required field on the form set the locale to arabic, just assign the english value to this field. (if both english and arabic totals are from same records and same values mathematically then only the presentation locale is different but the value sud be the same right).
    If I am wrong understanding your requirement, please explain what is the difference ...?
    Cheers,
    Sai

  • Subtotals in REUSE_ALV_HIERSEQ_LIST_DISPLAY

    Hi,
      I am working on REUSE_ALV_HIERSEQ_LIST_DISPLAY list display. I am trying do subtotals on Item level, but its not giving, at the same time i am doing subtotals on Header lever lable..
    I want to subtotals on Header table and Item table level..
    please suggest one on the same...
    thanks,

    Check with below thread
    REUSE_ALV_HIERSEQ_LIST_DISPLAY
    Thanks
    Seshu

  • Can table wizard add table column totals record

    I am working on the release of an Oracle CGBU product - NextGen Integrity. This is a key prototype for rolling BIP across CGBU
    We are using BI Publisher 10.1.3.4.
    To add subtotals to a table I added an extra row to the table and used xsl in a template property. Can someone confirm there is no way to calculate table totals using the table wizard.

    I now see I can double click on existing field to add aggregation. I thought this would have been part of the insert table wizard. I am expecting customers to write there own reports so hope to limit their need for writing xsl so this is fine.
    Thanks for your response.

  • Adobe Help required:subtotal of amount per page in Adobe forms

    Hello everyone,
    I have the following requirement:
    If i have 12 items in my i_item table:
    Page 1 --> 8 items fit
                    calculate and display subtotal of field amount(WRBTR) of the 8 items at end of page 1
    Page 2 --> remaining 4items fit
                    display the subtotal displayed on the on the previous page as first record of page
                    display remaining 4 items
                    calculate and display subtotal of field amount(WRBTR) of these 4 items at end of page 2
    In last page calculate and display grand total based on the subtotals
    In my table i_item (DATA section) i added a footer section and placed the code SUM(I_ITEM.DATA[].WRBTR[]) in the subtotal field, but it gave the grand total.
    As per SDN i changed the code to SUM(WRBTR[])  but nothing is displayed on the form. I also tried SUM(DATA[].WRBTR[*]) and i obtained the valu
    Settings used: Formcalc , Client, Calculate, Calculation Script
    i also tried the following two Javascript code with the following settings
    Javascript, Client, Events with Scripts, Calculation Script
    in the footer row and i obtained nothing on screen
    first code used:
    var fields = xfa.layout.pageContent(0 , "field", 0);
    var total = 0;
    for (var i=0; i <= fields.length-1; i) {
    if (fields.item(i).name == "WRBTR") {
    +total = total + fields.item(i).rawValue;+
      this.rawValue = total;
    second code used:
    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 == "WRBTR")
    +total = total + fields.item(i).rawValue;+
    this.rawValue = total;
    kindly provide help.
    thanks&regards;

    Hi Devi,
    Try with this code.
    1. For subtotals:
    Show: Eventswith script, language: Javascript, Run At: Clinet.
    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 == "NETPR") {
    total = total + fields.item(i).rawValue;
    this.rawValue = total;
    2. For Grand total:
    Show: Eventswith script, language: FormCalc, Run At: Clinet.
    sum(data.Subform1.T_VBAP.Group1.DATA[].NETPR[])
    Regards,
    Raju.

  • ALV Grid: method double_click provides wrong information with 'totals line'

    Hi together,
    I´m using 'method double_click' with an ALV grid...like:
    CLASS lcl_events IMPLEMENTATION.
      METHOD double_click.
        READ TABLE it_outtab INDEX e_row-index INTO s_datatab.
    Everything works perfect as long as I don´t use totals with it.
    Using totals /subtotals lines 'READ TABLE...' provides a wrong row-index.
    Any idea how to resolve this problem?
    Thanks for any help

    Hi, this is a big problem when you use OO to build an ALV, to resolve your problem, you have to implement an event TOOLBAR_BUTTON_CLICK to get button function, when your code pass by this method you have to use the method
    CALL METHOD gcl_grid->set_function_code
        CHANGING
            c_ucomm = l_ucomm.
    l_ucomm is the function code of button, the method set_function_code sort your internal table dynamically and you get the correct index when you use double_click.
    Regards.
    David Carballido
    PD: Sry for my bad english ^^

  • Text module

    Hi friends,
    Could any one tell me what is "Text module" in Smartforms.
    How we use them in Standard Smarforms .
    With Regards,
    Ramesh.

    Hi ramesh,
    In smartform  there are three text types:
      <b>Text element</b> : to enter new text in the PC editor
      <b>Text module</b> : to include a text module
       <b>Include text</b> : to include an existing SAPscript text
    The texts are displayed in the form using text nodes. The only exceptions are addresses. This uses its own node. The predecessor node of the text node determines its use:
    <b>Predecessor node Used to</b>
    Sub window               Position text on one or more pages
    Main window              Display text in relation to other nodes in the main window, 
                                     it may cover several pages
    Template                    Displays texts for table cells of a static table
    Table                         Display table contents
    Header and footer        Display column headings and grand totals in tables
    Event node                 Display subtotals in a table
    <b>Including text modules:</b>
    <b>Text module</b> of the text node is used to refer to an existing text module in the system. The text modules can be used in two ways:
    <u><i><b>STEPS :</b></i></u>
    1)   Refer to the text module. The text then appears read-only in the PC editor and
          is included when the form is printed.
    2)  Copy the text module. The system then copies the text of the module and
         automatically converts the text node into an editable text element.
    3)   To create a text node , call the context menu for that node in the tree
         structure that shall contain  the text and choose create->text
    4)      Enter a unique name for the node and a description
    5)     On the general attributes tab select the text type text module
    6)      Enter the name of the text module in the text name field
    reward points if useful....
    thanks ,
    Ginni...

  • Need information on SMARTFORMS

    hi i m looking for some information on SMARTFORMS.
    why it is needed?
    what is difference between smartforms and sapscripting?
    if someone could send some docs. how to work on smartforms it will begreat

    Hi,
    Here I am sending the full information about smartforms. Reward if helpful.
    SAP Smart Forms (BC-SRV-SCR)
    Purpose
    You use SAP Smart Forms to create and maintain forms for mass printing in SAP Systems. As output medium SAP Smart Forms support a printer, a fax, e-mail, or the Internet (by using the generated XML output).
    In addition to the tool, SAP delivers a selection of forms for central business processes. This includes forms in Customer Relationship Management (CRM) as well as in the applications SD, FI, and HR of the R/3 Release.
    SAP Smart Forms offer the following advantages:
    •     Creating and maintaining forms requiring half the time
    •     Adapting forms without any programming knowledge due to entirely graphical user interface
    •     Web Publishing using the generated XML output
      The SAP Smart Forms replace the SAPscript forms. SAPscript forms will also be supported in the future; you can use them without making any changes for years to come. You can use SAPscript texts in the Smart Forms. Migration of SAPscript forms into Smart Forms is supported.
    Features
    SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can configure forms with data from an SAP System for the relevant business processes.
    To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
    You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics. To make changes, use Drag&Drop, Copy&Paste, and select different attributes. These actions do not include writing of coding lines or using a Script language.
    For Web publishing, the system provides a generated XML output of the processed form.
    You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
    You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
    SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
    SAP Smart Forms also support postage optimizing.
    General Concepts on Form Printing
    Form printing covers creating and maintaining a form for mass printing in SAP Systems. This includes design and layout of the form as well as form logic.
    The layout determines the page structure, that is the number of differently structured pages and the positions of the output areas on these pages. Within the output areas, you use tables, paragraphs, paragraph formats and character formats to structure and format texts and data.
    The form logic controls the dynamic formatting of the form. It allows you to display variable fields, to display texts only if a certain condition is true (for first dunning, use this text, for second dunning another), or to repeatedly process invoice items within a table.
    Forms can be:
    •     Order confirmations
    •     Invoices
    •     Account statements
    •     Checks
    •     Salary statements
    •     Delivery notes
    •     Customs forms
    •     Industry-specific forms, such as quality forms in automobile manufacturing
    The concepts on form printing presented below are independent of any tool. As of mySAP.com release 4.6C use the SAP Smart Forms [Extern] in SAP Systems.
    This documentation does not cover document output and control on printers. Description of the process ends with transferring a processed file to the output management, which in the R/3 System is the spool.
    Structure of a Form
    Definition
    A form consists of pages, output areas, addresses, graphics (such as company logo), and data or text contents. Within an output area, you can use static or dynamic tables to display data or texts in lines, columns, or cells. To further structure and format text and data, use paragraphs with the paragraph and character formats.
    SAP calls output areas "windows". You can position windows freely on a page (see also Pages of a Form [Seite 8] and Main Windows and Subwindows [Seite 8]).
    Example of a Form Structure
    We use a simple invoice. For certain customers, we display their flight bookings with prices in a table in a window. The invoice also contains other windows for the company logo, the sender address, the customer address, company-specific data (clerk, customer number, reference, date, and so on), bank data, and pagination.
    The first page displays the customer letter, followed by a table containing the flight bookings of that customer. The output length of the table depends on the number of booking items (dynamic table). The table header contains the column headings, the table footer contains the total. If the space on the first page is not sufficient to take all items, the table continues on the next page, thereby repeating the column headings. In addition, the first page contains:
    •     the company logo inserted as graphic in bitmap format.
    •     the customer address. This address appears only on the first page (for the window in the envelope) and is preceded by the sender address in small font.
    •     a window containing company-related data in several fonts and font sizes (invoice, clerk, phone/fax, reference, customer number, date).
    •     the footer containing the company and bank data.
    The second page contains the current page number and the total number of pages in the document.
    Pages of a Form
    Definition
    On the pages of a form you determine the page layout and the sequence of pages with different structures.
    The page layout includes the page format (for example, DIN A4, Letter, DIN A5 landscape) and the position of the windows on a page.
    Use
    The individual pages of a form differ in their structure. The first page of an invoice, for example, contains the address, which you do not want to display on the next page; and you want to display the General Terms of Business on the last page. For each page, you must specify a next page to make the page sequence clear. You can also repeatedly call the same page if you want recursive output (for example, if the list of invoice items is very long and does not fit onto one document page).
    The page break either is triggered automatically by the main window (see also Main Window and Subwindows [Seite 8]) or you code it manually into the form logic (see also Specifying the Page Sequence [Seite 52]).
    Many forms contain only two pages of different structure: the first page, which calls the next page, and the next page, which calls itself. If the text does not entirely fit onto the second page, another document page is automatically displayed.
    Main Window and Subwindows
    Definition
    On a page, there are two different types of output areas for texts and data: the main window and the subwindow.
    Use
    You can position windows anywhere on a page, even overlapping. You can position the same window (determined by the technical name) on several pages of a form, so that the same contents are displayed on all these pages. You can choose a different size for the window on each page, except for the main window.
    Main Window
    In a main window you display text and data, which can cover several pages (flow text). As soon as a main window is completely filled with text and data, the system continues displaying the text in the main window of the next page. It automatically triggers the page break.
    You can define only one window in a form as main window.
    The main window must have the same width on each page, but can differ in height.
    A page without main window must not call itself as next page, since this would trigger an endless loop. In such a case, the system automatically terminates after three pages.
    Subwindows
    In a subwindow you display text and data in a predetermined output area. There is no flow text display with page break. If you position a subwindow with the same name on several pages, the system displays the contents of this subwindow on each page.
    Text and data that do not fit into the subwindow are truncated and not displayed.
    Texts and Data in a Form
    Definition
    You enter text in an editor (see also Positioning Text on a Form [Seite 26]).
    Data can be character strings or numbers. The system reads this data from a database and uses fields (parameters) to dynamically display it (see also Using Parameters in a Form [Seite 37]).
    Use
    To display text and data in table format (for example, lists or invoice items), you use tables or templates.
    To format texts and fields (data), you use paragraph and character formats. You assign paragraph formats to entire paragraphs and character formats to individual character strings, for example, to highlight a word.
    The paragraph format determines:
    •     Font family and font size,
    •     Indents and spacing,
    •     Text alignment within the paragraph,
    •     Tabs,
    •     Outline options, such as numbering,
    •     Protection of paragraphs against page breaks.
    To determine the paragraph and character formats, use the Smart Styles (see also Smart Styles [Seite 54]).
    Overview
    This section describes the architecture  [Seite 10]of SAP Smart Forms and how to create a form [Seite 11]. Essential for creating forms is to understand the form logic [Seite 13].
    Architecture
    If you create forms for an application, you want to include application data into the form. The architecture of SAP Smart Forms separates application data retrieval from the actual definition of the form:
    In a Smart Form you describe:
    •     The layout of your form (element positions on a page)
    •     Individual elements you want to display (text, graphics, addresses, tables, and so on)
    •     the form logic you use, for example, to read application data from internal tables, to introduce conditions, and to control process flows (see also: Form Logic: Introduction [Seite 13])
    •     a form interface to transfer application data to the form definition
    When you activate the Smart Form, the system generates a function module that encapsulates all attributes of the Smart Form. As soon as the application program calls the function module, the Smart Form uses the modules interface (which corresponds to the form interface) to transfer any table data previously selected and to print the form according to the form description.
    The form description can also contain statements that select further data during form processing. However, you should not use this method of data retrieval. Especially if you print mass forms, performance will deteriorate considerably.
    Creating Forms Using SAP Smart Forms
    This section gives an overview of how to create a form in which to display application data from database tables.
    For more detailed information on this procedure, see Using SAP Smart Forms [Seite 14].
    When creating a form, you must:
    1.     Retrieve the application data [Seite 11].
    2.     Describe your form [Seite 12].
    3.     Pass the application data to the form [Seite 38].
    Printing the Form
    Call a function module generated by Smart Forms to print your form. Smart Forms support the forllowing output options:
    •     The form is printed on a printer connected to the SAP System. Before printing, use the print preview to check whether the form is correct.
    •     The function module generates an XSF datastream that transfers, for example, the form description including the retrieved data to programs of third-party companies.
    Retrieving Application Data
    Prerequisites
    To achieve a good performance when printing a form, you must separate data selection from the use of data in the form. Thus you can bundle database operations before you start processing the form.
    Before you retrieve data, you should know:
    •     Which application data you want to appear in the form
    •     Which database tables you must access to retrieve this data
    Process Flow
    Write an ABAP program to retrieve data or include a retrieval routine into your application. This code consists of statements that select data from the database according to certain selection criteria. Store the retrieved data in internal tables, structures, or variables and transfer it to the form in one step.
    While you initialize the form, you can format the data, which you passed to the form, for output in the form. Formatting data in the form and not in the data retrieval program allows you to use one data retrieval program for several forms with different formatting routines.
    Result
    You store the application data in internal tables of the data retrieval program. Since you know now which table types occur, you can define a form interface to transfer this data to the appropriate form.
    Describing the Form
    You describe a form using a Smart Form. To do this, use the Form Builder (see also: Graphical User Interface [Seite 15]):
    1.     Describe the interface of the form. It results from the application data previously selected.
    2.     Create one or more pages. On a page, you can position windows, addresses, and graphics. Within a window, you can create additional elements.
    3.     Create elements (text, graphics, tables, and so on) for each page, using other tools of the Form Builder:
    &#61485;     Use the Form Painter [Seite 17] to position windows, graphics, and addresses on a page (the other elements are displayed in an assigned window).
    &#61485;     Use the PC Editor [Seite 19] to write your texts.
    &#61485;     Use the Table Painter [Seite 20] to format your tables.
    For an overview of the elements available on page level, see Node Types: Overview [Seite 23].
    4.     Use the flow control [Seite 50] to control whether and when to print pages and elements.
    Result
    When you activate your Smart Form, the Form Builder generates a function module that encapsulates the form description.
    Form Logic: Introduction
    In the Form Builder you describe a Smart Form by a set of nodes. To do this, you build up a tree structure on the left side of the user interface:
    This graphic already contains some nodes. The node Global Settings as well as its three successors Form attributes, Form interface, and Global definitions always exist for any newly created forms. To describe the Form logic, create a hierarchy under the node Pages and windows. This hierarchy determines the rules used to process the nodes of the tree. Depending on the node type, this could include:
    •     printing the node contents (text, addresses, graphics).
    •     executing the node statements.
    •     executing the successors of a node according to other rules (for example, in a loop).
    You use the form logic to control the flow of the form output. The following rules apply throughout:
    1.     The nodes in the tree structure are processed from top to bottom. This is easier to understand, if you imagine all nodes to be expanded.
    2.     For each node there is a tab, which you can use to link the node to a condition [Seite 51]. If the condition is true, the system processes the node. If not, it skips the node and all its successors.
    3.     You must define a next page for each page. However, you can also go to other pages dynamically (see also: Flow Control [Seite 50]).
    In addition, the page break depends on how much space there is left on the current page.
    For the complete rules for processing the tree structure, see Processing a Form [Seite 63].
    Example for Form Logic
    The diagram below shows the tree structure of the root node Pages and windows:
    The numbering of the nodes also shows the sequence in which they are processed (from top to bottom). The first node is the root node. The successors of a node are all nodes included directly under this node in the hierarchy. For node 5 these are the nodes 6 to 9 (direct successors are only the nodes of the next hierarchy level, that is 6, 7, and 9).
    A node without a successor node is also called end node. Elementary nodes can never have successors (see also Node Types: Overview [Seite 23]). If the condition of node 7 is false, neither node 7 nor node 8 are processed. Processing resumes directly with node 9.
    In this example, we assume that no pages are called dynamically and that there is enough space on the page for the output.
    Using SAP Smart Forms
    Graphical User Interface
    Use
    SAP Smart Forms provide a graphical user interface that helps you create and maintain the layout and the form logic of a form: the SAP Form Builder. You need neither have any programming knowledge nor use a Script language to adapt standard forms. Basic ABAP programming skills are required only in special cases (for example, to call a function module you created or for complex and extensive conditions).
    Features
    The SAP Form Builder of the SAP Smart Forms consists of:
    •     Form Painter for creating the layout of a form,
    •     PC Editor for entering texts and fields into output areas,
    •     Navigation tree for maintaining the form logic,
    •     Table Painter for creating templates and tables,
    •     Form check.
    To define text formats, use style maintenance (transaction SMARTSTYLES;see also Smart Styles [Seite 54]).
    Activities
    The SAP Smart Forms initial screen is the starting point for maintaining forms, styles [Seite 54], and text modules [Seite 54]:
    1.     Choose transction SMARTFORMS.
    The dialog window SAP Smart Forms: Request appears.
    2.     Select Form, Style, or Text module, depending on which object you want to create, display, or change.
    3.     Enter the name of the object.
    4.     Choose Create, Change, or Display.
    Depending on the radio button you selected (Form, Style, Text module), the system branches to the Form Builder, the style maintenance (transaction SMARTSTYLES ), or to the text module maintenance.
    Navigating in the SAP Form Builder
    The screen capture below shows the three different areas of the SAP Form Builder: The navigation tree (hierarchy structure of a Smart Form) on the left, the maintenance screen in the middle, and the Form Painter on the right.
    If you select a tree in the node, the system updates the maintenance screen and marks the relevant window in the Form Painter. You can also select a window in the Form Painter; the system them marks the relevant node in the tree.
    In the tree you determine the hierarchy of the form logic (see also Form Logic: Introduction [Seite 13]); in the Form Painter you determine the layout. If you, for example, move a window in the tree, this does not effect the layout of the Smart Form.
    Tree Navigation
    Selecting a Node
    To select a node in the tree, double-click it. The system updates the maintenance screen accordingly.
    Drag&Drop
    Use Drag&Drop to move (left mouse button) or copy (Ctrl + left mouse button) subtrees.
    Drag&Drop is a "move" operation, consisting of a "cut" and a "paste" operation with its own clipboard. If the node you are moving can be appended either on the same level as the target node or as a successor of the target node, the context menu offers both possbilities.
    Context Menu
    Use the right mouse button to display a sensitive context menu in the tree (that is, depending on the current node type). The following functions exist:
    •     Creating or deleting (only in change mode)
    Depending on the selected node type only valid node types appear.
    •     Clipboard operations (see below), such as cutting, copying to clipboard, pasting from clipboard (only in change mode)
    •     Expanding and collapsing a subtree
    Clipboard
    There are three clipboard operations:
    •     Copy
    Copies the selected node with all its successor nodes into the clipboard.
    •     Cut
    Copies the selected node with all its successor nodes into the clipboard and deletes the copied nodes from the tree.
    •     Paste
    Before pasting, the system checks whether and where you are allowed to append the root node of the clipboard contents.
    Maintenance Screen
    On the maintenance screen you can select different tab pages depending on the node type. For more information see Node Types: Overview [Seite 23].
    Form Painter
    You can suppress or display the Form Painter (choose Form Painter on/off). For more information on how to work with the Form Painter see Graphical Form Painter [Seite 17].
    Form Painter
    Use
    You use the Form Painter to design the layout of the pages of a Smart Form. You can include windows and graphics on a page, determine their positions and choose the window sizes.
    The Form Painter offers the following functions:
    •     Design area with ruler, cursor with help lines, and grid and main grid
    •     Display of the cursor position in the ruler, which you can suppress and set
    •     Two-level grid with engage function, which you can customize at will
    •     When creating, changing, and moving a window, the window size appears in the ruler.
    •     Detachable toolbar containing the most important functions
    •     Autoscrolling when moving windows; placing windows into the background
    •     Zoom factors you can set to any value and autozooming of the design area to the window size
    •     Sensitive context menu
    •     Placing a scanned graphic into the background of the design area (see also Printing Graphics [Seite 31])
    Activities
    To display or suppress the Form Painter choose Form Painter on/off.
    To make detailed settings in the Form Painter (for example, step size of the grid, zoom factors, and so on), choose Settings in its toolbar.
    PC Editor
    You use the PC Editor to enter and format texts and fields.
    Among others, the PC Editor offers the following functions:
    •     Enter, delete, select, cut, and copy texts (see also Entering Text in the PC Editor [Seite 27]).
    •     Assign paragraph and character formats (for a list of the available formats use the list boxes Paragraph formats and Character formats)
    •     Include, change, and delete fields (see also Using Fields in the Form [Seite 42])
    The PC Editor displays fields with a gray background.
    Table Painter
    Use
    You use the Table Painter to design templates and tables in a window (see also Displaying a Table with Static Data [Seite 33]).
    The Table Painter offers the following functions:
    •     Drawing lines and columns
    •     Inserting, cutting, copying, and deleting lines
    •     Deleting cells
    •     Changing cell size and moving cell separator lines
    •     Splitting cells
    •     Selecting table patterns
    Activities
    To display or suppress the Table Painter, choose Table Painter on/off on the Table tab on the maintenance screen of a table or template.
    The design area does not mirror the size of your window into which you include the table. Therefore, remember to check the size in the ruler.
    If you want to insert two tables one after the other, you must create two tables in the window node one after the other.
    To execute a function, mark a cell and choose the function in the context menu (right mouse button).
    To select a table pattern, select the Table tab in the node and choose Select pattern.
    To make detailed settings in the Table Painter (for example, step size of the grid, zoom factors, and so on), choose Settings in its toolbar.
    Style Builder
    The screen capture shows the Style Builder that you use to define Smart Styles. On the left, you see the style tree which consists of predetermined nodes (header data, folder for paragraph formats, folder for character formats). You can navigate between the nodes and create new nodes. On the right, you see the maintenance screen with its tab pages (here, for example, standard settings for the font in the selected color blue). At the bottom you see the preview of the selected font.
    For detailed information on how to create and maintain a Smart Style see Smart Styles [Seite 54].
    Field List and Error List
    Field List
    The field list displays the following data in a tree structure:
    •     all tables, structures, and fields passed via the form interface [Seite 38].
    •     system fields [Seite 43] and fields you defined in the global definitions [Seite 41]
    This allows you to check that you enter the correct field name when you include a field, and that the Smart Form actually knows the field.
    To display the field list, in the Form Builder choose Field list on/off.
    Error List
    When you check the Smart Form and any errors occur, the system displays a list of errors and warnings at the bottom of the maintenance screen. To find the error or warning in the tree, select the node in the second column. The system then goes to the corresponding position in the tree and you can correct the error.
    To check the entire Smart Form choose Check. If an error occurs the error list appears.
    For more information on testing and checking forms see Checking and Testing a Smart Form [Seite 58].
    Node Types: Overview
    When you create a Smart Form, the tree structure of the Form Painter already contains two root nodes:
    •     You use the successors of the Global Settings node to maintain Form attributes, the Form interface, and Global definitions.
    •     You use the successors of the Pages and windows node to create the pages of your form, position elements on these pages, and determine the sequence in which you want to process these elements.
    Apart from the two root nodes, each node has attributes. You can maintain these attributes on tabs on the right half of the screen. The attributes you can maintain on the tabs General Attributes, Output Options, and Conditions are the same for most of the node types (see: Shared Attributes of the Node Types [Seite 24]).
    Successors of Node Pages and windows
    As direct successors to root node Pages and windows you can create only page nodes. The tables below describe these page nodes and the other successors:
    Output areas
    Node type     Description     Possible direct successors
    Page [Seite 25]
    A page of the form. Direct successors of this node can be placed directly on the page.     Window, graphic, address
    Window [Seite 26]
    Output area on a page. There are main windows and subwindows.     All except window and page nodes
    Elementary nodes (without successors)
    Node type     Description
    Text [Seite 26]
    You use this node to print any texts (and table contents), except addresses.
    Graphic [Seite 31]
    You use this node to position graphics in the form. To include background graphics, use node type Page.
    Address [Seite 30]
    You use this node to include an address. The system reads the address data directly from the database tables and formats them for print output.
    Table output
    Node type     Description     Possible direct successors
    Template [Seite 33]
    Output of a table containing static data     All except window, page, table, and template nodes
    Table [Seite 46]
    Output of a table containing application data     As with template node
    Flow control
    Node type     Description     Possible direct successors
    Command [Seite 52]
    Executes special commands (next page, paragraph numbering, printer control)     (no successor)
    Loop [Seite 52]
    Processes successor node repeatedly.     All except window and page nodes
    Alternative [Seite 51]
    Branches depending on condition.     Direct successors are automatically the nodes TRUE and FALSE. The direct successors of these are all nodes except window and page nodes.
    Other nodes
    Node type     Description     Possible direct successors
    Folder [Seite 36]
    Combines successor nodes to logical groups     All except window and page nodes
    Complex section [Seite 60]
    Combines all attributes of the node types template, table, loop, folder     All except window and page nodes
    Program lines [Seite 61]
    Executes ABAP program code (for example, conversion routines).     (no successors)
    Shared Attributes of the Node Types
    The following tab pages are used in common by several node types:
    Tabs for general node attributes
    Name     Description
    General Attributes     Shows contents or description of the node
    Output Options     Contains attributes such as position, style, box and shading
    Conditions [Seite 51]
    Allows to display the node only if certain conditions are true (see also: Flow Control [Seite 50])
    The node types Table, Template, Loop, Folder, and Complex section share a different tab in the place of General Attributes.
    Output Options
    Except for the page nodes in the subtree Pages and windows, you can always use this tab to determine a box and shading for the respective node. Nodes with text output also have the attribute Style. You use this attribute to overwrite for the current subtree the style that was set in the form.
    Depending on where you insert a node, it can have additional output options (for example, if the predecessor is a template [Seite 33]).
    Basic Elements of a Form
    Creating Pages
    Use
    Each form consists of one or more pages. The first page in the tree structure is the start page (when you create a form, the start page already exists). With this page, processing of the form starts.
    When you call pages repeatedly or process pages again because the main window is not filled yet, a page node creates several print pages.
    See also: General Concepts on Form Printing [Seite 7].
    Procedure
    1.     Open the context menu for an existing page node and choose Create &#61614; Page.
    2.     Enter a unique name for the node and a description (for example, business terms).
    3.     Determine the format and the mode of the page counter [Seite 53] on the General Attributes tab. In the default setting, the next page is the page itself.
    4.     Determine the print attributes of the page on the Output Options tab (see F1 help).
    5.     Determine a background graphic for the entire page on the Background tab. For information on how to select the graphic see Printing Graphics [Seite 31]. If you do not determine an Output mode in the Output attributes box (in print preview only, on the printer as well), the system ignores the background graphic.
    If you select an output mode, the user can still choose Background graphic in the print preview to display or suppress it.
    Result
    You can now define the page contents. For each page, the Form Painter shows an individual layout. Whether the page is included into the printout depends on whether it is evaluated during form processing [Seite 62] (a page can be omitted even though it is part of the tree structure).
    Creating Windows
    Use
    Windows are output areas for all output data. You can set the size and position of a window graphically in the Form Painter. There are main windows and subwindows [Seite 8]. The most important difference is that the output in a main window can cover several pages.
    After you created a form, a main window already exists on the first page.
    Prerequisites
    A page [Seite 25] exists on which you want to create a window.
    Procedure
    6.     Open the context menu for an existing page node and choose Create &#61614; Window.
    If you create the window in the Form Painter using the context menu, you can use the mouse to position it immediately.
    7.     Enter a unique name for the node and a description (for example, booked flights).
    8.     On the General Attributes tab indicate whether the window is a Main window. If you want to create a subwindow, leave the checkbox empty.
    For each page you can indicate only one main window.
    9.     The Position and Size values in the Output options box correspond to the position in the Form Painter. If you want to, maintain other attributes [Seite 24].
    Result
    You can see the window in the Form Painter and in the tree structure. You can always change the specification of the main window or subwindow.
    Positioning Texts on the Form
    Use
    You display all texts in the form using text nodes. The only exception are addresses [Seite 30], which use their own node.
    Integration
    The predecessor node [Seite 14] of the text node determines its use:
    Examples for using text nodes
    Predecessor node     Used to
    Subwindow     Exactly position text on one or more pages
    Main window     Display text in relation to other nodes in the main window; it may cover several pages
    Template     Display texts for table cells of a static table [Seite 33]
    Table     Display table contents
    Header and footer [Seite 49]
    Display column headings and grand totals in tables
    Event node [Seite 48]
    Display subtotals in a table
    Features
    There are the following text types:
    •     Text element: to enter new text in the PC Editor [Seite 27]
    •     Text module: to include a text module [Seite 28]
    •     Include text: to include an existing SAPscript text [Seite 29]
    Positioning the Text
    The position of the text depends on the direct predecessor node (for example, you can assign text of a table cell) as well as on the processing sequence in the tree structure. In addition, you determine output of a text node in relation to the preceding node on the same level [Seite 14]. You can append the text directly to the output of that node or start it in a new paragraph or a new line (select via radiobutton).
    Entering Texts in the PC Editor
    Use
    You use the PC Editor [Seite 19] to enter new text. The position of this text on the form is determined by the predecessor node.
    To include data from the form interface (data from application tables) or system data (date, time) into the text, use system fields or user-defined fields, respectively, in the text (see Using Parameters in the Form [Seite 37]). When processing the form, Smart Forms replace these fields with the corresponding values.
    Procedure
    1.     To create a text node, call the context menu for that node in the tree structure that should receive the text. Then choose Create &#61614; Text.
    2.     Enter a unique name for the node and a node description (for example, letter).
    3.     On the General Attributes tab choose Text element as text type.
    Since you edit a text element, an included text, or a text module exclusively using the text node, the system stores only information on the selected type. When you change the text type, the system therefore asks for your confirmation.
    4.     Enter your text in the PC Editor
    &#61485;     either directly on the tab if you use the inplace version of the PC Editor
    &#61485;     or choose Text editor to go to the fullscreen mode of the PC Editor. If, after entering the text, you use the green arrow (F3) to leave the fullscreen editor, the system transfers the text into the inplace version.
    5.     In the Text node box choose whether you want the text to start with a new paragraph or only in a new line. You can also choose to append the text directly to the end of the current paragraph.
    6.     If desired, choose the Output Options [Seite 24] tab to maintain the style or box and shading of the text.
    Result
    The system displays the node in the tree structure, including its name and description.
    Including Text Modules
    Use
    You use the text type Text module of the text node [Seite 26] to refer to an existing text module  [Seite 54]in the system. This allows you to easily use texts from text modules in several forms. In addition, it is not necessary to load the entire form description to maintain these texts.
    You can use text modules in two ways:
    •     Refer to the text module. The text then appears read-only in the PC editor and is included when you print the form.
    •     Copy the text module. The system then copies the text of the module and automatically converts the text node into an editable text element.
    Text modules can be used cross-client and are connected to the transport and translation systems.
    Prerequisites
    The text module you want to include must exist in the system. To create a text module use the SAP Smart Forms initial screen [Seite 15].
    Procedure
    5.     To create a text node, call the context menu for that node in the tree structure that shall contain the text and choose Create &#61614; Text.
    6.     Enter a unique name for the node and a description (for example, business terms).
    7.     On the General attributes tab select the text type Text module.
    Since you edit a text element, an included text, or a text module exclusively via the text node, the system stores only information on the selected type. When you change the text type, the system therefore asks for your confirmation.
    8.     Enter the name of the text module in the Text name field. Or click on the black arrow and enter the name of a field to be evaluated dynamically [Seite 37].
    9.     If you want to change the text of the text module for the current form, choose Copy. The Form Builder changes the text type to Text element and copies the text of the module into the PC Editor, where you can edit it. In this case, the original text module remains unchanged.
    10.     Use the checkbox Always copy style from text to determine that the style of the text module is of higher priority than that of the text node or any style inherited from a predecessor. This is important if you specified the name of a field in step 4 (see F1 help).
    11.     If required, use the Output options [Seite 24] tab to maintain attributes for style, box and shading of the text.
    Result
    The system displays the node including name and description in the tree structure. It includes the relevant text itself in the moment the form is processed. If you refer to a text module, it appears in the PC Editor in read-only mode, if you copy it you can edit it.
    Including SAPscript Texts
    Use
    You use the text type Include text of the text node to refer to a SAPscript text that already exists in the system. To identify the text, you need the text name, the text object, the text ID, and the language. Thus, you can easily use the texts in several forms. In addition, you need not load the entire form description [Seite 12] to maintain these texts.
    This text type corresponds to the SAPscript statement INCLUDE. However, Smart Forms do not allow any control statements in include texts. When processing the form, they are simply ignored.
    To administer application-specific form texts, applications use transaction SE75 to define their own text objects with subordinate text IDs. Use text object TEXT with text ID ST to enter general standard texts. To maintain them, use the standard text editor (transaction SO10).
    If there is no need for you to use old SAPscript texts, you better use text modules [Seite 28]. They can be used cross-client and are connected to the transport and translation systems.
    Procedure
    1.     To create a text node, call the context menu for that node in the tree structure that shall receive the text and choose Create &#61614; Text.
    2.     Enter a unique name for the node and a node description (for example, letter).
    3.     On the General Attributes tab choose Include text as text type.
    Since you edit a text element, an included text, or a text module exclusively via the text node, the system stores only information on the selected type. When you change the text type, the system therefore asks for your confirmation.
    4.     In the Text key box, identify the include text.
    &#61485;     To identify individual text objects, use the search help in this field.
    &#61485;     The search help of the Text name field allows you include the attributes of SAPscript texts into the search.
    7.     If required, use the Paragraph formats box to format the include text:
    &#61485;     The style assigned to the text node contains a format for the standard paragraph ('*'). If you enter a paragraph format in the Standard paragraph field, this format overwrites the style format for all standard paragraphs in the include text that use this paragraph format.
    &#61485;     Use the First paragraph field to set a paragraph format for the first paragraph of the include text. This format also overwrites the format set in the style. If you set the First paragraph field but leave the Standard paragraph field empty, the system uses the format set in the First paragraph field for any standard paragraphs in the include text.
    6.     In the Text node box choose whether you want the text to start in a new paragraph, in a new line, or directly at the end of the current paragraph.
    7.     If desired, choose the Output Options [Seite 24] tab to maintain the style or box and shading of the text.
    Result
    The system displays the node in the tree structure, including its name and description. The included text is included only at the moment the form is processed.
    Inserting Addresses
    Use
    In many applications, addresses are administered using the Central Address Administration [Extern]. Depending on how the address is used, the application uses a particular address type [Extern]. The addresses are stored in the database tables of the central address administration and identified by the application via a number.
    You use the address node to insert an address into the form. This guarantees that the address is formatted according to the postal rules of the sender country.
    Prerequisites
    Your application must administer addresses using the central address administration. Otherwise you must use the text node [Seite 26] to insert your addresses.
    Procedure
    1.     To create an address node, call the context menu for that node in the tree structure that you want to contain the text and choose Create &#61614; Text.
    Create the address node as direct successor of the page node or use the context menu in the layout of the Form Painter. You can then position the address anywhere on the page.
    2.     Enter a unique name for the node and a description (for example, customer address).
    3.     Determine the address type on the General attributes tab.
    For a description of how to determine the address type dynamically and how to use fields instead of fixed values, see Using Parameters in the Form [Seite 37].
    4.     For organization addresses you must specify only an address number. For any other address types, you must specify a person number and an address number. To do this, use the search help.
    5.     In the box Additional address specifications you can maintain other attributes to specify how you want to display the address:
    &#61485;     Use field Output starts with paragraph to set the paragraph format of the style that you want to use to display the address.
    &#61485;     If the number of lines you specify in the field Number of lines to be used is smaller than the number of lines required to display the address, the central address administration suppresses lines of the address.
    &#61485;     As default, the system uses as sender country the country that was specified when creating the address. You can use the parameter Sender country to overwrite this setting.
    &#61485;     For addresses that have a P.O. box as well as a street address, use the other fields in the box to determine which of these addresses to display.
    6.     If desired, you can use the Output Options [Seite 24] tab to maintain attributes for style, box, and shading of the text. In addition, you can set values for position and size of the output area (instead of in the Form Painter).
    Result
    The system displays the node including name and description in the tree structure. If you insert the address as direct successor of a page or by using the Form Painter, the system displays an extra output area for the address. The address itself is inserted only at the moment the form is processed. You cannot view it in the Form Builder.
    Printing Graphics
    Use
    You use the graphic node to display graphics, such as a company logo, on the form. For performance reasons, make sure that the graphics are held in the printer memory. SAP Smart Forms support this method, provided that:
    •     The printer can be controlled accordingly.
    •     There is enough memory space on the printer.
    •     You activated this property in transaction SE78 (see below).
    In this case, the system sends the graphics to the printer only once during one print job.
    To include background graphics, use the Background graphic tab of a page node.
    Prerequisites
    You use the SAPscript Graphic Administration (transaction SE78) to import graphics into the SAP-System:
    1.     Double-click on a graphic format in the tree structure in the forder Document server &#61614; GRAPHICS General graphics.
    2.     Choose Graphic &#61614; import.
    The transaction imports the graphic and stores it on the Business Document Server (BDS). Now you can display it on a form.
    See also: Graphic Administration [Seite 65]
    Procedure
    1.     To create a graphic node, call the context menu for that node in the tree structure that you want to contain the graphic and choose Create &#61614; Graphic.
    Create the graphic node as direct successor of the page node or use the context menu in the layout of the Form Painter. You can then position the graphic anywhere on the page.
    In the Form Painter the system displays a small box for the newly created node.
    2.     Enter a unique name for the node and a description (for example, company logo).
    3.     On the General Attributes tab determine whether you want to include a colored graphic or a graphic in black and white.
    4.     Use the fields Object, ID, and Name to identify the graphic. Use F4 help of the Name field to copy the values of these fields. If you copy them with ENTER, the system displays the graphic in the Form Painter.
    The box for the graphic in the Form Painter also contains the name of the graphic node, which in part overlays the graphic.
    5.     In the Technical Attributes box determine the graphic resolution according to what the printer supprts. Small resolutions increase the size of the graphic on the form, higher resolutions reduce the size.
    6.     For graphic nodes that are displayed in a window, there is a box Horizontal position in addition to the general output options [Seite 24]. The parameters Reference point and Alignment determine the horizontal position in the window, while the vertical position is determined by the previous output in the window.
    At present, you cannot overlay graphics with text. However, if you use a template node [Seite 33], you can display graphics and text side by side.
    Result
    The system displays the node with name and description in the tree structure. If you insert a graphic as direct successor of a page or if you used the Form Painter, the system displays the graphic. Graphics in windows are inserted only when the form is processed. You can therefore not see them in the Form Builder. In addition, the system automatically dispalys the graphic on the next page if there is not enough space left on the current page.
    Displaying a Static Table
    Use
    Use node type Template to display a table whose layout and size (number of lines and columns) is determined before the runtime of the print program.
    To create a template, define a table layout to determine the cell structure for each line. The cells are used to display the contents of the successor nodes of the template node. This allows you to position text and a graphic side by side (see Displaying Graphics in Templates [Seite 36]).
    The template node is also suited for label printing.
    Integration
    You can use system fields or your own fields &#61630; for example, to display the current date &#61630; in table cells (see also Using Parameters in the Form [Seite 37]).
    To display application data, use the table node. For this node type the number of table lines to be displayed is not known before the form is actually printed (the number depends on the volume of application data selected in the data retrieval program [Seite 38]).
    Prerequisites
    You can create a template node only as a successor to a window node. If you want to display the template in a particular area of the page, create a subwindow for it. Otherwise, use the main window.
    Features
    The node type displays a table layout [Seite 34]. You can either enter the table layout directly or use the Table Painter to define it.
    To set other attributes, use the attributes the node types share [Seite 24].
    Activities
    To use a template, you must:
    1.     Define the table layout [Seite 34].
    2.     Display contents in the table cells [Seite 35].
    Defining the Table Layout
    Use
    You use the table layout to determine:
    •     The number of lines and cells
    •     The height of each line
    •     The width of each cell
    •     The alignment of the table in the window
    •     Whether and where to display separator lines or frames
    Procedure
    Create a template node and maintain the attributes Width, Horizontal alignment, and Vertical alignment (See F1 help).
    Use the table control on the Template tab to define the layout of the lines. Each line of the template must have a definition. You can use one line in the table control to define either the layout of one template line or a common layout for several template lines:
    •     Use the columns From and To to specify the lines of your template, for which the definition applies. The numbering starts with 1. The intervals in the line definition may neither overlap nor leave gaps.
    •     The Height you specify applies for all cells of this line. Specify a Width for each cell you want to display. The sum of the width values must amount to the specified Width of the template.
    •     You can reuse the Name of the template line for other lines of the same template. Enter it in the Reference column of the desired lines. The system then copies the values you specified for the line height and the individual cell widths.
    Use the Pattern box to select the desired table pattern.
    Example
    You define the following lines in the table control (in the example without measurement units):
    Name     From     To     Reference     Height     1.     2.     3
    Line1_2     1     2          1     1     2     3
    Line3     3     3          2     2     2     2
    Line4     4     4     Line1_2     1     1     2     3
    You use the Pattern box to specify that all cells are separated by visible lines and that the template is framed.
    Result
    On the form, the template may look like this:
    Displaying Contents in Cells
    Use
    The template node defines the table layout [Seite 34]. The successor nodes of the template node determine the data to be displayed in the table cells.
    Prerequisites
    You already created a template node as successor of a window node and defined the table layout.
    Procedure
    1.     Use the context menu of the template node to create successor nodes.
    For clarity reasons create one folder node [Seite 36] for each line. The folder node is an outline node that you can use to combine related nodes. For folder nodes, you need not fill in the input fields in the Output structure box (see next step).
    2.     The Output options tabs of the inserted nodes now contain an additional box Output structure with the fields Line and Column. Assign each node to the cell in which you want the output to appear.
    You can assign several nodes to one cell. The output sequence within the cell is determined by the sequence of the nodes in the tree.
    Result
    The system displays the contents in the print preview or prints them, respectively.

  • Subt totals in smartform

    Hi
    How to make subtotals in SMARTFORMS?
    Regards
    Shashi

    Hi
    One can insert static and dynamic tables. These include the line feeds in the individual table cells, triggering events for table headings and subtotals and sorting data before output.
    Sub window-->Position text on one or more pages
    Main window-->Display text in relation to other nodes in the main window, it may cover several pages
    Template -->Displays texts for table cells of a static table
    Table-->Display table contents
    Header and footer-->Display column headings and grand totals in tables
    Event node-->Display subtotals in a table
    SF_EXAMPLE_02
    Similar to SF_EXAMPLE_01 but with subtotals
    Regards
    Pavan

  • Internal table and subtotals

    Hi,
    I want  to display report output like below .
    how can i bulid the internal table means can i hardcode the field1.
    how can i do the subtotals and totals i know the doing subtotals and totals in alv based on some field.
    field1                          field2           field3           field4
    Revenues
    product sales             100               1000           2000
    Contract revenue         200               4500          3000
    total Renues               300               5500          5000
    cost and expenses     
    Cost of sales               10000           5000          6000
    Selling  expenses         5000            2000          1000
    Research expenses      2000            2000          3000
    total expenses             17000           9000          10000
    total                             17300          14500         15000
    Please help regarding this,
    Regards,
    Suresh.

    check this example
    REPORT ZBLOCK_ALV.
    CONSTANTS :
      c_x VALUE 'X'.
    Macro definition
    DEFINE m_fieldcat.
      ls_fieldcat-fieldname = &1.
      ls_fieldcat-ref_tabname = &2.
      ls_fieldcat-tabname = &3.
      append ls_fieldcat to lt_fieldcat.
    END-OF-DEFINITION.
    DEFINE m_sort.
      ls_sort-fieldname = &1.
      ls_sort-up        = c_x.
      append ls_sort to lt_sort.
    END-OF-DEFINITION.
    TYPE-POOLS: slis.                      " ALV Global types
    TYPES:
    1st Table
      BEGIN OF ty_kna1,
        kunnr TYPE kna1-kunnr,             " Customer number
        ernam TYPE kna1-ernam,             " Name of Person who Created
        erdat TYPE kna1-erdat,             " Creation date
        name1 TYPE kna1-name1,             " Name 1                    .
      END OF ty_kna1,
    2nd Table
      BEGIN OF ty_mara,
        matnr TYPE mara-matnr,             " Material number
        ernam TYPE mara-ernam,             " Name of Person who Created
        ersda TYPE mara-ersda,             " Creation date
        mtart TYPE mara-mtart,             " Material type
        matkl TYPE mara-matkl,             " Material group
      END OF ty_mara,
    3rd Table
      BEGIN OF ty_vbak,
        vbeln TYPE vbak-vbeln,             " Sales document
        vkorg TYPE vbak-vkorg,             " Sales organization
        vtweg TYPE vbak-vtweg,             " Distribution channel
        kunnr TYPE vbak-kunnr,             " Sold-to party
        erdat TYPE vbak-erdat,             " Creation date
      END OF ty_vbak.
    DATA:
      gs_layout TYPE slis_layout_alv,
      gt_kna1 TYPE TABLE OF ty_kna1,
      gt_mara TYPE TABLE OF ty_mara,
      gt_vbak TYPE TABLE OF ty_vbak.
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.    "#EC NEEDED
    PARAMETERS p_max(2) TYPE n DEFAULT '02' OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    INITIALIZATION.
      v_1 = 'Maximum of records to read'.
    START-OF-SELECTION.
    Read data
      SELECT kunnr ernam erdat name1
        FROM kna1
       UP TO p_max ROWS
        INTO TABLE gt_kna1.
      SELECT matnr ernam ersda mtart matkl
        FROM mara
       UP TO p_max ROWS
        INTO TABLE gt_mara.
      SELECT vbeln vkorg vtweg kunnr erdat
        FROM vbak
       UP TO p_max ROWS
        INTO TABLE gt_vbak.
    END-OF-SELECTION.
      PERFORM f_display_data.
          FORM USER_COMMAND                                             *
    FORM user_command USING u_ucomm     TYPE sy-ucomm
                            us_selfield TYPE slis_selfield.     "#EC CALLED
      DATA:
        ls_vbak TYPE ty_vbak.
      CASE u_ucomm.
        WHEN '&IC1'.                       " Pick
          CASE us_selfield-tabname.
            WHEN 'GT_MARA'.
            WHEN 'GT_KNA1'.
            WHEN 'GT_VBAK'.
              READ TABLE gt_vbak INDEX us_selfield-tabindex INTO ls_vbak.
              IF sy-subrc EQ 0.
                SET PARAMETER ID 'AUN' FIELD ls_vbak-vbeln.
                CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
              ENDIF.
          ENDCASE.
      ENDCASE.
    ENDFORM.                               " USER_COMMAND
          Form  f_display_data
    FORM f_display_data.
      DATA :
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog
        ls_sort     TYPE slis_sortinfo_alv,
        lt_sort     TYPE slis_t_sortinfo_alv, " Sort table
        lt_events   TYPE slis_t_event,
        ls_event    TYPE slis_alv_event.
      gs_layout-group_change_edit = c_x.
      gs_layout-colwidth_optimize = c_x.
      gs_layout-zebra             = c_x.
      gs_layout-detail_popup      = c_x.
      gs_layout-get_selinfos      = c_x.
    Build field catalog and sort table
      m_fieldcat  'KUNNR' 'KNA1' 'GT_KNA1'.
      m_fieldcat  'ERNAM' 'KNA1' 'GT_KNA1'.
      m_fieldcat  'ERDAT' 'KNA1' 'GT_KNA1'.
      m_fieldcat  'NAME1' 'KNA1' 'GT_KNA1'.
      m_sort  'KUNNR'.
    Build Event Table
      MOVE        'TOP_OF_PAGE'        TO ls_event-name.
      MOVE        'TOP_OF_PAGE'        TO ls_event-form.
      APPEND ls_event TO lt_events.
      MOVE        'END_OF_LIST'        TO ls_event-name.
      MOVE        'END_OF_LIST'        TO ls_event-form.
      APPEND ls_event TO lt_events.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program      = sy-cprog
          i_callback_user_command = 'USER_COMMAND'
          it_fieldcat             = lt_fieldcat
          is_layout               = gs_layout
          it_events               = lt_events
          it_sort                 = lt_sort
          i_save                  = 'A'
        TABLES
          t_outtab                = gt_kna1.
    ENDFORM.                               " F_DISPLAY_DATA
          FORM top_of_page                                              *
    FORM top_of_page.                                           "#EC CALLED
      ULINE.
      WRITE : sy-uname, sy-title(56) CENTERED, sy-datum.
      ULINE.
    ENDFORM.                               " TOP_OF_PAGE
          FORM End_of_list                                              *
    FORM end_of_list.                                           "#EC CALLED
      DATA :
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog
        ls_sort     TYPE slis_sortinfo_alv,
        lt_sort     TYPE slis_t_sortinfo_alv, " Sort table
        lt_events   TYPE slis_t_event,
        ls_event    TYPE slis_alv_event.
    Build field catalog and sort table
      m_fieldcat 'MATNR' 'MARA' 'GT_MARA'.
      m_fieldcat 'ERNAM' 'MARA' 'GT_MARA'.
      m_fieldcat 'ERSDA' 'MARA' 'GT_MARA'.
      m_fieldcat 'MTART' 'MARA' 'GT_MARA'.
      m_fieldcat 'MATKL' 'MARA' 'GT_MARA'.
      m_sort 'MATNR'.
    Build Event Table
      MOVE 'END_OF_LIST'   TO ls_event-name.
      MOVE 'END_OF_LIST_2' TO ls_event-form.
      APPEND ls_event TO lt_events.
      gs_layout-list_append = c_x.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = sy-cprog
          it_fieldcat        = lt_fieldcat
          is_layout          = gs_layout
          it_sort            = lt_sort
          it_events          = lt_events
          i_save             = 'A'
        TABLES
          t_outtab           = gt_mara.
    ENDFORM.                               " END_OF_LIST
          FORM End_of_list_2                                            *
    FORM end_of_list_2.                                         "#EC CALLED
      DATA :
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog
        ls_sort     TYPE slis_sortinfo_alv,
        lt_sort     TYPE slis_t_sortinfo_alv, " Sort table
        lt_events   TYPE slis_t_event,
        ls_event    TYPE slis_alv_event.
    Build field catalog and sort table
      m_fieldcat 'VBELN' 'VBAK' 'GT_VBAK'.
      m_fieldcat 'VKORG' 'VBAK' 'GT_VBAK'.
      m_fieldcat 'VTWEG' 'VBAK' 'GT_VBAK'.
      m_fieldcat 'KUNNR' 'VBAK' 'GT_VBAK'.
      m_fieldcat 'ERDAT' 'VBAK' 'GT_VBAK'.
      m_sort 'VBELN'.
    Build Event Table
      MOVE 'TOP_OF_PAGE' TO ls_event-name.
      MOVE 'TOP_OF_PAGE' TO ls_event-form.
      APPEND ls_event TO lt_events.
      gs_layout-list_append = c_x.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = sy-cprog
          it_fieldcat        = lt_fieldcat
          is_layout          = gs_layout
          it_sort            = lt_sort
          it_events          = lt_events
          i_save             = 'A'
        TABLES
          t_outtab           = gt_vbak.
    ENDFORM.                               " END_OF_LIST_2

Maybe you are looking for

  • SSO to a jspx af:inputText ?

    Hi people, The admin of our collaborative portal doesn't know if it is possible to make a link to our ADF 11.1.1.2.0 application using the internal SSO, knowing that the login page is a jspx with af:inputText. So I'm asking here, if anyone wants to s

  • Iphone 4s not getting all email from 2 out of 3 accounts

    I have an I phone 4S and have two POP3 accounts and a gmail account set up.the two POP 3 accounts have suddenly stopped pushing all of the received emails to the iphone. I used to receive them on the phone and computer at the same time. Last two days

  • How do I get my podcast's html from iWeb?

    I have a podcast here: http://web.me.com/krushjudgement/Site/Giant-SizePodcast/Giant-SizePodcast.html I'd like to allow people to stream it directly from my blog even if they don't have iTunes. I was thinking of using Google's media player. But how d

  • Creating a Back/ Previous button

    Hello, I have a VBA program which includes Userforms with 'next' and 'back' buttons. Some of the 'Next' buttons from different Userforms take the User to the same Userform, so my problem is how do I get the back buttons to take the user back to the f

  • Importing DVD video (burned by iDVD) back to editable format

    Is this possible? I burned a DVD of some video footage (so that I don't waste HD space with a large video file)--I cannot seem to import it with iMovieHD for editing or further manipulation.