You are on page 1of 17

SAP ABAP Smartforms Interview Questions and

Answers

What are the differences between SAP Scripts and Smartforms?

SAP SCRIPT SMART FORM


Multiple page formats are not possible. Multi[le page formats are possible.
It has version management. No version management.
Lables are possible. Labels are not possible.
Client dependent Client independent.
Control commands are working. Control commands are not working.
Water mark is not possible. Water mark is possible.
Colors are not possible. Colors are possible.
Using “RSTXDBUG” we can debug. Using “Break point” keyword we can debug.
Without main window we can not create script. We can create without main window.
Paragraph and character formats are re-usable. Not re-usable.
Complex coding. Complex designing.
Back up using .txt file. Backup using xml file.
Coding not possible. Coding possible.
It won’t generate function module. It generate function module.
.

I have a smartform which works fine in development server. After trasnsporting it


to Production, there is no Function module generated for this smartform. Due to
that my program dumps in Production? How to solve this?

The Smartform that is created in the Development may not have the same name in the Production server. So it
is always advised to use the Function Module SSF_FUNCTION_MODULE_NAME to get the Function Module
name by passing the Smartform name.

DATA: fm_name TYPE rs38l_fnam.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'


EXPORTING
formname = 'ZSMARTFORM'
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2

CALL FUNCTION fm_name


EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3

ENDIF.
How can you make the Smartforms to choose a printer name by default?

In the CALL FUNCTION of the Smartform Function Module, set the output options parameter to set the printer
name.

The output options is of the type SSFCOMPOP which contains the field TDDEST. Set the TDDEST field to your
default printer name.

How Can I Make The Smartforms To Display A Print Preview By Default Without Displaying The Popup For Print
Parameters?

In the CALL FUNCTION of the Smartform Function Module (CALL FUNCTION fm_name ), set the Output Options
and Control Parameters as mentioned below:

control_options-preview = 'X'. " Print Preview


control_options -no_open = 'X'.
control_options -no_close = 'X'.
control_options -no_dialog = 'X'.
control_options -device = 'PRINTER'.

output_options-TDDEST = 'PRINTER NAME'. "Spool: Output Device


output_options-TDNOPRINT = 'X'. "No printing from print preview

How Can I Display The Total Number Of Pages In Smartforms?

Use SFSY-FORMPAGES to display the total number of pages in the Smartforms

 &SFSY-PAGE& : Current page number


 &SFSY-FORMPAGE& : Total number of pages in the currently formatted layout set
 &SFSY-JOBPAGE& : Total number of pages in the currently formatted print request
 &SFSY-COPYCOUNT& : Original-1,1st copy-2
 &SFSY-DATE& : Date
 &SFSY-TIME& : Time
 &SFSY-USERNAME& : Username

Sometimes While Using The Variable SFSY-FORMPAGES Or SFSY-PAGE, You Get A Star '*' Instead Of The Total
Number Of Pages Or Current Page Number. How To Resolve Such Issues?

There may not be enough space in the window to display the variable, either increase the window dimensions or
condense the spaces using &SFSY-FORMPAGES(C)& or using &SFSY-FORMPAGES(ZC)& or using &SFSY-
FORMPAGES(4ZC)&.

Here

 '4' reserves a four character wide output. (It can be set to any value.)
 'Z' eliminates the leading zeroes.
 'C' Compress Spaces.

27. What Are The Various Text Formatting Options In Smartforms?

Various text formatting options available in Smart Forms are:


 &symbol(Z)& : Omit Leading Zeroes
 &symbol(S)& : Omit Leading Sign
 &symbol(<)& : Display Leading Sign to the Left
 &symbol(>)& : Display Leading Sign to the Right
 &symbol(C)& : Compress Spaces
 &symbol(.N)& : Display up to N decimal places
 &symbol(T)& : Omit thousands separator
 &symbol(R)& : Right justified
 &symbol(I)& : Suppress output of the initial value

28. How To Add A Standard Address In A Smart Form?

Address can be printed quickly and smoothly using the address node available in smartforms. This node is based on
Central Address Management (CAM). Addresses can be of 3 types:

 Company /Organization address type.


 Workplace address type.
 Personal address type.

In case if you the address number or the person number is already known, then we just we need to maintain
the values in the options given in the address node.

In case if you are fetching the address number or the person number dynamically or during run time, you can
achieve it by passing the variable as shown below:
29. What Is The Concept Of Page Protection In Smart Forms? How Do You Achieve Page Protection In Smart
Forms?

Page Protection is used to avoid displaying the broken contents of the page and allow it to display in the new
page from the beginning after the previous page.

Page Protection attribute is to be used to determine whether or not to display a paragraph completely on one
page. Mark it if you want to avoid that a paragraph is split up by a page break. If on the current page (only in the
main window) there is not enough space left for the paragraph, the entire paragraph appears on the next page.

While one can use the PROTECT ..... ENDPROTECT command for SAP-Scripts, for Smart Forms the Page-
Protection checkbox can be used to ensure page protection.

Note: You have Page-protection property only for Text Elements in the Main Window.

Why Pages & Windows Node Are Required Or Mandatory While Creating A Smart Form?
The Page represents the layout of the Page that is printed on and the items to be printed on the Page are
contained in Windows. The page together with the windows defined on the page determines how the print will
appear and the contents of the print.

32. How Can You Find The Generated Function Module Name For A Smart Form?

First activate the Smart Form. Go to Environment -> Function Module Name and get the automatically generated
function module for the Smart Form.

33. How Do You Debug A Smart Form?

By Putting a break point on the generated function module of the Smartform, one can debug it.
For more information, Refer the link mentioned below.

http://wiki.scn.sap.com/wiki/display/ABAP/Easy+Step+To+Debug+a+Smartform

34. What Are The Different Auxiliary Nodes Available In Smart Form?

Auxiliary nodes help to control and format the print but do not print any contents by themselves. Following are the
different auxiliary nodes available in Smart Form:

 Table: Output of a table containing application/dynamic data.


 Template: output of a table containing static data.
 Program Lines: Executes ABAP Code.
 Folder: Combines successor nodes to logical groups.
 Loop: Processes successor nodes repeatedly.
 Alternative: Branches depending on conditions.
 Command: Executes Special Commands.

35. What are the Text Types available in Smart Form?

There are 4 different types of Text available in Smart Forms. They are:

 Text Element
 Text Module
 Include Text
 Dynamic Text

36. What Are Text Modules In Smart Forms? What Are The Advantages Of Using Text Module?

A Text Module acts as some sort of container of text, which makes reuse of text easier. There are texts that
frequently appear in different forms. Text Modules can be used to store these texts centrally in the system. This
detaches text maintenance from form maintenance, with the result that there will be no need to call the Form
Builder to edit individual texts.

Text modules can be maintained using smartforms transaction. The text module is maintained exactly like the
Text element. Text literals as well as fields can be written in the text module. Fields of the Text module take
values from the Smart Form from which it is called. Since a Text Module is a separate entity, it has its own
Management (Attributes) screen.
The main advantages of using a Text module are:

 Central storage and maintenance of texts: Commonly used texts like Terms and Conditions, Address line
on footer, etc. do not have to be typed and maintained on every Smart Form being made. Also, changes made to
the text at one place can be cascaded to all Forms where it is used if the Copy option is not used.
 Language specific maintenance: Text modules can be maintained in different languages. Thus, by
referring to the same Text module name, Smart Forms in different languages pick up the text of the corresponding
language.
 Client independence: This is an advantage over Include texts that are client dependent.
 Can be assigned to CTS: An advantage over Standard Texts that are not assigned to a Transport System by
default.
 Can be translated to other languages through the transaction SE63.

What Is The Use Of Command Node In Smart Form?

Command Nodes can be used to achieve page break. By using Command Node, one can manually control the
numbers of records to be displayed per page based on some condition.

For More information, Refer the link mentioned below:

http://www.saptechnical.com/Tutorials/Smartforms/Command/Page3.htm

38. Can One Restrict The Translations Of Smart form To Specific Languages?

Yes, one can restrict the translations of Smart forms to specific languages by creating a super set of languages for
which you want to allow the translations. Go to form Attributes --> General Attributes --> Language Attributes --
> Into Selected Language.

Select all the languages for which you want the translation to happen.

39. How Can You Translate A Smart Form From One Language To Another?

In smart forms, if you want a user to see the text in other languages (other than language in which smart form is
created) , in Global settings ,we need to select radio button Into Selected languages and maintain the Translations
in that particular language using SE63.

There is no other way to automate this process but to maintain translations with human intervention for
selected languages.

In SE63 transaction, Use path Translations -> ABAP objects -> Other Long Text. Click on Forms and Styles & Select
Forms.

Please give object name in CAPITALS. Also select Source and target language from F4 help.

For more information, refer the link mentioned below:

http://www.se63.info/translating-sap-smart-forms/

40. How Do You Assign Transport Request To Translations For Smart Forms?

Once you are done with your translation and you want to push the translation to your target system, you need a
transport request. Run the transaction code SLXT or program RS_LXE_RECORD_TORDERfor creation of transport
request.

For more information, refer the link mentioned below:


http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/0010d07e-ec5d-2e10-72ad-
f233bd6a2c4d?quicklink=index&overridelayout=true

41. What Is The Use Of Folder Node In Smart Form?

Folder option is useful for placing all the contents into a single place which we call as logical grouping. If we
want to put a condition on a group of text elements or templates we can place them in a folder and apply the
condition once to the folder.

Folder option allows you to place all the contents into a single place. This is basically useful when you have
number of windows and with each window you have different graphics, texts, tables, templates used. So to
differentiate between 2 windows we generally go for folders and place all contents of one window in a folder and
wise versa.

Page Protection property of Folder control will be used in order to display text in the same page without
separating it into two different pages. If there is not enough space for a text node, or a group of text nodes, a
group of table rows, etc. the items will be displayed as a group on the next page with maintaining the integrity of
these items.

In SAP Smartforms documents frequently it is a requirement to print data in same page. For example in a Smart
Form table, some of the table rows are required to print in same page together. If the empty space is not enough
it is preferred to print those table rows in following page together. In such cases Smartforms Folder control
helps ABAP developers creating SAP Smartforms documents. Folder control is the key for page protection in
Smartforms.

SAP Smartform Folder control has the Page Protection attribute which can be used by SAP Smart Form developers
as a switch for keeping items in the same page.

42. How Do You Use Barcode in Smart Form?

First go to SE73 SAP Script Font Maintenance to create or display the system bar codes.

Then go to SMARTSTYLES transaction, create a new character format and assign the barcode name that you have
created in it. Then you can use the character format in your Smartform wherever you want the barcode to be
displayed.

Where can I provide the input parameters to the smartform?

The input parameters for the smartform can be defined in Global Settings->Form Interface.
The Associated Type must be defined in the ABAP Dictionary.

Where do you Configure the Adobe Forms / Smart forms / SAP Script to the
output type in NACE?

Go to transaction NACE.

Choose the required application from the list and click on output types.

Chose one of the Output types from the right pane and click on processing routines.

If an SAP Script to be attached, fill-in the driver program name, Form routine and SAP Script name in the field
“Form” (shown below)”
If an Smart Form / Adobe Form are to be attached, enter the form name in the field “PDF/SmartForm Form”
and select one of the types “PDF” or “SmartForm”. (See the screenshot below).

How do you display logo/ graphics in smart form?

Go to transaction SE78 Administration of form graphics.


Double click on graphics and click on “import tab F5” to import the image.
Select the file, name your graphic and enter a short description and click on continue. Graphic is created.
Now open smartform transaction and create form.
To create graphics right click on main window -> create -> graphic and give details and save.

How can I insert symbols in Smartforms?

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 smartform?

The global types can be defined in Global Settings->Global Definitions->Types


The types defined here will be global through the entire smartform.

Also the form routines can be defined Global Settings->Global Definitions->Form Routines

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 condition which
must satisfy to display the table?

The conditions can be defined in the Conditions tab. In smartforms all the nodes have a condition tab where
you can specify the condition to be satisfied to access the node.

How can I define Page Protect in Smartforms?

To define Page Protect for a node go to the Output options and check the Page Protection checkbox.

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

How do you convert a Smartform Output to PDF output?

By using “RSTXPDFT4” is the standard program used to convert smart form output to pdf.

The following two function modules and their importing/exporting parameters:

CONVERT_OTF
CONVERT_OTF_2_PDF

In the Driver program, import the parameter 'job_output_info' from the Smartform FM and utilize that info in
'OTF' parameter of the two aforementioned function modules.

Here is one more and probably the easiest way to see PDF output for a Smartform.
Type PDF! in the command prompt and hit enter :).

