Ads

SAP ABAP SMARTFORMS

SAP ABAP SMARTFORMS

Smart Forms in SAP ABAP. SAP Smart Forms is used to create and maintain forms for bulk printing on SAP systems. As an output medium, SAP Smart Forms supports a printer, fax, email, or the Internet (using the generated XML output). SAP introduced SmartForms in 1998 to overcome the limitations in SAP Scripts.


What are SMARTFORMS in SAP ABAP

Smart Form technology allows you to design print forms. ABAP programs need to "call them" for spools to be generated, ready to print.

SMARTFORMS is the transaction for designing the smart form layout.

It is possible to incorporate texts, images, tables, bar codes.

The import parameters must be defined so that an ABAP program can send the data to be printed.
When the smart form is activated, a function module is generated that an ABAP program must call. You should never assume the name of this function module because it can change on each system after the import. See below how to do it.

Transaction SMARTSTYLES allows you to define paragraph and character formats (fonts, bar codes, etc.)

Although the ABAP code can be inserted into the Smart Form, it is best not to do so and have the ABAP caller program pass all data through parameters. 

This will make it easy to convert to interactive Adobe forms. 

The only ABAP code
that needs to remain in Smart Form is the part that handles page break processing (sub-totals and so on).

Smart Form technology has replaced SAPscript technology since the 4.6C release and has been replaced by Interactive Forms by Adobe since release 6.40.

Uses of SMARTFORMS

The SAP Smart Forms tool can be used to print and send documents. This tool is useful in developing forms, PDF files, e-mails and documents for the Internet. The tool provides an interface for creating and maintaining the layout and logic of a form. SAP also offers a selection of forms for business processes, such as those used in CRM, Sales and Distribution (SD), Financial Accounting (FI) and Human Resources (HR).

The tool allows you to modify forms using simple graphing tools instead of using any programming tool. This means that a user with no programming knowledge can configure these forms with data for an effortless business process.

In a Smart Form, data is retrieved from static and dynamic tables. The table header and subtotal are specified by the triggered events, and the data is sorted before the final output. A Smart Form allows you to embed graphics that can be displayed as part of the form or as a background. You can also suppress a background graphic, if necessary, while you print a form.

Some examples of standard Smart Forms available in the SAP system are as follows -

SF_EXAMPLE_01 represents an invoice with table output for flight reservation for a customer.

SF_EXAMPLE_02 represents an invoice similar to SF_EXAMPLE_01, but with subtotals.

SF_EXAMPLE_03 specifies an invoice similar to SF_EXAMPLE_02, but one in which multiple clients can be selected in an application program.

Difference Between SMARTFORMS and SAP Scripts


Multiple page formats are possible in Smart Forms, which is not the case in Sap Scripts.

It is possible to have a Smart Form without a main window.

Labels can not be created in Smart Forms.
Routines can be written to the Smart Forms tool.
Smart Forms generates a function module when enabled.
The script is customer dependent, while the smart form is client independent.



In scripts, we have to write print programs, while in smart forms, it is not necessary.

In scripts, we can print the background logo, while in smart ways, we can not print the background logo

In the scripts, we have 99 main windows, while in smart forms, we have only 1 main window.

In scripts, we should write the paragraph format, otherwise we can not run the program while we are in smart forms, it is not necessary to create paragraph formats.

In scripts, we can print text in only two character formats.

while in intelligent ways, we can do more.

In scripts, we do not have linetypes, whereas in smart forms we have linetypes.

How to Create SMARTFORMS

Enter the transaction SMARTFORMS in the transaction code box.
On the next screen, enter a form name and click Create.
Smart Forms in SAP ABAP

The next screen is divided into three sections


The navigation window consists of nodes and subnodes. They contain all the elements (text, window etc) that belong to sap forms

Maintenance window shows attributes of elements
Form Printer Window Shows Page Layout
Whenever we create smart forms, SAP creates / generates a function module. Unlike SAPscripts, SAP FORMS allows you to change the language.

In the navigation window you will find

Global data declarations: The data defined here can be used in any intelligent way for coding purposes.

Form Interface: Here all the data that will be passed to the smartform from the Print program are defined.

Smart Forms in SAP ABAP

Right clicking on the pages will allow you to create a new page, window, graphic or address.

Smart Forms in SAP ABAP

Printing will be done based on the "next page" field.

But the processing will happen according to the sequence in the navigation window!

Smart Forms in SAP ABAP

For background images and graphics, you can get bitmap images in black and white or colored and are stored as standard texts. You can make a detour on the smart screen and open the Form Graphics screen. Transaction code: Se78


