Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Diffrence between Table and Template In Smartform

Former Member
0 Kudos

Hi,

Please could u tel me Difference between Table and Template In Smartform

6 REPLIES 6

Former Member

If u put template in LOOP then it works same as table...in simple lanugage

Table = Loop + Template....

Reward points if useful....

Former Member
0 Kudos

Table exteds dynamically.

Template is fixed in size.

template is Output of a table containing static data

these are the Possible direct successors-All except window, page, table,

and template nodes

Table - Output of a table containing application

data and these are the Possible direct successors-as with template node

Template is used for proper allignment of data which table is used for displaying multiple data.

We can say Template is for static data and Table is for dynamic data.

Suppose we have a requirement in which we have to allign the customer address in such a way as shown below:-

Name- Krishna Company- WIPRO Location- Chennai

Desig- S/W Native - Mumbai

Then for proper allighnment we can create a template and split that into 3 columns and 2 rows and create text elements for each cell display a proper allighned data at the output.

When we include a template inside a loop it gives the same property as a table.

When we have mutiple data which is to be extended to the next page like when we display all employee details in a company we use table.

Table has 3 sections , HEADER, ITEM ,FOOTER

The header secntion will be executed once and it will loop at the item level. at the end footer will be executed.

SmartForms Useful links

http://www.sapgenie.com/abap/smartforms.htm

http://www.sap-img.com/smartforms/sap-smart-forms.htm

http://help.sap.com/saphelp_46c/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm

http://help.sap.com/printdocu/core/Print46c/en/Data/htm/english.htm

http://www.sap-img.com/smartforms/smart-001.htm

http://www.sap-img.com/smartforms/smartform-tutorial.htm

http://www.sap-img.com/smartforms/smart-002.htm

http://www.sapgenie.com/abap/smartforms.htm

http://www.sap-img.com/smartforms/sap-smart-forms.htm

Former Member
0 Kudos

Check page 8 of this PDF.

http://help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF

and

Template Displays texts for table cells of a static table

Table Display table contents

and also

when you define a table, in fact you define row type.

After that, you use a row type with data.

when you define a template, you have the whole struture in statitc.

Example: you have items, but for some item, you would like to print text. The row type will be different, you don't know the size (number of line) of your text. So you can only use the table.

Reward Points if useful.

Former Member
0 Kudos

hi deepak,

template:

Use node type template to display a table whose layout and size 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 cell structure for each line. The cells are used to display the contents of the successor nodes of the

template node.

· Create Template under the INFO window node. Create > Template.

The template layout is used to determine the following,

1. The number of lines and cells

2. The height of each cell

3. The width of each cell

4. The alignment of the table in the window

5. Whether and where to display separator lines or frames

Use the table control on the template tab to define the layout of the lines. Each line of the template must have

a definition.

Use the pattern box to select the desired table pattern.

·

Displaying contents in cells: (TLE_CONTACT)

The template node defines the table layout. The successor nodes of the template determine the data to be

displayed in the table cells.

In General Attributes choose Text type – Text Element. In editor, type ‘DTE Contact’.

In Output Options, define the output structure LINE – 5 and Column – 1.

Similarly all other information for each cell can be filed using the text module and address module.

table:

to Displaying Dynamic Table (ITEM_TABLE)

· Create TABLE under the MAIN window node. In DATA Tab, loop through the data internal table.

L_XEKPO is the item table which has all the line item details.

Define the line types based on the positioning of the text in main window. For example: TABLE_HEADER1

is used for positioning Header texts in the table.

· Table is divided into three parts: Header, Main Area and Footer.

· Header is used for printing the Header Title of the table and it at the start of the table on every page.

· Main Area is used to print the line item details of the PO. Create a line (ITEM_DETAIL) of the line type

TABLE_HEADER1. It will dynamically generate number cells based on the line type defined in the table layout.

Name all the cells as per the usage. For each cell create the text node to display the information. For example:

Cell VAL_MATERIAL, Text node MATNR is created which has text element - -matnr.

· Footer is used for printing the information after Main Area data is printed. This can be used for Total

printing or any other information which needs to be printed after all line items are printed. Create line

TLE_CONTR_STP for Contractual Stipulation of the line type – LINE which has only one column. Create the

text element to print the information.

hope this can help u. reward if helpful.

Former Member
0 Kudos

Deepak,

Template : Fixed no. of records can display

Ex: Suppose you have created 10 rows in

template you can add only 10 records.

Tables : no. of rows will get increased based on

requirement.

conclusion: If you know the out put with constant data go for template else table.

prabhu_04
Explorer

Table:

  • Table is extends Dynamically.
  • Table is used to displaying Multiple data.
  • Table is Dynamic.
  • Table can have variable row and column.

Template:

  • Template is fixed Size.
  • Template is used for proper alignment of Data.
  • Template is Static.
  • A Template have fixed number of Row and Column.