Smartfrom Creation
Smartfrom Creation
Smartform – Practical 3
Step 1: Go to t-code “SMARTFORMS” enter the form name and click on
Create.
Step 3: Double click on Page and change the name of the page. Now Right-
click on the main window: Create -> Graphic.
Step 4: Double click on Graphics and change the name as shown below. In
General, in Attributes, enter the name of the graphic you want to use (or use
search help to choose from the repository).
In Technical Attribute, give the size of the logo.
Step 5: Now in form painter move the logo to the appropriate position on the
page where ever you want to display it.
Step 6: Save and activate the Smartform.
Step 9: Another screen will open and click on the Execute button.
Step 10: A new pop-up will display, give the OutputDevice name and click on
the Print Preview button.
OUTPUT
Step 3: Double click on Page and change the name of the page. Now Right
click on PAGE_1: Create -> Window.
Step 4: Double click on the window and change the name to “HEADER” and
give the meaning also.
Step 5: Click on Form Painter and adjust the “HEADER” Window according
to your need.
Step 6: Double click on Header Window and Right click on it: Create ->
Template.
Step 7: Now double click on Template and right-click on it: Create -> Text.
Step 10: Double click on the “HEADER” Window and right-click on it: Create
-> Graphic.
Step 11: Double click on it and change the name of the graphic and provide a
meaningful description. In the “General Attribute” tab choose the name of the
logo and give Resolution in Technical Attributes.
Step 12: Double click on Main Window and Create -> Table. (Go to
zsmartform002)
Step 13: Save and activate the Smartform.
Step 16: A new pop-up will display, give the Output Device name and click on
the Print Preview button.
OUTPUT
Create Smartform Footer in SAP-
Practical 5
Step 3: Double click on Page and change the name of the page. Now Right-
click on PAGE_1: Create -> Window.
Step 4: Double click on the window and change the name to “FOOTER” and
give the meaning also.
Click on Form Painter and adjust the “FOOTER” Window according to the
need.
Step 5: Double click on Footer Window and Right-click on it: Create ->
Template.
Step 7: Now double-click on Template and right-click on it: Create -> Text.
Step 8: Double-click on the text and change the name of the text and write the
text in it.
Step 9: Now in “Output Options” under the Output Structure enter which row
and column you want to display this text.
Step 10: Create another text, change the name and give a description and enter
the text to display.
Step 11: Again now in “Output Options” under the Output Structure enter
which row and column you want to display this text.
OUTPUT
Step 4: Now click on the Types tab and create a user-defined structure of table
VBAP.
Step 5: Now double click on Page and change the Page name and description.
Right-click on Main Window and create a table.
Step 6: Double click on the table. Change the name of the table and
description. Click on the Pencil icon and draw a number of columns in %C1.
Step 9: After adjusting columns click on the Table Painter button to come back.
Now click on the button “Select Pattern..”.
Step 10: A pop-up will display and select a pattern of the template without the
border if you want to select a pattern with a border click on Display Framed
Pattern.
Step 11: Four Columns are created below. Notice the name of the line as
“%LTYPE1”, you can rename of line type by right-clicking – > Rename. But
for now, we are not changing it as we are using only 1 Line now.
Now click on Data Tab.
Step 12: In-Loop assign internal table and work area which were declared
above.
Step 13: Now right-click on Header under Table element and create table line.
Step 14: Provide Line name and Line Heading as below. Give Line Type as the
name of the line you gave while creating columns and press Enter, a number of
columns will be displayed uniquely.
Step 15: Now you can rename it by double click on each column. Enter the text
by: Right-click -> Create -> Text.
Step 16: Write the Column heading in Editor and save. Do the same process for
every column under Heading.
Step 17: Double click on Text and change its name and description and write
the text in the Editor. Do the same thing and create four more texts under every
column.
Step 18: Now Create the Table line in Main Area. Do the same as Heading.
Step 19: Now double click on each column and rename it. Enter the text by:
Right-click -> Create -> Text. Do this for every column.
Step 20: Change the name and description of the Text. Click on the Insert Field
button to enter the variable on the page.
Step 21: Enter the Work area and field as given below. Do the same step for the
other 4 columns.
Step 22: Click on Save button and activate the Smartform. Click on the
Test button.
Step 23: On the next screen again click on Test Button.
Step 25: On the next screen, give the Output Device name and click on the
Print Preview button.
OUTPUT
Step 3: Now double click on Global Definitions on the left panel, click on
Global Data Tab and enter the variable names with their respective types.
Step 4: Now click on the Types tab and create a user-defined structure of table
VBAP.
Step 5: Now double click on Page and change the Page name and description.
Step 6: Click on the down arrow beside the Page folder, Main Window will
show. Right-click on Main Window: Create -> Template.
Step 7: Double click on the template. Change the name of the template and
description. Click on Pencil icon and draw the number of columns in %C1.
Step 8: After creating the number of columns, click on the Details button.
Step 9: Now here adjust the height and width of the column according to your
convenience.
Step 10: After adjusting columns click on the Table Painter button to come
back. Now click on the button “Select Pattern..”.
Step 11: A pop-up will display and select a pattern of the template without the
border if you want to select a pattern with a border click on Display Framed
Pattern.
Step 14: Now click on the Output Options tab and set the position of the text by
allotting column numbers and row numbers under Output Structure.
Step 15: Right click on Main Window: Create -> Flow Logic -> Program
Lines.
Now double click on Program Lines and change the name and description of
program lines
and enter the SQL code to fetch the data.
Step 16: Right click on Main Window: Create -> Flow Logic ->Loop.
Double click on Loop and change the name and description of it and Loop the
internal table: IT_VBAP into work area: WA_VBAP.
Step 17: Now right-click on Loop: Create -> Template. Change the name and
description of the template as before.
Step 18: Select the Pencil icon and create 5 columns as before for displaying
the data here.
Step 19: Click on Details and set the height and width of the columns.
Step 20: Now Right-click on Template: Create -> Text. Change the name and
description of the Text. Click on the Insert Field button to enter the variable on
the page.
Step 21: Enter the Work area and field as given below. Do the same step for the
other 4 columns.
Step 22: Save and activate the Smartform. Click on the Test button.
Step 23: A new screen will open and again click on Test Button.
Step 4: Now click on the Types tab and create a user-defined structure as
below.
Step 5: Now double click on Page and change the Page name and description.
Step 6: Click on the down arrow beside the Page folder, Main Window will
show. Right-click on Main Window: Create -> Template.
Step 7: Double click on the template. Change the name of the template and
description. Click on the Pencil icon and draw a number of columns in %C1.
Step 10: After adjusting columns click on the Table Painter button to come
back. Now click on the button “Select Pattern..”.
Step 11: A pop-up will display and select a pattern of the template without the
border if you want to select a pattern with a border click on Display Framed
Pattern.
Step 12: Right click on Template: Create -> Text(As created below).
Step 13: Double click on Text and change its name and description and write
the text in the Editor.
Do the same thing and create four more texts under the same template.
Step 14: Now click on the Output Options tab and set the position of the text by
allotting column numbers and row numbers under Output Structure.
Step 15: Right click on Main Window: Create -> Flow Logic -> Program
Lines.
Now double click on Program Lines and change the name and description of
program lines
and enter the SQL code to fetch the data. (As created below already)
Step 16: Right-click on Main Window: Create -> Flow Logic ->Loop. (As
created below already). Double click on Loop and change the name and
description of it and Loop the internal table: IT_VBAP into work area:
WA_VBAP.
Step 17: Now right-click on Loop: Create -> Template. Change the name and
description of the template as before.
Step 18: Select the Pencil icon and create 5 columns as before for displaying
the data here.
Step 19: Click on Details and set the height and width of the columns.
Step 20: Now Right-click on Template: Create -> Text. Change the name and
description of the Text. Click on the Insert Field button to enter the variable on
the page.
Step 21: Enter the Work area and field as given below. Do the same step for the
other 4 columns.
STEP 23: Now go to SE38, Write the name of the program and click on source
code and create.
STEP 24: A pop-up will display, write the title of the program and select
‘Executable Type’ as Type under Attributes.