Вы находитесь на странице: 1из 7

SAP ABAP Interview Questions Part 3 : Smartforms

Welcome to yet another post on ABAP interview questions. Here I have complied a list of interview questions on Smartforms in SAP. This list is quite comprehensive. Hope you find it useful. Cheers !! Smartform is SAP's print form technology and is an alternative to SAP-Scripts. Whenever you activate a Smartform , a function module is generated for that Smartform. The program that calls this function module is called the Driver Program for Smartform. The T.code for Smartforms is SMARTFORMS. Unlike SAP-Scripts, Smartforms are client independent. Here we go: *An SAP R/3 system has 2 clients 800 & 810. You create an SAP Script Z_Script and a Smartform Z_Smartform in client 800. Will both Z_Script and Z_Smartform be available in client 810 as well? Client 200 will have just the Smartform Z_Smartform and not the SAP Script Z_Script. SAP-Script is client dependent whereas SMARTFORM is client independent. Many people don't understand what this is all about. The above answer should suffice. However, if you still do not understand this, find an SAP system where you have 2 clients. Create a dummy Smartform / script in one client and check whether they exist in the other client. *You have created a Smartform in DEV environment. Then you migrated the Smartform to PROD environment. Will the name of the function module be same in DEV and PROD? Once you transport the Smartform from DEV to PROD environment, a new function module name for the Smartform in generated in the PROD environment. For a particular Smartform , generated function module names are different in different systems.One can get the name of the function module for Smartform by passing the Smartform name to FM SSF_FUNCTION_MODULE_NAME. Hence in the driver program for Smartform, it is common practice to use FM SSF_FUNCTION_MODULE_NAME and then calling the Smartform Function Module. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'Z_SMARTFORM' IMPORTING fm_name = lv_fm_name CALL FUNCTION lv_fm_name *How do you convert a Smartform Output to PDF output?

There is a tricky solution here.But let's keep that for the last. Let us first discuss the conventional way of getting a PDF output for Smartform. For that you need to keep in mind 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 ZDEMO. Step 2: For Smartform, create a character format C1 and use the recently created Barcode ZDEMO.

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.

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.

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 i.e. you can have a internal table with contents associated to a Table element but not to a Template. You 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:

Note: You have Page-protection property only for Text Elements in the Main Window. 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. Whenever you create a Smartform, a main window is created by default. I can't think of a situation , where you will have a situation in which it is mandatory for you to remove the Main Window. But still I have seen this question in ABAP interviews. So I have put it here. How do you find the name of the Function Module for a Smartform? When is this function module created? 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? What is a Final Window? Final Window is called after all the other windows are called in a Smartform. How do you pass data to Smartforms from the driver program? How do you Debug Smartforms ? How would you go about printing a logo in a Smartform? How do you print address number in Smartforms ? How do you print Symbols and Icons in Smartforms? What are Basic Nodes and Auxiliary Nodes ? What is the use of Folder in Smartforms ?

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. I have a smartform which works fine in DEV. After trasnsporting 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 EXCEPTIONS no_form =1 = fm_name

no_function_module = 2 OTHERS IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. = 3.

CALL FUNCTION fm_name EXCEPTIONS formatting_error = 1 internal_error = 2 send_error user_canceled OTHERS 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. How can I 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'. =3 =4 = 5.

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 send_error user_canceled OTHERS =2 =3 =4 = 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. Screen Painter To use ALV in dynpro, create only a container in the dynpro. In ABAP code (PBO/PAI), you have to use SALV class to create the list in the container of dynpro. It is much more effective than to use the type Pool SLIS and function REUSE_ALV_GRID_DISPLAY For example, you can then properly connect the screens with levels of different details or make fields of the list seizable by the users.