To see the Smartform Print Preview output as list output,


Type SLIS in the command prompt and hit enter.

*How do you achieve Bar Code printing in Smartforms?

Step1: Use SE73 i.e. SAP-Script Font Maintenance and create a Bar code say Zbarcode.
Step 2: For Smartform, create a character format C1 and use the recently created Barcode Zbarcode.
It can be finally used to print Barcode as:

How do you add a Watermark Or a Background Image for Smartforms ?

If you go to the properties of a page in Smartform, 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
Smartforms.

Graphics can be maintained using T.code SE78.


Background Image for Smartforms.

How will you print on both sided of a Smartform?

At the Page level in Smartforms, you can find something called as Print Mode.
Set the Print mode to duplex to print on both sides of the Smartform.
How can you provide a background color to the table?

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

How can you make the Smartforms to display a print preview by default without
displaying the popup for print parameters?

In the SSF_OPEN function 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'.
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_options = output_options
control_parameters = control
user_settings = ' '
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.

What is the difference in a Table and a Template in Smartform?

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 Protection in Smartform ?

While one can use the PROTECT ..... ENDPROTECT command for SAP-Scripts, for Smartforms the Page-
Protection checkbox can be used to ensure page protection:

Can you move a Smartform from one SAP system to another without using
transports ?

