Sunteți pe pagina 1din 20

Q) Define Smart form?

Form Printing in the Internet Age


Smart Forms was initially presented in SAP Basis Release 4.6C primarily as a tool for the
creation and maintenance of forms within the SAP solutions, for instance within mySAP
Healthcare, mySAP SRM, mySAP CRM, and mySAP SCM and these are being used already by
many customers. These Smart Forms offers an easy-to-use graphical user interface which
enables the users to perform critical tasks of creating and adjusting forms without the need of
any programming skills.

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.

Windows are defined in form maintenance. They represent areas that are positioned on
pages – as page windows – and in which at a later time text is printed. You must define at
least one window for each form. Otherwise, SAPscript cannot format the text.
You can assign window names and window types. However, note that you can define only
one main window per form.
Use one of these window types:
MAIN WINDOW:
Main window in which continuous text is printed. This is the window used by dialog users of
a print program and form. For example, the body text of a letter would be entered in MAIN.
The text in the main window can extend over several pages. If the text fills one page, output
continues in the window of the next and subsequent pages, as long as MAIN has been
defined for these pages.

VARIABLE WINDOW:
Window with variable contents. The text can vary on each page in which the window is
positioned. Variable windows are formatted for each page.
To every window you can assign text, which is printed in the corresponding window when
the form is formatted. To assign text, use text elements, which are stored with the form.
To create and maintain text elements with the SAPscript Editor, choose Text elements. For
more information, see Text Elements.Should the text selected for the window exceed the
window size, then the text is cut off.

CONSTANT WINDOW
Window with constant contents that is formatted only once.
Currently, constant windows are processed in the same way as VAR windows. You should only use
windows of type VAR.

Q) What are the key benefits or advantages of Smart forms?


Some of the key benefits of Smart forms have been listed below:
• Smart Forms allows the overall implementation cost of SAP solutions to be reduced as the forms
can be adjusted in minimum time.
• The Form Builder along with integrated graphical user interfaces meant for designing pages,
table design and text, provides support to the entire process of designing the form and thus
leading to the creation of the form logic. To add further, the Form Builder also offers a tree
structure meant for navigating through your form description and helps in determining the main
processing order. Of Besides these, other functions such as copy-and-paste and drag-and-drop
are also included.
• The Smart Forms generates a function module which condenses the content, layout, as well as
form logic by utilizing the form description which is maintained in the Form Builder. Thus avoiding
the need to group of function modules for printing of forms.
• Besides the tool itself SAP also enables the generation of the set of forms meant for central
business processes, which even includes forms in Financial Accounting (FI), SAP Customer
Relationship Management (CRM) and Human Resources (HR), the SAP R/3 Sales and
Distribution (SD), and application components.

What is SAP Smart Forms?

SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining
forms.

SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using
simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power
user without any programming knowledge can configure forms with data from an SAP System for the
relevant business processes.

To print a form, you need a program for data retrieval and a Smart Form that contains the entire from
logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes
to the form logic are necessary. The application program passes the data via a function module
interface to the Smart Form. When activating the Smart Form, the system automatically generates a
function module. At runtime, the system processes this function module.
You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering
events for table headings and subtotals, and sorting data before output.

You can check individual nodes as well as the entire form and find any existing errors in the tree
structure. The data flow analysis checks whether all fields (variables) have a defined value at the
moment they are displayed.

SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as
background graphics. You use background graphics to copy the layout of an existing (scanned) form
or to lend forms a company-specific look. During printout, you can suppress the background graphic,
if desired.

SAP Smart Forms also support postage optimizing.

Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C

What Transaction to start SAP Smart Forms?


Execute transaction SMARTFORMS to start SAP Smart Forms.

Key Benefits of SAP Smart Forms:


SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com
solutions since forms can be adjusted in minimum time.
You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is
represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes
for global settings, nodes for texts, nodes for output tables, or nodes for graphics.

To make changes, use Drag & Drop, Copy & Paste, and select different attributes.

These actions do not include writing of coding lines or using a Script language.

Using your form description maintained in the Form Builder, Smart Forms generates a function
module that encapsulates layout, content and form logic. So you do not need a group of function
modules to print a form, but only one.

