Tuesday, February 9, 2010

Smartforms

Smartforms FAQs:-

Q1)+ How to add watermark to Smartform output?
Ans:-  Go to properties of ‘PAGE’
 Click on ‘Background Picture’ tab
 Add the Graphic Image Name here.
This is the way to add watermark to Smartform output.

Q2) Where can I define the paragraph and character format for the Smartforms?
Ans:- The paragraph and character format for the Smartforms can be defined in the
Transaction ‘SMARTSTYLES’.

Q3) What is the difference between Template and Table in Smartforms?
Ans:- * Templates are Static because the number of columns and lines of the
Template Are determined before the actual output. So, the Template
contains fixed number Of rows and columns.
* Whereas, Tables are Dynamic, because the Table size depends on the
amount of data selected at runtime. So, the Table can have Variable
number of rows. This is the difference between Template and Table.

Q4) 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 in
Global Settings => Global Definitions => Form Routines.

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

Q6) How can I provide background shading to the table?
Ans:- In the Table Painter, you can specify the ‘Color’ and ‘Shading’
for the table lines.

Q7) 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 ‘Conditions’ tab where you can specify the condition
to be satisfied to access the node.
Q8) 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.
Q9) What are the differences between SAP scripts and Smartforms?
Ans:- Scripts Smartforms
1) SAP scripts are Client dependent. 1) Smartforms are Client Independent.
2) Multiple page formats are not 2) Multiple page formats are possible
possible in Scripts. in Smartforms.
3) Pages can not be printed with 3) Pages can be printed with background
background pictures. Pictures.
4) Text can not be printed with colors. 4) Text can be printed with colors.
5) In scripts, there is no tool for 5) In Smartforms, Table painter is
printing Data in tabular format. available for printing data in tabular
format.
6) Paragraph and Character formats 6) Paragraph and Character formats
are not reusable. are reusable via SMARTSTYLES.

Q10) How can I insert symbols in Smartforms?
Ans:-  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.

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

Q12) How can I 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.
Q13) How can I 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 parameter TDDEST to your printer name.
Set the 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.

Q14) How can I 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
Q15) I'm using the variable SFSY-FORMPAGES, I got a star "*" instead of the total number of pages. Why?
Ans:-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)&

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

Q17)I have defined my own Program Lines, where I have used a global variable G_TEXT. I got an error G_TEXT is not defined. Why?
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.

No comments:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

goodsites