0% found this document useful (0 votes)
15 views

SAP Abap Smartforms Questions

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

SAP Abap Smartforms Questions

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Sap

Abap
Smartforms
( T.code - SMARTFORMS )

Questions
Sonu Jangir Abap Developer

Documents Prepared By Sonu Jangir Sap Abap


What is SmartForms in SAP?
SmartForms is a tool in SAP that enables the crea on of forma ed and
interac ve forms. It is used to design and develop various types of business
forms such as purchase orders, invoices, delivery notes, and more. SmartForms
offers extensive design op ons, including tables, graphics, and text elements,
making it highly flexible and customizable.

What are the advantages of using SmartForms over


SAPScript?
SmartForms offers several advantages over SAPScript, including:
 WYSIWYG (What You See Is What You Get) editor for easier form design.
 Enhanced graphical capabili es for be er form layout and forma ng.
 Simplified and intui ve form crea on process.
 Integra on with SAP systems, allowing easy data retrieval and mapping.
 Reusability of form components for faster development and
maintenance.

How do you create a SmartForm?


To create a SmartForm, follow these steps:
 Launch the SmartForm transac on (e.g., transac on code
SMARTFORMS).
 Create a new SmartForm object or select an exis ng one.
 Design the form layout using drag-and-drop func onality.
 Add text elements, graphics, tables, and other components as required.
 Define the form interface and data structure.

Documents Prepared By Sonu Jangir Sap Abap


 Test and preview the form.
 Save and ac vate the SmartForm.

What is a SmartStyle in SmartForms?


A SmartStyle is a forma ng template in SmartForms that defines the
appearance and layout of a form. It includes a ributes such as font styles,
colors, paragraph forma ng, borders, and shading. SmartStyles help maintain
consistent forma ng across mul ple forms and allow easy updates when
design changes are required.

How can you integrate SmartForms with SAP applica ons?


SmartForms can be integrated with SAP applica ons through the use of print
programs and func on modules. The print program fetches the required data
from the SAP system and passes it to the SmartForm for processing. Func on
modules are used to call the SmartForm and trigger the prin ng process.
Integra on is achieved by defining appropriate interfaces and mapping the
data fields between the print program and the SmartForm.

What are the different output op ons available in


SmartForms?
SmartForms supports various output op ons, including:
 Print: Generate a printout of the form.
 PDF: Generate a PDF file of the form.
 Email: Send the form as an a achment via email.
 Fax: Send the form to a fax machine.
 Archive: Store the form in an archive system.

How do you debug SmartForms?


Debugging SmartForms involves se ng breakpoints in the associated print
program or func on module. You can then execute the program or func on
module in debug mode. While debugging, you can analyze the data flow, check

Documents Prepared By Sonu Jangir Sap Abap


variable values, and iden fy any errors or issues within the SmartForm
processing.

How can you handle mul ple-page forms in SmartForms?


To handle mul ple-page forms, you can use the “Page Windows” feature in
SmartForms. This feature allows you to define different page windows for
various sec ons of the form. By using page windows, you can control the
content placement and pagina on of the form based on the available space
and data requirements.

How do you transport a SmartForm from one SAP system to


another?
SmartForms can be transported from one SAP system to another using the
Transport Management System (TMS). You need to create a transport request
that includes the SmartForm object and its associated components, such as
print programs and func on modules. The transport request can then be
released and imported into the target system.

How do you op mize the performance of SmartForms?


To op mize SmartForms performance, you can follow these best prac ces:
 Use data retrieval efficiently by minimizing unnecessary database calls.
 Limit the number of nodes in loops and condi ons to reduce processing
me.
 Use appropriate table and loop structures to op mize data processing.
 Avoid complex calcula ons and formulas within the SmartForm.
 U lize caching op ons for frequently used data.

What is SAP Smar orm?


Smart Forms are prin ng forms used to print Invoice and purchase order forms
etc. We are calling smar orms from ABAP programs then spools are
generated, now smar orm ready to be printed.

Documents Prepared By Sonu Jangir Sap Abap


SMARTFORMS is the transac on to design the smart form layout.
SMARTSTYLES are used to define paragraph and character formats (fonts,
barcodes, etc.)

What are the differences between SAP Scripts and


