Documente Academic
Documente Profesional
Documente Cultură
Smart form is a GUI Tool which is used to design the business legal documents such as
Delivery note,Purchase order,Invoice etc.
The transaction code is SMARTFORMS.
Smartforms are client independent objects.
Smartforms are advanced version of SAP Scripts.
It is a GUI tool and it is user friendly.
Smartform architecture:
SAP Scripts
Smartforms
SAP Scripts
No Function Module w
generated.
There is no transfer of control between program and form, once the control is transfered
to Function Module, it will never come back.
COMPONENTS OF SMARTFORMS.
There are two main nodes in Smartforms.
1.Global Settings
Form Attribute.
Form Interface.
Global Definition.
Global settings:
It is used to provide the basic settings for the smartform.
Form Attributes:
It specifies the general attributes like who created,Date,time, package,translate options, default
smartstyle, Page format (DINA4/DINA5).
Form interface:
It acts as a mediator between a driver program and a smart form.
The main functionality of form interface is, it will import the parameters which are exported by
driver program.
The parameters can be variables, work areas, internal tables..etc.
Global definition:
It will contain the variables to be used within the smart form.
We can define variables, user defined data types, field symbols, initialization code,Subroutine,
currency/quantity fields.
It is mainly used for declaring or defining the above variables.
Page.
Window.
Graphic.
Address.
Text.
Table.
o Header.
o Body.
o Footer.
Template.
Folder.
Program Lines.
Alternative.
Command.
Loop.
Just provide address no, it will automatically display the address as per the country formats.
Expand page, right click on min window -> create -> Text.
Whenever we activate a smartfrom, one function module will be generated, when we execute it, it
will go to function module.
Double click on global definitions, go to types tab and add below code.
types: BEGIN OF ty_mara,
matnr type mara-matnr,
mbrsh type mara-mbrsh,
mtart type mara-mtart,
matkl type mara-matkl,
meins type mara-meins,
END OF ty_mara.
Go to initialization tab, add output parameter as wa_mara, add below code to get material
details.
select SINGLE * FROM mara
into CORRESPONDING FIELDS OF wa_mara
WHERE matnr = '000002-000'.
**Material no must be in MARA
Expand page, double click on main window, right click on main window -> create -> text.
Smartform is displayed.
Go to initialization tab, add output parameter as IT_MARA and add below code get materials.
Expand page, right click on main window -> create -> table.
Whenever we create a table, header, main area, footer for the table will be created automatically.
Now we need to draw columns, we know smartforms is a GUI designer, we need to design table
columns, to create table columns go to table tab, click on pencil icon and draw five vertical lines(
no of lines = internal table fields).
Right click on each cell, create -> text to create column headers.
Click on insert icon, a popup will come and provide variable as &wa_mara-matnr&, enter.
Similarly create text for all cells and insert respective variables as below.
&wa_mara-mbrsh&
&wa_mara-mtart&
&wa_mara-matkl&
&wa_mara-meins&
Double click on table, go to tab data and loop internal table as below.
Double click on global definitions, go to types tab and add below code.
types: BEGIN OF ty_mara,
matnr type mara-matnr,
mtart type mara-mtart,
meins type mara-meins,
end of ty_mara.
Double click on main window, right click -> create -> flow logic -> loop.
Add internal table IT_MARA and work area WA_MARA as looping parameters.