For Web publishing, the system provides a generated XML output of the processed form.
Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party
printing tools. XSF passes form content from R/3 to an external product without passing any layout
information about the Smart Form.


Q) How can we build Web forms using Smart Forms?
• Smart Forms can be generate HTML based on XML output, with the help of the SAP Web
Application Server 6.10. This permits the integration of interactive Web Forms in Web
applications.
• The layout of a Web Form is a look alike of the printed version. Printed forms which are already
used in a business process are promptly recognized.
• By turning a switch the existing Smart Forms used for printing can also be reused for Web
applications. Without showing them in your printed version, you can add HTML input elements
to your Smart Form.
• For evaluating the user entries on a Web Form, these are required to be integrated in some kind
of Web application infrastructure. SAP suggests you to utilize Business Server Pages for doing
this.

Q) Which Basis Release do I need to use SAP Smart Forms?
As of R/3 Basis Release 4.6C, SAP Smart Forms is available. It cannot be used in Basis
Releases before 4.6C as it uses SAP kernel technologies and these do not exist in previous
releases. Incase you deploy the appropriate kernel in a, for instance in, 4.6B system its
impossible to use Smart Forms as the tools were still under development around that time.

Q) Have heard that Smart Forms replaces SAPscript. What does the term "replace" mean?
Replace does not mean that the SAPscript has been removed from the Basis shipment. Even as
of Basis Release 4.6C, SAPscript remains a part of the SAP standard and as of now there are
no plans to remove it. In fact, few transactions of SAPscript are reprocessed by SAP Smart
Forms (for instance in the graphical or font maintenance). Since Smart Forms is presently the
tool for form maintenance formySAP.com solutions,we will focus on Smart Forms, and not
on SAPscript (of course, we will continue to support the existing functionality of SAPscript for
the maintenance contracts.) The term "replace"mirrors the hope that you will like Smart Forms
as quite a few customers already do and use it instead of SAPscript.
Q) Is it still possible to use SAPscript instead of SAP Smart Forms?
Yes, we encourage our users to begin using SAP Smart Forms especially the new forms
however both the products can be used parallely.

Q) Where can the user get documentation on Smart Forms?


Incase you are already working with Basis Release 4.6C or higher, you need to simply call
transaction SMARTFORMS and select menu Help->Application Help and proceed directly to
the Smart Forms online documentation in the SAP Library. This documentation can also be
accessed in the SAP Help Portal. You need to call the online documentation for your release by
using the left navigation frame and open the SAP Library. The SAP Smart Forms online
documentation can be initiated by selecting:
• Basis components (as of SAP Web AS 6.10: SAP Web Application Server)
• Basis Services / Communication Interfaces (BC-SRV)
• SAP Smart Forms (BC-SRV-SSF)

Q) If there is a possibility to migrate an SAPscript form to a Smart Form?


Smart Forms offers a migration tool specifically for this purpose which migrates layout and texts
of a SAPscript form to a Smart Form. It does not migrate SAPscript form logic of the print
program. This logic is described by the tree structure of the Form Builder Using Smart Forms.
The effort involved in migrating solely depends on the complication of the print program. You can
also refer to the section Migrating SAPscript forms of the Smart Forms online documentation.

Q) Do we have to migrate all SAPscript forms to Smart Forms?


It is pointless migrating all SAPscript forms which are already in use as the SAPscript can still be
used and will be available in the future. Incase you plan to migrate a SAPscript form, then it is
suggested that you check whether the benefit is worth the effort involved.

Q) Can I know if there are already standard smart forms for my application? Incase not,
then what can do?
SAP Document 430621 provides an overview of the existing standard smart forms which are
delivered by SAP Applications. Besides this, SAP Labs also offers preconfigured Smart Forms
which are specifically for the US customers. SAP Document 412293 also provides a procedure in
case your application has not delivered a standard smart form.

Q) Define XSF?
SAPscript presents a Raw Data Interface (BC-RDI) which permits the usage of 3rd party
printing tools, which if meant for passing form content (without layout information) from R/3 to an
external product. Smart Forms also provides a data stream called XML for Smart Forms
(XSF) only for this purpose. As RDI, XSF does not comprise of any layout information about a
Smart Form.
You have the opportunity of becoming a certified partner for the XSF interface (BC-XSF), with
the SAP Partner Program. You can refer to the SAP Integration Scenarios / Interfaces for more
information about all certifiable SAP interfaces. For details about BC-XSF choose mySAP
Technology: Background Processing and Output Management.
Upon using an XSLT program Smart Forms XSF output is also the precondition generating
HTML by This program utilizes the layout information from your form (for instance pages, used
fonts and window sizes) and the given XML tags of XSF for generating HTML.