Smar orms?
SAP Scripts are client dependent whereas Smar orms are client independent.
SAP Scripts require a driver program to display the output whereas in
smar orms the form rou nes can be wri en so that it is standalone.
An Table Painter and Smartstyles to assist in building up the smar orms
An integrated Form Builder helps to design Smar orms more easily than SAP
Scripts
It is possible to create a Smar orm without a main window
Func on module is generated for Smar orms when we are ac va ng it.
Mul ple page formats is possible in smar orms.

I have a smar orm which works fine in development server.


A er trasnspor ng it to Produc on, there is no Func on
module generated for this smar orm. Due to that my
program dumps in Produc on? How to solve this?
The Smar orm that is created in the Development may not have the same
name in the Produc on server. So it is always advised to use the Func on
Module SSF_FUNCTION_MODULE_NAME to get the Func on Module name by
passing the Smar orm name.
DATA: fm_name TYPE rs38l_fnam.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSMARTFORM'

Documents Prepared By Sonu Jangir Sap Abap


IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_func on_module = 2
CALL FUNCTION fm_name
EXCEPTIONS
forma ng_error = 1
internal_error = 2
send_error = 3
ENDIF.
How can you make the Smar orms to choose a printer name by default?
In the CALL FUNCTION of the Smar orm Func on Module, set the output
op ons parameter to set the printer name.
The output op ons is of the type SSFCOMPOP which contains the field TDDEST.
Set the TDDEST field to your default printer name.

Where can I provide the input parameters to the


smar orm?
The input parameters for the smar orm can be defined in Global Se ngs-
>Form Interface.
The Associated Type must be defined in the ABAP Dic onary.

Where do you Configure the Adobe Forms / Smart forms /


SAP Script to the output type in NACE?
Go to transac on NACE.

Documents Prepared By Sonu Jangir Sap Abap


Choose the required applica on from the list and click on output types.
Chose one of the Output types from the right pane and click on processing
rou nes.
If an SAP Script to be a ached, fill-in the driver program name, Form rou ne
and SAP Script name in the field “Form” (shown below)”
If an Smart Form / Adobe Form are to be a ached, enter the form name in the
field “PDF/SmartForm Form” and select one of the types “PDF” or
“SmartForm”. (See the screenshot below)

Q6. How can I insert symbols in Smar orms?


Select the Text node.
Change Editor
Go to menu Include->Characters->SAP Symbols
Choose the SAP symbol that you want to insert.

Where can I define my own global types for the smar orm?
The global types can be defined in Global Se ngs->Global Defini ons->Types
The types defined here will be global through the en re smar orm.
Also the form rou nes can be defined Global Se ngs->Global Defini ons-
>Form Rou nes

I have defined my own Program Lines, where I have used a


global variable G_TEXT. I get an error G_TEXT is not defined?
Whenever using the global variables in the Program Lines, enter the variable
name in Input Parameters if you are going to use(read) the variable. If you are
going to both read/write the variable value enter the same in Output
Parameters.

I have created a table node for display. Where can I check


the condi on which must sa sfy to display the table?

Documents Prepared By Sonu Jangir Sap Abap


The condi ons can be defined in the Condi ons tab. In smar orms all the
nodes have a condi on tab where you can specify the condi on to be sa sfied
to access the node.

How can I define Page Protect in Smar orms?


Ans: To define Page Protect for a node go to the Output op ons and check the
Page Protec on checkbox.

If SAP R/3 system has 2 clients 300& 302. You create an SAP
Script Z_Script and a Smar orm Z_Smar orm in client 300.
Will both Z_Script and Z_Smar orm be available in client
302 as well?
Client 800 will have just the Smar orm Z_Smar orm and
not the SAP Script Z_Script.
SAP-Script is client dependent whereas SMARTFORM is client independent.

How do you convert a Smar orm Output to PDF output?


The following two func on modules and their impor ng/expor ng
parameters:
CONVERT_OTF
CONVERT_OTF_2_PDF
In the Driver program, import the parameter 'job_output_info' from the
Smar orm FM and u lize that info in 'OTF' parameter of the two
aforemen oned func on modules.

How can you see the Smar orm Print Preview output as list
output?
Type SLIS in the command prompt and hit enter.

How do you achieve Bar Code prin ng in Smar orms?

Documents Prepared By Sonu Jangir Sap Abap


Step1: Use SE73 i.e. SAP-Script Font Maintenance and create a Bar code say
Zbarcode.
Step 2: For Smar orm, create a character format C1 and use the recently
created Barcode Zbarcode.

