Top Interview Questions & Answers | Learn Now

SAP ABAP Smartforms Interview Questions and Answers

Written by sonia | Jan 10, 2018 10:37:47 AM

Q1. What is SAP Smartform?

Ans: Smart Forms are printing forms used to print Invoice and purchase order forms etc. We are calling smartforms from  ABAP programs then spools are generated, now smartform ready to be printed.

SMARTFORMS is the transaction to design the smart form layout.

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

Q2. What are the differences between SAP Scripts and Smartforms?

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

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

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

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

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

Q4. Where can I provide the input parameters to the smartform?

Ans: The input parameters for the smartform can be defined in Global Settings->Form Interface.

The Associated Type must be defined in the ABAP Dictionary.

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

Ans: 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)

Q6. How can I insert symbols in Smartforms?

Ans: Select the Text node.

Change Editor

Go to menu Include->Characters->SAP Symbols

Choose the SAP symbol that you want to insert.

Q7. Where can I define my own global types for the smartform?

Ans: 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

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

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

Q9. I have created a table node for display. Where can I check the condition which must satisfy to display the table?

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

Q10. How can I define Page Protect in Smartforms?

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

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

Ans: SAP-Script is client dependent whereas SMARTFORM is client independent.

Q12. How do you convert a Smartform Output to PDF output?

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

Q13. How can you see the Smartform Print Preview output as list output?

Ans: Type SLIS in the command prompt and hit enter. 

Q14. How do you achieve Bar Code printing in Smartforms?

Ans:

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.

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

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

Q16. How will you print on both sided of a Smartform?

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

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

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

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

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

Ans: 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!

Q20. How do you achieve Page Protection in Smartform ?

Ans: 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

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

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

Q22. Can you have a Smartform without a main window?

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

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

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

Q24. What is a Copies Window?

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

Q25. What is a Final Window?

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

Q26. What is the tcode for SAPScript forms?

Ans: SE71 is the tcode for SAPScript forms. 

Q27. What is PROTECT & ENDPROTECT?

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

Q28. What are the different types of SAPScript symbols?

Ans: 4 different types of SAPScript symbols are as follows.

  • System symbols
  • Standard symbols
  • Program symbols
  • Text symbols

Q29. What are the different window types in SAPScript?

Ans: MAIN – Main window

VAR – Variable window

CONST – Constant window

How many MAIN windows are allowed in SAPscript?

99 main windows are allowed in SAPscript. 

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

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

Q31. How to Debug a SAP Smartform?

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

Q32. What are important trnsacodes used for smartforms?

Ans:

  • 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

Q33. What are the various text formatting options in Smartforms?

Ans:

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

Q34. How do you control printer functions from SAPscript?

Ans: By using PRINT-CONTROL command. 

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

Ans: 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)&. 

Q36. How to debug a SAPScript?

Ans: To switch on the debugger for SAPScript use the menu path Utilities->Debugger or use the program RSTXDBUG.

Q37. What are the different function modules used in SAPScript?

Ans:

  • START_FORM
  • OPEN_FORM
  • WRITE_FORM
  • CLOSE_FORM
  • END_FORM

Q38. How to call a subroutine in SAPScript?

Ans:

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.

Q39. What is difference between SAP Script and Smartform?

Ans:

SAP Script:     

  • Client dependent
  • Multiple page format is not possible
  • Scripts allows only black & white texts.
  • There is no mixture of portrait and landscape format
  • Scripts allows more than one main window
  • This is not support for online.

Smartform:

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

Q40. How to debug SAP Script?

Ans: Goto--- Tocde SE71-->Utilities-->Active Debugger. and then go to Tcode SE38-->give driver program name of SAP Script then click on debug.

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

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