Yes, this can be achieved using the Upload/Download feature for Smartforms.
One can download the Smartform from one system and save it as an XML file.
Once that is done, the XML file can be used to upload the Smartform in another system.

Can you have a Smartform without a main window?

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

Can you force a page break within table loop in smartforms? If yes how?

Create a loop around the table. Put a command before the table in the loop that forces a NEWPAGE on
whatever condition you want.

What are the components of smart forms?

Smart form Layout


Function Module.
Print Program.

What are the components of Smart Form Layout?

Global Settings – collection of form attributes, form interface and global definition.
Pages & Windows – used to design the layout as per the requirement.

Form Attributes – are used to maintain administrative information i.e form name, language, page format and
style.
Form Interface – used to declare variables, work areas, internal tables which are needed to transfer the data
from print program to layout.

Global Definition – used to declare variables, work area and internal tables which are needed to implement
the logic.

How do you create & maintain font style used in smart form?

By using transaction SMARTSTYLES.

How do you find the name of the Function Module for a Smartform?

The function module for Smartform is created when the Smartform is activated.
You can find the name of the Function Module for a Smartform by going to
Environment --> Function Module Name.

What are the types of windows available in smart forms?

Main Window – we use main window when there is a need to display text are data which can cover several
pages. A page with out main window cannot call itself as a next page.
Secondary window – is used to display data or text with a fixed length.

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 )
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, respectively, which number the copy has.