Q) What are the differences between SAP Scripts and Smartforms?


• SAP Scripts are client dependent whereas Smartforms are client independent.
• SAP Scripts require a driver program to display the output whereas in smartforms the form
routines can be written so that it is standalone.
• An integrated Form Builder helps to design Smartforms more easily than SAP Scripts
• A Table Painter and Smart styles to assist in building up the smartforms
• On activation, a function module is generated for Smartforms
• It is possible to create a Smartform without a main window
• Smartforms generates XML output which can be viewed through the web
• Multiple page formats are possible in smartforms

Q) How can I insert symbols in Smartforms?
Select the Text node.
Change Editor (Click the button above Check near the Editor)
Go to menu Include->Characters->SAP Symbols
Choose the SAP symbol that you want to insert.

Q) I have a smartform which works fine in DEV. After transporting it to PROD, there is no
Function module generated for this smartform. As a result, my program dumps in PROD?
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
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION fm_name
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.How can I 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.

Q) How can I make the Smartforms display a print preview by default without displaying
the popup for print parameters?
In the SSF_OPEN function module,
Set the OUTPUT OPTIONS parameter 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.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Q) 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
I'm using the variable SFSY-FORMPAGES, I get a star "*" instead of the total number of pages.
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)&

Q) 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

Q) How can I provide a background shading to the table?


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

Q) Where can I provide the input parameters to the smart form?


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

Q) Where can I define my own global types for the smartform?
The global types(within the smartform) 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

Q) 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.

Q) 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.

Q) 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.

Q) What is the difference between Template and Table in Smartforms?


• The Template contains a fixed number of rows and columns, where the output is fixed.
• The Table can have variable number of rows
Q) Where can I define the paragraph and character format for the smartforms?
The paragraph and character format for the smartforms can be defined in the transaction
SMARTSTYLES

Q) How to add watermark to smartform output?


Go to the properties of 'PAGE', tab 'Background Picture'. Add the graphic image name here.

WHAT ARE THE DIFFERENCES BETWEEN SAP SCRIPTS AND SMARTFORMS?

SAP Scripts are client dependent whereas Smartforms are client independent.

SAP Scripts require a driver program to display the output whereas in smartforms the
form routines can be written so that it is standalone.

An Table Painter and Smartstyles to assist in building up the smartforms

An integrated Form Builder helps to design Smartforms more easily than SAP Scripts

It is possible to create a Smartform without a main window

Function module is generated for Smartforms when we are activating it.

Multiple page formats is possible in smartforms.


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

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.
HOW CAN YOU 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.
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:

Page Protection in Smartforms


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.
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 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.

Part 3

SAP ABAP SMARTFORMS Interview Questions and Answers


1.Forcing a page break within table loop
Create a loop around the table. Put a Command node before the table in the
loop that forces a NEWPAGE on whatever condition you want. Then only loop
through a subset of the internal table (based on the conditions in the
Command node) of the elements in the Table node.

2.Font style and Font size


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

3.Line in Smartform
Either you can use a window that takes up the width of your page and only
has a height of 1 mm.
Then you put a frame around it (in window output options).
Thus you have drawn a box but it looks like a line.
Or you can just draw "__" accross the page and play with the fonts so that it
joins each UNDER_SCORE.

4.Difference between 'forminterface' and 'global definitions' in global


settings of smart forms
The Difference is as follows.
To put it very simply:
Form Interface is where you declare what must be passed in and out of the
smartform (in from the print program to the smartform and out from the
smartform to the print program).
Global defs. is where you declare data to be used within the smartform on a
global scope.
ie: anything you declare here can be used in any other node in the form.

5.Smartforms function module name


