Smartform Form Layout Creation TCode - SMARTFORMS PDF
Smartform Form Layout Creation TCode - SMARTFORMS PDF
Smartform Form Layout Creation TCode - SMARTFORMS PDF
2) Form Interface: In this tab parameter details are provided, Import, Export parameters.
Import Parameter: Developer need to provide parameters which will be output of driver
program. Same parameters will be used for creating Smartforms.
Export Parameters: We need to provide export parameters. Normally we dont need to provide
export parameters as it is used for print or output purpose.
Table : Need to provide internal tables which need to be used , associated type should be
defined in SE11 Table Defination . As in smartforms , only TYPE option is available for
type assignments.
3) Global Definition : In this developer need to define all the variables , work area and Internal
table , Local structure definitions , Field symbols, currency/ Quan fields which will be used in
smartforms.
- Global Data : Developer need to add all the variable , work area and Internal table. Note
for internal table associated type should be defined as Table type in SE11.
Initialization : In this tab, developer need to write global code which can be used to work on the
data transferred from Driver program.
Input Parameters : Need to define all the input parameters required to execute code.
Output Parameters : Need to define all the output parameters required to execute code. Code need
to be written in text area , as per below screen shot.
Currency/Quant Fields : Need to define all the currency / Quantity fields to be used in this
smartforms.
B) Pages and Windows (Layout creation): In this section developer can design Smartforms as
per business needs. We can create Pages, Windows, Graphics and Address fields.
There are four types of window that can be created:
Main Window: It contains all the information which we need to display. Most of the times
Data is dynamic in main window. We can define only one Main window in a page. We can
create: Text, Table, Template, Flow Logic, Address window, Graphics, Address.
Graphics Section: As per business requirements user can assign image in graphics section. Normally
this used to display company logo or plant address (to reduce the
space)
Address: Smartforms gives the option of giving the address number which is maintained in the
central address management. The address will be directly taken from ADRC table and will be
populated
form.
in
the
Table Painter: In Table painter, you can draw the format as per client requirement (e.g. Heading,
Sub Heading, Item, Sub Total, Grand Total etc.). In simple words Table = Loop + Template
you can use the table layout to determine:
The Table shows the different line types which will be used in the table. The Line types define the
size of each cell and the number of cells in each line.
Table has 3 sections, HEADER, ITEM, FOOTER the header section will be executed once and it
will loop at the item level, and at the end footer will be executed.
ails
Sections in table:
- Table: In this section line type is defined. which will be used while defining sections in
Header , Main area and Footer. Details > Field details section
- Data: In this developer need to provide details of Internal Table and Work area
We need to add Row for Header , Main Area and Footer Area.
In each section we need to provide Line type which need to be displayed in
Template:
Template is a predefined format which you can design in the smartform like a ruled note
book.Developer can graphically create no of rows and columns u want
it is static
For putting any value in that u have to create text under the template and mention the position
where the text will appear.
In Text we can define in which that data to be displayed. Text > Output Options > Output
Structure > Line and Columns
Main Area: This section is updated dynamically as per the data fetched from database. Values in
main area are dynamic.
Footer Section :This section normally used to display total values , total values or number of line
items. We can add conditions in all the windows, if condition is satisfied then this section will be
displayed or it will not be displayed. Similar to IF ... END IF Condition.
Secondary Window: Size of secondary window is always fixed. If data extends beyond the size of
secondary window then it will be truncated. Normally Secondary window section is used to display
address, final total, company logo or T&Cs.
Final Window: Developer cannot add any other window after final window is defined on that page.
&SFSY-EXCEPTION&
Contains the name of the raised exception. You must trigger your ownexceptions, which you defined
in the form interface, using the user_exception macro
Flow Logic
Alternative : In Alternative, we will give some condition. if the condition is true, only the elements within
true node will be executed if its false only the elements within false node will be executed..
Example :
After creating Alternative your form will look like this
In General Attributes of the alternate give condition COUNTRY = 'IN' as shown below
Right Click on True and create text and write some text in that, likewise create text and write something for
false condition also. Now our screen will appear as shown below
(In this case I have written Alternate Condtion True Country is India for the text in true condition and
Alternate Condtion True Country is India for text in false condition)
Loop : Loop can be used in any window , it is not limited to Main Window alone. Give a descriptive
name to the Loop Description text area.
On the Data tab of the Smartform Loop element, define the loop for each IT_VBAK row as follows.
On every turn of the defined loop, move each loop item into GS_VBAK vbak globalstructureor VBAK
work area item.
Also set the Row range from 1 to a logical number for example 9999, etc.
Now we willcreatea data section which will show the SAP sales document number and the detail
items of the VBAK row which maps to SAP VBAP records of the related VBAK header data.
First of all, we willcreatea text element under the Loop element node.
This text element will display the VBELN sales document number for each record of it_vbak selected
in the loop.
Then we will add a table element in order to display the items of the loop item.
The last Smartform element which we willcreateon this Smartforms example document is Command
element.
We will use the Command element in order to set page break between two vbak header records.
Below is the screenshot that the SAP Smartform elements of this example Smartforms.
Note that the descriptions of the Smartforms elements are given due to their respective tasks.
Program Lines: In this section developer has to write program lines as per business requirements.
Developer has to provide input parameters and output parameters, as this fields are mandatory.
Developers have to write comparison value field and value in condition tab.