How do you add a Watermark Or a Background Image for


Smar orms ?
If you go to the proper es of a page in Smar orm, you will find a tab for
Background Image.
Specify the source of the image you need here and it can be used as
background image / Watermark in Smar orms.
Graphics can be maintained using T.code SE78.
Background Image for Smar orms.

How will you print on both sided of a Smar orm?


At the Page level in Smar orms, you can find something called as Print Mode.
Set the Print mode to duplex to print on both sides of the Smar orm.

How can you provide a background color to the table?


Ans: In the Table Painter, you can specify the color and shading for the table
lines.

How can you make the Smar orms to display a print


preview by default without displaying the popup for print
parameters?
In the SSF_OPEN func on module,
Set the OUTPUT OPTIONS paramter TDDEST to your printer name.
Set the CONTROL PARAMETERS and control parameters as shown below,
control-preview = 'X'.
control-no_open = 'X'.

Documents Prepared By Sonu Jangir Sap Abap


control-no_close = 'X'.
control-no_dialog = 'X'.
control-device = 'PRINTER'.
control_parameters-no_dialog = 'X'.
control_parameters-no_open = 'X'.
control_parameters-no_close = 'X'.
OUTPUT_OPTIONS-TDDEST = 'PRINTER NAME'.
OUTPUT_OPTIONS-TDNOPRINT = 'X'.
CALL FUNCTION 'SSF_OPEN'
EXPORTING
output_op ons = output_op ons
control_parameters = control
user_se ngs = ' '
EXCEPTIONS
forma ng_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.

What is the difference in a Table and a Template in


Smar orm?
A Template has fixed number of Rows and Columns whereas a Table can have
variable rows and columns .
We should use a template when the tabular output is fixed!

How do you achieve Page Protec on in Smar orm ?

Documents Prepared By Sonu Jangir Sap Abap


: While one can use the PROTECT ..... ENDPROTECT command for SAP-Scripts,
for Smar orms the Page-Protec on checkbox can be used to ensure page
protec on:
Page Protec on in Smar orms

Can you move a Smar orm from one SAP system to another
without using transports ?
Yes, this can be achieved using the Upload/Download feature for Smar orms.
One can download the Smar orm from one system and save it as an XML file.
Once that is done, the XML file can be used to upload the Smar orm in
another system.

Can you have a Smar orm without a main window?


Yes, you can create a Smar orm without a Main Window. But there is no need
to do anything of such sort.

How do you find the name of the Func on Module for a


Smar orm?
The func on module for Smar orm is created when the Smar orm is
ac vated.
You can find the name of the Func on Module for a Smar orm by going to
Environment --> Func on Module Name.

What is a Copies Window?


We use the copies window to define an output area for the print output,
whose content you want to appear either only on the copy or only on the
original. This allows you to flag copies as copies when the form is printed.

You can determine where to print the inferior nodes of a


copies window:
Both on the original and on the copies ( Original and Copies )

Documents Prepared By Sonu Jangir Sap Abap


Only on the original ( Only Original )
Only on the copies ( Only Copies )
You can use the system fields SFSY-COPYCOUNT or SFSY-COPYCOUNT0 to query
whether the current output is the original or, respec vely, which number the
copy has.

What is a Final Window?


Final Window is called a er all the other windows are called in a Smar orm.

What is the tcode for SAPScript forms?


SE71 is the tcode for SAPScript forms.

What is PROTECT & ENDPROTECT?


PROTECT & ENDPROTECT is a command used to protect a paragraph against a
page break.

What are the different types of SAPScript symbols?


4 different types of SAPScript symbols are as follows.
 System symbols
 Standard symbols
 Program symbols
 Text symbols

What are the different window types in SAPScript?


MAIN – Main window
VAR – Variable window
CONST – Constant window
How many MAIN windows are allowed in SAPscript?
99 main windows are allowed in SAPscript.

Documents Prepared By Sonu Jangir Sap Abap


How can you display the total number of pages in
Smar orms?
Use SFSY-FORMPAGES to display the total number of pages in the Smar orms
&SFSY-PAGE& Current page number
&SFSY-FORMPAGE& Total number of pages in the currently forma ed layout
set
&SFSY-JOBPAGE& Total number of pages in the currently forma ed print
request
&SFSY-COPYCOUNT& Original-1,1st copy-2
&SFSY-DATE& Date
&SFSY-TIME& Time
&SFSY-USERNAME& Username.