Once you have activated the smartform, go to the environment -> function
module name. There you can get the name of funtion module name.
The key thing is the program that calls it. for instance, the invoice
SMARTFORM LB_BIL_INVOICE is ran by the program RLB_INVOICE.
This program uses another FM to determine the name of the FM to use itself.
The key thing is that when it calls this FM (using a variable to store the
actual name), that the parameters match the paramters in your smartform.
Another thing to note is that the FM name will change wherever the SF is
transported to.
So you need to use the FM to determine the name of the SF.
Here is the code that can be use to determine the internal name of the
function module:
Code:
if sf_label(1) <> '/'. " need to resolve by name
move sf_label to externalname.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = externalname
importing
fm_name = internalname
exceptions
no_form = 1
no_function_module = 2
others = 3.
if sy-subrc <> 0.
message 'e427'.
endif.
move internalname to sf_label.
endif.
It checks to see if the sf_label starts with a '/', which is how the internal
names start. if it does, the name has already been converted. If not, it calls
the FM and converts the name.
You would then CALL FUNCTION sf_label.

6.Smartforms output difference

Problem with Smartforms: in a certain form for two differently configured


printers, there seem to be a difference in the output of characters per inch
(the distance between characters which gives a layout problem - text in two
lines instead of one.
It happens when the two printers having different Printer Controls' if you go
to SPAD Menu (Spool Administrator Menu) you can see the difference in the
Printer Control and if you make the Printer control setting for both the
printers as same. then it will be ok. and also u have to check what is the
device type used for both the output devices.

7.SmartForms Output to PDF


There is a way to download smartform in PDF format.
Please do the following:
1. Print the smartform 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.

8.SmartForm Doublesided printing question


Your customer wants your PO SmartForm to be able to print "Terms and
Conditinos" on the back side of each page. They don't want to purchase pre-
printed forms with the company's logo on the front and terms & conditions
on the back. Now this presents an interesting problem.
Has anyone else ever had a request like this? If for example there was a 3
page PO to be printed, they want 3 pieces of paper, the front side of each to
containe the PO information (page 1, 2, and 3) and the back side of each
piece of paper to containg the static "Terms & Conditions" information.
Anyone have a clue how to force this out?
Easy - page FRONT lists page CONTACTS as next page and CONTACTS lists
FRONT as next page. Since CONTACTS does not contain a MAIN window, it
will print the contacts info and then continue on to FRONT for the rest of the
main items. Additionally, set print mode on FRONT to D (duplex) and set
CONTACTS to 'blank' (for both resource name and print mode - this is the
only way to get to the back of the page).
Transport Smart Forms

9.How does one transport SMARTFORM? SE01?


How do you make sure that both, the SMARTFORM & it's function
module gets transported? Or does the FM with same name gets
generated automatically in the transported client?
A smartform is transported no differently than any other object. if it is
assigned to a development class that is atteched to a transport layer, it will
be transported.
The definition is transported, and when called, the function module is
regenerated.
This leads to an interetsing situation. On the new machine, it is very likely
the function module name will be different than the name on the source
system. Make sure, before you call the function module, you resolve the
external name to the internal name using the
'SSF_FUNCTION_MODULE_NAME' function module.
Typically, generate the SF, then use the pattern to being in the interface.
Then change the call function to use the name you get back from the above
function module.
Smartforms: protect lines in main window.

10.How to protect lines in the main window from splitting between


pages?
It was easy with SAPscript, but how to do it with SF's. For 4.7 version if you
are using tables, there are two options for protection against line break:
- You can protect a line type against page break.
- You can protect several table lines against page break for output in the
main area.

11.Protection against page break for line types


- Double-click on your table node and choose the Table tab page.
- Switch to the detail view by choosing the Details pushbutton.
- Set the Protection against page break checkbox in the table for the relevant
line type. Table lines that use this line type are output on one page.

12.Protection against page break for several table lines


- Expand the main area of your table node in the navigation tree.
- Insert a file node for the table lines to be protected in the main area.
- If you have already created table lines in the main area, you can put the
lines that you want to protect again page break under the file using
Drag&Drop. Otherwise, create the table lines as subnodes of the file.
- Choose the Output Options tab page of the file node and set the Page
Protection option. All table lines that are in the file with the Page Protection
option set are output on one page.

Smartform to mail as pdf document


CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
IMPORTING
BIN_FILESIZE = V_LEN_IN
TABLES
OTF = I_OTF
LINES = I_TLINE
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
ENDIF.

S-ar putea să vă placă și