Smart forms Frequently Asked Questions

Forcing a page break within table loop

Create a loop around the table. Put a Command node before the table in the loop that forces a NEWPAGE on whatever condition you want. Then only loop through a subset of the internal table (based on the conditions in the Command node) of the elements in the Table node. 

Font style and Font size

Goto Transaction SMARTSTYLES. 
There you can create Paragraph formats etc just like in sapscript. 

Then in your window under OUTPUT OPTIONS you include this SMARTSTYLE and use the Paragraph and character formats. 

Line in Smartform

Either you can use a window that takes up the width of your page and only has a height of 1 mm. 

Then you put a frame around it (in window output options). 
Thus you have drawn a box but it looks like a line. 

Or you can just draw "__" accross the page and play with the fonts so that it joins each UNDER_SCORE. 

Difference between 'forminterface' and 'global definitions' in global settings of smart forms

The Difference is as follows. 

To put it very simply: 

Form Interface is where you declare what must be passed in and out of the smartform (in from the print program to the smartform and out from the smartform to the print program). 

Global defs. is where you declare data to be used within the smartform on a global scope. 
ie: anything you declare here can be used in any other node in the form. 

Smartforms function module name 

Once you have activated the smartform, go to the environment -> function module name. There you can get the name of funtion module name. 

The key thing is the program that calls it. for instance, the invoice SMARTFORM LB_BIL_INVOICE is ran by the program RLB_INVOICE. 

This program uses another FM to determine the name of the FM to use itself. The key thing is that when it calls this FM (using a variable to store the actual name), that the parameters match the paramters in your smartform.

Another thing to note is that the FM name will change wherever the SF is transported to. 

So you need to use the FM to determine the name of the SF. 

Here is the code that can be use to determine the internal name of the function module: 

Code: 

    if sf_label(1) <> '/'.    " need to resolve by name 
      move sf_label to externalname. 
      call function 'SSF_FUNCTION_MODULE_NAME' 
           exporting 
                formname           = externalname 
           importing 
                fm_name            = internalname 
           exceptions 
                no_form            = 1 
                no_function_module = 2 
                others             = 3. 
      if sy-subrc <> 0. 
        message 'e427'. 
      endif. 
      move internalname to sf_label. 
    endif. 

It checks to see if the sf_label starts with a '/', which is how the internal names start. if it does, the name has already been converted. If not, it calls the FM and converts the name. 

You would then CALL FUNCTION sf_label. 

Get help for your ABAP problems
Do you have a ABAP Question?

ABAP Books
ABAP Programming, Certification, Interview Questions Smartform and SAPscripts  Reference Books

Smartforms Tips
SAP Smartforms Tips and Tricks

ABAP Programming Tips
ABAP and Samples Program Codes for Abapers

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.