How to Debug a SAP Smar orm?


Ans: To debug a smar orm in quality or tes ng system, go to tcode
SMARTFORMS. Enter the name of the smar orm if you know or find the name
of the smar orm name from NACE and display the smar orm.debug-
smar orms-1Find the statement in the smar orm where you want to place the
break-point.debug-smar orms-2Go to menu Environment –> Func on Module
Name to get the name of the func on module for the Smar orm.debug-
smar orms-3Copy the func on module name in the popup. debug-
smar orms-4Go to tcode SE37 (Func on Builder).debug-smar orms-5Enter
the name of the func on module and go to Menu Goto –> Main
Program.debug-smar orms-6In the Main Program click on FIND to search the
statement where you want to place the break-point.debug-smar orms-7Enter
the text of the line where you want to place the break-point in the FIND
popup.debug-smar orms-8Place the break-point on the desired line.debug-
smar orms-9Now run the driver program, the control stops at the break-point
and you can analyze the smar orm.

What are important trnsacodes used for smar orms?

Documents Prepared By Sonu Jangir Sap Abap


 SMARTFORMS - SAP Smart Forms Basis
 SMARTFORM_TRACE - SAP Smart Forms: Trace Basis -
 SMARTFORM_CODE - SAP Smart Forms: Target Coding Basis -
 NACE - WFMC: Ini al Customizing Screen SD - Output Determina on
 SP01 - Output Controller Basis - Print and Output Management
 SO10 - SAPscript: Standard Texts Basis
 SE78 - Administra on of Form Graphics Basis -
 SPAD - Spool Administra on Basis - Print and Output Management
 SE63 - Transla on: Ini al Screen Basis - Transla on
 VF03 - Display Billing Document SD - Billing
 SE73 - SAPscript Font Maintenance Basis
 SMARTSTYLES - SAP Smart Styles Basis
 SFTRACE - SAP Smart Forms: Trace

What are the various text forma ng op ons in


Smar orms?
 &symbol(Z)& Omit Leading Zeros
 &symbol(S)& Omit Leading Sign
 &symbol(<)& Display Leading Sign to the Le
 &symbol(>)& Display Leading Sign to the Right
 &symbol(C)& Compress Spaces
 &symbol(.N)& Display upto N decimal places
 &symbol(T)& Omit thousands separator
 &symbol(R)& Right jus fied
 &symbol(I)& Suppress output of the ini al value

Documents Prepared By Sonu Jangir Sap Abap


How do you control printer func ons from SAPscript?
By using PRINT-CONTROL command.

How can we omit a leading sign and a leading zero in


SAPScript?
Leading sign can be omi ed by using ‘S’ with the sapscript symbol i.e.
&symbol(S)&. Leading zero can be omi ed by using ‘Z’ with the sapscript
symbol i.e. &symbol(Z)&.

How to debug a SAPScript?

To switch on the debugger for SAPScript use the menu path U li es->Debugger
or use the program RSTXDBUG.

What are the different func on modules used in SAPScript?


 START_FORM
 OPEN_FORM
 WRITE_FORM
 CLOSE_FORM
 END_FORM

How to call a subrou ne in SAPScript?


Use PERFORM to call a subrou ne.
Syntax for PERFORM statement is as follows
/: PERFORM <subrou ne> IN PROGRAM <program>
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&

Documents Prepared By Sonu Jangir Sap Abap


/: ENDPERFORM
Syntax for FORM statement in the program is as follows.
FORM <subrou ne> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
...
ENDFORM.

What is difference between SAP Script and Smar orm?


SAP Script Smar orm
 Client dependent  Client independent
 Mul ple page format is not  mul ple page format is
possible possible
 Scripts allows only black &  Text can be wri en in
white texts. various color
 There is no mixture of  There is an op on to print a
portrait and landscape mixture of portrait and
format landscape format
 Scripts allows more than  Smar orms allows only one
one main window main window on page
 This is not support for  This is online support.
online.

How to debug SAP Script?


Goto--- Tocde SE71-->U li es-->Ac ve Debugger. and then go to Tcode SE38--
>give driver program name of SAP Script then click on debug.

How do you transport a script and how do you transport


standard text?

Documents Prepared By Sonu Jangir Sap Abap


By using standard program RSTXTRAN we can transfer SAP standard text form
one client to another client and using standard program RSTXSCRP we can
transport script from one client to another client.