Smart Forms in SAP ABAP


Configuration in the Graph window in Smart Form

Smart Forms in SAP ABAP

Windows in Smart Forms
Smart Forms in SAP ABAP

There are two types of windows


the main
Secondary
Important points to observe

You can not have more than one main window on one page. You can have multiple secondary windows
Whatever you print in the secondary window ... has to be static. (If you have 20 lines in a PO and there is a page restriction, the lines will be transported to the next page in the main window, that is, in a predecessor and successor content type, they will be printed in sequence in the main window. secondary windows.
Smart Forms in SAP ABAP


Inside the main window, we can add text as an introduction to customize the output of the form.

Smart Forms in SAP ABAP

The Output options in each window determine the size of the line, width, colors, and background to be placed.

Smart Forms in SAP ABAP

Smartforms gives you the option of providing the address number that is maintained in the central address management. The address will be taken directly from the ADRC table and will be filled in the form.

Smart Forms in SAP ABAP

The two different editors are available in Smartforms viz. Normal editor

Smart Forms in SAP ABAP

and the graphics editor.


Smart Forms in SAP ABAP

This setting can be changed using the Configure Editor in Utilities.

In the Table Builder, you can draw the format as required by the customer (for example, Header, Subhead, Item, Subtotal, Grand Total, etc.)

You can use the table layout to determine:

The number of rows and cells
The height of each line
The width of each cell
Aligning the table in the window
Smart Forms in SAP ABAP


The table shows the different line types that will be used in the table. Line types define the size of each cell and the number of cells in each row.

Smart Forms in SAP ABAP

Smart Forms Programming Flow
When an SAP Smart Form template is created, a user creates the form layout, defines the special fields, conditions, and programming instructions required in the Smart Form template using Smart Form Builder.

After the form design is complete, the form must be activated before it can be tested or accessed by the print programs. Form activation initiates the generation of a function module that handles all form processing.

This function module interacts with the application program / print program to create output on user-defined output media for the specified device.

In the case of smart forms, we use two function modules to process the smart form. For the first function module, we pass the name of the smart form as the import parameter. This then returns the name of the dynamically generated function module that will actually call the smartform.

The smart form name can be passed to the Module function - 'SSF_FUNCTION_MODULE_NAME'



How to Debug SMARTFORMS

First of all, go to the transaction code SMARTFORMS, 

Enter the name of the form and press the button Execute.




After you run the function module, it will generate the function module and click on the display function module.
How to debug Smartforms in SAP ABAP
Then, press the source code function module and click Run GLOBAL_INIT subroutine.
How to debug Smartforms in SAP ABAP
Then enter the breakpoint where you want it and run it and it will take you to debug mode.

SMARTFORMS interview Questions and Answers


What is smartform?
Smart forms are print forms used to print invoice forms and purchase orders, etc. We are calling smartforms from ABAP programs, then spools are generated, now smartform ready to be printed.


SMARTFORMS is the transaction for designing the smart form layout.

SMARTSTYLES are used to define paragraph and character formats (fonts, bar codes, etc.)

What are the differences between SAP Scripts and Smartforms?
SAP scripts are client dependent, while Smartforms are client independent.

SAP Scripts require a driver program to display the output, whereas in smartforms the form routines can be written in a way that is autonomous.
A Table Painter and Smartstyles to assist in building smartforms

An integrated Form Builder helps design Smartforms more easily than SAP Scripts
You can create a smart shape without a main window
The function module is generated for Smartforms when we activate it.

Multiple page formats are possible in smartforms.
I have a smartform that works fine on the development server. After you transpose to Production, there is no Function module generated for this smartform. Because my program turns out to be production? How to solve this?
The smart way that is created in development may not have the same name on the production server. Therefore, it is always advisable to use Function Module SSF_FUNCTION_MODULE_NAME to get the name of the Function Module by passing the name Smartform.

DATE: fm_name TYPE rs38l_fnam.

CALL FUNCTION "SSF_FUNCTION_MODULE_NAME"
EXPORTER
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

END IF.



Finally ,We learnt total overview on SAP ABAP SMARTFORMS

IDOC in SAP ABAP

Comments

Popular posts from this blog

BADI Interview Questions in SAP ABAP

Sample SAP ABAP Programming Examples for Practice

Module Pool Programming Interview Questions and Answers in SAP ABAP

Step by Step tutorial on BDC Session Method Program in SAP ABAP

SAP ABAP Interview Questions and Answers for 10 Years Experienced