What is a Final Window?

Final Window is called after all the other windows are called in a Smartform.

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.

How can you display the total number of pages in Smartforms?

Use SFSY-FORMPAGES to display the total number of pages in the Smartforms

&SFSY-PAGE& Current page number

&SFSY-FORMPAGE& Total number of pages in the currently formatted layout set

&SFSY-JOBPAGE& Total number of pages in the currently formatted print request

&SFSY-COPYCOUNT& Original-1,1st copy-2

&SFSY-DATE& Date
&SFSY-TIME& Time

&SFSY-USERNAME& Username.

How to Debug a SAP Smartform?

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

What are important trnsacodes used for smartforms?

SMARTFORMS - SAP Smart Forms Basis

SMARTFORM_TRACE - SAP Smart Forms: Trace Basis -

SMARTFORM_CODE - SAP Smart Forms: Target Coding Basis -

NACE - WFMC: Initial Customizing Screen SD - Output Determination

SP01 - Output Controller Basis - Print and Output Management

SO10 - SAPscript: Standard Texts Basis

SE78 - Administration of Form Graphics Basis -

SPAD - Spool Administration Basis - Print and Output Management

SE63 - Translation: Initial Screen Basis - Translation

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 formatting options in Smartforms?


&symbol(Z)& Omit Leading Zeros

&symbol(S)& Omit Leading Sign

&symbol(<)& Display Leading Sign to the Left

&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 justified

&symbol(I)& Suppress output of the initial value

How do you control printer functions from SAPscript?

By using PRINT-CONTROL command.

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

Leading sign can be omitted by using ‘S’ with the sapscript symbol i.e. &symbol(S)&. Leading zero can be
omitted 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 Utilities->Debugger or use the program
RSTXDBUG.

What are the different function modules used in SAPScript?

START_FORM
OPEN_FORM
WRITE_FORM
CLOSE_FORM
END_FORM
How to call a subroutine in SAPScript?
Use PERFORM to call a subroutine.

Syntax for PERFORM statement is as follows

/: PERFORM <subroutine> IN PROGRAM <program>


/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM
Syntax for FORM statement in the program is as follows.

FORM <subroutine> TABLES IN_TAB STRUCTURE ITCSY


OUT_TAB STRUCTURE ITCSY.
...
ENDFORM.

What is difference between SAP Script and Smartform?

SAP Script:
1.Client dependent
2.Multiple page format is not possible
3.Scripts allows only black & white texts
4.There is no mixture of portrait and landscape format
5.Scripts allows more than one main window
6.This is not support for online.

Smartform:

1.Client independent
2.multiple page format is possible
3.Text can be written in various color
4.There is an option to print a mixture of portrait and landscape format
5. Smartforms allows only one main window on page
6.This is online support.

How to debug SAP Script?

Goto--- Tocde SE71-->Utilities-->Active 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?

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.

You might also like