How to find driver program given the name of SAP script?


First you need to goto Form-->check-->text, you will get one small box hit on
enter where you can see the driver program name

Forcing a page break within table loop?


Create a loop over the table. Place a Command node before the table in the
loop that forces a NEWPAGE on whatever condi on we want. Then only loop
through a subset of the internal table (based on the condi ons in the
Command node) of the elements in the Table node.

Font style and Font size in Smart Forms?


Goto Transac on SMARTSTYLES.
There we can create Paragraph formats etc just like in sapscript.
Then the window under OUTPUT OPTIONS we can include this SMARTSTYLE
and use the Paragraph and character formats.

Line in Smart form?


Line can be drawn in two ways -
 We can use a window that takes up the width that has a height of 1 mm
of our page. Then we should put a frame around it (in window output
op ons). Thus, we have to draw a box that looks like a line.
 We can just draw “__” across the page and play with the fonts so that it
joins each UNDER_SCORE.

Difference between ‘form interface’ and ‘global defini ons’


in global se ngs of smart forms?
Form Interface is where we declare "what must be passed in and out of the
smart form" (in - from the print program to the smart form. out - from the
smart form to the print program).

Documents Prepared By Sonu Jangir Sap Abap


Global defini ons are where we declare “the data that is used within the smart
form on a global scope". ie: anything we declare can be used in any other node
in the form.

How to find smart forms func on module name?


Once we have ac vated the smart form, go to the environment -> func on
module name. There we can get the name of func on module name.

What is smart forms output difference?


Problem with Smart forms: If two printers are differently configured and the
difference is the output characters size. If we print the form on these printers,
the output gets printed differently on each printer.
It happens only when the two printers having different Printer Controls. To
resolve the problem, printer control se ng should be same for both printers.
To resolve this, go to SPAD Menu (Spool Administrator Menu). There we can
see the difference in the Printer Control and modify the printer control se ng
for both the printers as same. then it will be ok. And, we have to check what is
the device type used for both the output devices.

How to convert smart forms output to PDF?


There is a way to download smart form in PDF format.
Do the following -
1. Print the smart form to the spool.
2. Note the spool number.
3. Download a PDF file (Acrobat Reader) version of the spool by running
Program RSTXPDFT4 and entering the noted spool number.

How does one transport SMARTFORM? SE01?


A smart form are transported as same as any other object. If it is assigned to a
development class, that is a ached to a transport layer and it gets transported.
Once the defini on is transported, and when it is called, the func on module is
regenerated.

Documents Prepared By Sonu Jangir Sap Abap


What are the differences between scripts & smart forms?
 Mul ple page formats are possible in smar orms which is not the case in
SAPScripts.
 It is possible to have a smar orm without a main window.
 Labels cannot be created in smar orms.
 Rou nes can be wri en in smar orms tool.
 Smar orms generates a func on module when ac vated.
 Unlike sapscripts (RSTXSCRP), we cannot upload/download Smar orm to
our local hard disk.

What is the use of Folder in Smart forms?


Just to group nodes, doesn’t affect any func onality. we can group nodes into a
folder.
What is the difference in a Table and a Template in Smart form?
A Template has fixed number of rows and columns whereas a Table can have
any number of rows and columns i.e. We can have a internal table with
contents associated to a Table element but not to a Template.

Can you move a Smart form from one SAP system to


another without using transports?
Yes, this can be achieved using the Upload/Download feature for Smart forms.
We can download the Smart form from one system and save it as an XML file.
Once the download completed, the XML file can be used to upload the Smart
form in another system.

Can you have a Smart form without a main window?


Yes, we can create a Smar orm without a Main Window. But there is no need
to do anything of such sort. Whenever we create a Smar orm, a main window
is created by default.

Documents Prepared By Sonu Jangir Sap Abap


How do you find the name of the Func on Module for a
Smart form?
How do you find the name of the Func on Module for a
Smart form? When is this func on module created?
The func on module for Smar orm is created when the Smar orm is
ac vated. We can find the name of the Func on Module for a Smar orm by
going to "Environment -> Func on Module Name".

What is a Final Window in smart forms?


Final Window is called a er all the other windows are called in a Smar orm.

In Smart forms a er final window, can we create secondary


window?
Final Window is called a er all the other windows are called in a Smar orm.

Documents Prepared By Sonu Jangir Sap Abap

You might also like