Documente Academic
Documente Profesional
Documente Cultură
com/wiki/display/ABAP/Smart+Forms+FAQ
Page restrictions apply Attachments:22 Added by Wenceslaus Gnana, last edited by Sandra Rossi on May 27, 2010 (view change) show comment
o o o o o o o o o o o o o
How can I display the total number of pages in Smart Forms? What SFSY system fields are available? Why SFSY-FORMPAGES is output as a star "*" instead of the total number of pages? What are the various text formatting options in Smart Forms? How can I provide a background shading to the table? How to avoid an element to be printed on 2 pages? What is the difference between Template and Table in Smart Forms? Where can I define the paragraph and character format for the Smart Forms? How to print a watermark? How to print barcodes? How is a currency code variable associated to an amount variable? How to draw a single line? How to print Double sided?
Definition of the logic o Where can I provide the input parameters to the Smart Form?
o o o o o
Where can I define my own global types for the Smart Form? Though I declared a global variable, why do I get error variable is not defined? I have created a table node for display. Where can I check the condition which must satisfy to display the table? How to force a page break within a table? How to protect lines against page break?
Execution of Smart forms o How can I make the Smart Forms to choose a printer name by default?
o o o o
How can I make the Smart Forms to display a print preview by default without displaying the popup for print parameters? How to debug Smart Forms? How to get the Smart Form as a PDF? Why there seem to be a difference in the output of characters per inch?
Administration, transport, migration, ... o Why my Smart Form dumps after transporting it to PROD?
o o o
What are the differences between SAPscripts and Smart Forms? Is it possible to migrate SAPscript to Smart Form? Are there demo Smart Forms delivered in SAP system?
Go to menu Include->Characters->SAP Symbols Choose the SAP symbol that you want to insert.
&SFSY-FORMPAGES& Total number of pages in the currently formatted layout set &SFSY-JOBPAGES& Total number of pages in the currently formatted print request
&SFSY-USERNAME& Username &SFSYWINDOWNAME& &SFSY-PAGE& Inserts the number of the current print page into the text. You determine the format of the page number (for example, Arabic, numeric) in the page node &SFSYFORMPAGES& Displays the total number of pages for the currently processed form. This allows you to include texts such as' Page x of y' into your output Contains the name of the current window (string in the Window field)
&SFSY-JOBPAGES& Contains the total page number of all forms in the currently processed print request &SFSY-PAGENAME& Contains the name of the current page (string in the Page field) &SFSYPAGEBREAK& &SFSY-MAINEND& &SFSYEXCEPTION& Is set as soon as processing of the main window on the current page ends Contains the name of the raised exception. You must trigger your own exceptions, which you defined in the form interface, using the user exception macro (syntax: user exception <exception name >) Is set to 'X' after a page break
etc.
Why SFSY-FORMPAGES is output as 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(3CZ)&, or change the window type to Final.
&symbol(.N)& Display upto N decimal places &symbol(T)& &symbol(R)& &symbol(I)& Omit thousands separator Right justified Suppress output of the initial value
Where can I define the paragraph and character format for the Smart Forms?
The paragraph and character format for the Smart Forms can be defined in the transaction SMARTSTYLES
Definition of the logic Where can I provide the input parameters to the Smart Form?
The input parameters for the Smart Form can be defined in Global Settings->Form Interface. The Associated Type must be defined in the ABAP Dictionary.
Where can I define my own global types for the Smart Form?
The global types (within the Smart Form) can be defined in Global Settings->Global Definitions->Types The types defined here will be global through the entire Smart Form. Also the form routines can be defined Global Settings->Global Definitions->Form Routines
Though I declared a global variable, why do I get error variable is not defined?
Whenever using the global variables in the Program Lines, you must enter the variable name in Input Parameters of the if you are going to use/read the variable. If you are going to both read/write the variable, 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 Smart Forms all the nodes have a condition tab where you can specify the condition to be satisfied to access the node.
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.
You can protect several table line types o Expand the main area of your table node in the navigation tree.
o o
Insert a Folder 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 Folder using Drag Drop. Otherwise, create the table lines as sub nodes of the Folder. Choose the Output Options tab page of the Folder node and set the Page Protection option. All table lines that are in the Folder with the Page Protection option set are output on one page.
The "protection" checkbox can be checked in a Text node which is inside a window or folder, but it can't be checked if it's inside a table node (only possible to protect at line type level, see above) or inside a template node (a template is always protected)
The "protection" checkbox can be checked in any Folder node except the ones inside a Table Line Type node (but you can define a protected folder node in a table above table line type nodes) alternatively in a paragraph format use the Page protection attribute to determine whether or not to display a paragraph completely on one page. Mark it if you want to avoid that a paragraph is split up by a page break. If on the current page (only in the main window) there is not enough space left for the paragraph, the entire paragraph appears on the next page.
Execution of Smart forms How can I make the Smart Forms to choose a printer name by default?
In the CALL FUNCTION of the Smart Form 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 Smart Forms 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, 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'.
control_parameters = control user_settings EXCEPTIONS formatting_error internal_error send_error user_canceled OTHERS = 1 = 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. How to debug Smart Forms?
By executing the Smart Form in test mode, the function module editor is displayed, and then you may set break-points (do not add neither BREAK-POINT statement nor BREAK as it pollutes the code, and sometimes it is forgotten to be removed). o If you want to debug a particular Smart Form node, insert a "Program Line" node just above, where you enter BREAK yourUserName statement.
You may also run SFTRACE transaction (or SMARTFORM_TRACE in releases before 6.10) to generate a log and activate break-points when abnormal events occur. For more information, see SAP Library - Smart Form Trace.
If you don't know the smart form name, you may add a break point in SSF_FUNCTION_MODULE_NAME function module to get the name. In some situations, break-points many not be reached, in that case read this wiki: ABAP Debugger.
Administration, transport, migration, ... Why my Smart Form dumps after transporting it to PROD?
It works fine in DEV. After transporting it to PROD, there is no Function module generated for this Smart Form. The Smart Form 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 Smart Form name.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname IMPORTING fm_name EXCEPTIONS no_form = 1 = fm_name = 'ZSMARTFORM'
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 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. What are the differences between SAPscripts and Smart Forms?
See this wiki: Differences between Smart forms and Sap scripts
= 2 = 3 = 4 = 5.
That's a big effort to migrate a SAPscript to Smart Form, so it's better to analyze and create it from scratch Nethertheless, there's a tool to migrate the layout, it can be accessed from SMARTFORMS transaction. See SAP Library - Smart Forms - Migrating SAPscript Forms You may also migrate SAPscript style to Smart Style without loss from SMARTSTYLES transaction You may mass migrate using SF_MIGRATE program There is also FB_MIGRATE_FORM function module
Labels parameters
Labels
Comments (4)
Show Comments