Smartforms information

send me questions and answers on modify smartforms, bapi(open purchase order), alvs and lsmw. do not send any links ...
Edited by: Alvaro Tejada Galindo on Apr 23, 2008 9:45 AM

You want some link? Here they are -;)
[Google|http://www.google.com]
[SDN|http://sdn.sap.com]
[SAP Help|http://help.sap.com]
[SAP Marketplace|http://service.sap.com]
Please search yourself...There's a lot of info available on the web...
Greetings,
Blag.

Similar Messages

  • Class for Smartform information

    Hi,
    I am workin on creating a tool whihc will help in understanding the Smartform at quality check...
    The very start of the code... i want a class which will help me in checking whether the smartform exists or not.. or a class whihc will hold all the properties of a smartform.
    Like a Adobe form - CL_FP_WB_FORM - this class has all the methods.. through which information can be gained.
    Thanks,
    Poonam

    In t code smartforms enter some smartform name whether it exists or not and DEBUG.
    u will came to know which clases are involved in smartforms-open , create and change operations.

  • Regarding smart forms (really urgent)

    hi,
    i am new to smartforms and i got report to make changes in the smart forms,plzz help me out as i know nothing about the smart forms by providing me it in easiest & simplest form.
    if find useful help will be deifnately rewarded.
    Edited by: ric .s on Mar 6, 2008 5:16 AM

    Hi,
    This Smartform Information I read, really helped me out.
    I think it would be of some good help to you too..
    What is SAP Smart Forms?
    SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms. 
    SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can  configure forms with data from an SAP System for the relevant business processes.
    To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
    You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
    You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
    SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
    SAP Smart Forms also support postage optimizing.
    Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
    What Transaction to start SAP Smart Forms?
    Execute transaction SMARTFORMS to start SAP Smart Forms.
    Key Benefits of SAP Smart Forms:
    SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time. 
    You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
    To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
    These actions do not include writing of coding lines or using a Script language.
    Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one. 
    For Web publishing, the system provides a generated XML output of the processed form.
    Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
    Advantages of SAP Smart Forms
    1. The adaption of forms is supported to a large extent by graphic tools for layout and logic, so that no programming knowledge is necessary (at least 90% of all adjustments). Therefore, power user forms can also make configurations for your business processes with data from an SAP system. Consultants are only required in special cases.
    2. Displaying table structures (dynamic framing of texts)
    3. Output of background graphics, for form design in particular the use of templates which were scanned.
    4. Colored output of texts
    5. User-friendly and integrated Form Painter for the graphical design of forms
    6. Graphical Table Painter for drawing tables
    7. Reusing Font and paragraph formats in forms (Smart Styles)
    8. Data interface in XML format (XML for Smart Forms, in short XSF)
    9. Form translation is supported by standard translation tools
    10. Flexible reuse of text modules
    11. HTML output of forms (Basis release 6.10)
    12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-Release 6.10)
    A Simple Smartform Tutorial 
    SAP Smartforms can be used for creating and maintaining forms for mass printing in SAP Systems. The output medium for Smartforms support printer, fax, e-mail, or the Internet (by using the generated XML output). 
    According to SAP, you need neither have any programming knowledge nor use a Script language to adapt standard forms. However, basic ABAP programming skills are required only in special cases (for example, to call a function module you created or for complex and extensive conditions). 
    1. Create a new smartforms
    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table 
              Pages and windows
    •     First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page) 
    •     Main windows -> TABLE -> DATA
    •     In the Loop section, tick Internal table and fill in
    •     ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
               Global settings :
               Form interface
               Variable name    Type assignment   Reference type
               ITAB1               TYPE                  Table Structure
               Global definitions
               Variable name    Type assignment   Reference type
               ITAB2               TYPE                  Table Structure 
    4. To display the data in the form 
        Make used of the Table Painter and declare the Line Type in Tabstrips Table
         e.g.  HD_GEN for printing header details,
                 IT_GEN  for printing data details. 
         You have to specify the Line Type in your Text elements in the Tabstrips Output options.
          Tick the New Line and specify the Line Type for outputting the data.
          Declare your output fields in Text elements 
          Tabstrips - Output Options
          For different fonts use this Style : IDWTCERTSTYLE
          For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    5. Calling SMARTFORMS from your ABAP program 
    REPORT ZSMARTFORM. 
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by :  SAP Hints and Tips on Configuration and ABAP/4 Programming
                        http://sapr3.tripod.com
    TABLES: MKPF. 
    DATA: FM_NAME TYPE RS38L_FNAM. 
    DATA: BEGIN OF INT_MKPF OCCURS 0.
            INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF. 
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001. 
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
       MOVE-CORRESPONDING MKPF TO INT_MKPF.
       APPEND INT_MKPF. 
    ENDSELECT. 
    At the end of your program.
    Passing data to SMARTFORMS 
    call function 'SSF_FUNCTION_MODULE_NAME'
      exporting
        formname                 = 'ZSMARTFORM'
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
      IMPORTING
        FM_NAME                  = FM_NAME
      EXCEPTIONS
        NO_FORM                  = 1
        NO_FUNCTION_MODULE       = 2
        OTHERS                   = 3. 
    if sy-subrc <> 0.
       WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif. 
    call function FM_NAME
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        GS_MKPF                    = INT_MKPF
      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.
    Additional Fonts for your SMARTFORMS 
    You can create additional fonts and style with transaction SMARTSTYLES
    This can then be define in the paragraph and character formats, which you can then be assign to texts and fields in the Smart Form. 
    The character formats includes effects such as superscript, subscript, barcode and font attributes.
    Difference with SMARTFORMS vs. SapScript(SE71)
    The Following are the differences :-
    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
    b) It is possible to have a smartform without a main window .
    c) Labels cannot be created in smartforms.
    d) Routines can be written in smartforms tool.
    e) Smartforms generates a function module when activated.
    f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk. 
    It was said that it was provided in CRM 3.0 version, but not available in R/3.  You can download smartforms into Local PC in a XML format.  In the same way you can upload this XML format into Smartform.  From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment. 
    In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
    In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk. 
    For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people.  What you can do is to create a Transport and then FTP down to your local harddisk.   When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server.  Finally, the Basis team, will tp it into your system.
    g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it.  Actually, there is something you can do about it.  By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
    FAQ on Migrating SAPscript to SmartForms
    Is it possible to migrate a SAPscript form to a Smart Form? 
    Smart Forms provides a migration tool for this purpose which migrates layout and texts of a SAPscript form to a Smart Form. It does not migrate SAPscript form logic of the print program. Using Smart Forms, this logic is described by the tree structure of the Form Builder. The effort involved in migrating it depends on the complexity of the print program. 
    Which Basis Release do I need to use SAP Smart Forms? 
    SAP Smart Forms is available as of R/3 Basis Release 4.6C. 
    I have heard that Smart Forms replaces SAPscript. What does "replace" mean? 
    It does not mean that SAPscript is removed from the Basis shipment. Even as of Basis Release 4.6C, SAPscript remains part of the SAP standard and there are no plans to remove it. Since Smart Forms is currently, and will continue to be, the tool for form maintenance for mySAP.com solutions, our further development efforts will focus on Smart Forms, not on SAPscript.
    Do we have to migrate all SAPscript forms to Smart Forms? 
    There is no point in migrating all SAPscript forms already in use. Since SAPscript can still be used and will be available in the future, there is no need to. If you plan to migrate a SAPscript form, it is recommended that you check whether benefit is worth the effort involved
    Conversion of SAPSCRIPT to SMARTFORMS
    SAP provides a conversion for SAPscript documents to SMARTforms.
    This is basically a function module, called FB_MIGRATE_FORM. You can  start this function module by hand (via SE37), or create a small ABAP which migrates all SAPscript forms automatically.
    You can also do this one-by-one in transaction SMARTFORMS, under 
    Utilities -> Migrate SAPscript form.
    You could also write a small batch program calling transaction SMARTFORMS and running the migration tool.
    SmartForms System Fields
    Within a form you can use the field string SFSY with its system fields. During form processing  the system replaces these fields with the corresponding values. The field values come from the  SAP System or are results of the processing.
    System fields of Smart Forms
    &SFSY-DATE& 
    Displays the date. You determine the display format in the user master record.
    &SFSY-TIME& 
    Displays the time of day in the form HH:MM:SS.
    &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. 
    &SFSY-FORMPAGES& 
    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. 
    &SFSY-JOBPAGES& 
    Contains the total page number of all forms in the currently processed print  request. 
    &SFSY-WINDOWNAME& 
    Contains the name of the current window (string in the Window field)
    &SFSY-PAGENAME& 
    Contains the name of the current page (string in the Page field)
    &SFSY-PAGEBREAK& 
    Is set to 'X' after a page break (either automatic [Page 7] or  command-controlled [Page 46])
    &SFSY-MAINEND& 
    Is set as soon as processing of the main window on the current page ends
    &SFSY-EXCEPTION&
    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 >).
    Example Forms Available in Standard SAP R/3
    SF_EXAMPLE_01 
    Simple example; invoice with table output of flight booking for one customer
    SF_EXAMPLE_02 
    Similar to SF_EXAMPLE_01 but with subtotals
    SF_EXAMPLE_03 
    Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the  form is called for each customer and all form outputs are included in an output request
    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.
    Smartforms FAQ Part Two
    Smartforms output difference
    Problem with Smartforms: in a certain form for two differently configured printers, there seem to be a difference in the output of characters per inch (the distance between characters which gives a layout problem - text in two lines instead of one.                                      It happens when the two printers having different Printer Controls' if you go to SPAD Menu (Spool Administrator Menu) you can see the difference in the Printer Control and if you make the Printer control setting for both the printers as same. then it will be ok. and also u have to check what is the device type used for both the output devices. 
      SmartForms Output to PDF
    There is a way to download smartform in PDF format.
    Please do the following:
    1. Print the smartform to the spool.
    2. Note the spool number.
    3. Download a PDF file (Acrobat Reader) version of the spool by running Program RSTXPDFT4 and entering the noted spool number.
      SmartForm Doublesided printing question  Your customer wants your PO SmartForm to be able to print "Terms and Conditinos" on the back side of each page. They don't want to purchase pre-printed forms with the company's logo on the front and terms & conditions on the back. Now this presents an interesting problem. 
    Has anyone else ever had a request like this? If for example there was a 3 page PO to be printed,  they want 3 pieces of paper, the front side of each to containe the PO information (page 1, 2, and 3) and the back side of each piece of paper to containg the static "Terms & Conditions" information. 
    Anyone have a clue how to force this out? 
    Easy - page FRONT lists page CONTACTS as next page and CONTACTS lists FRONT as next page. Since CONTACTS does not contain a MAIN window, it will print the contacts info and then continue on to FRONT for the rest of the main items. Additionally, set print mode on FRONT to D (duplex) and set CONTACTS to 'blank' (for both resource name and print mode - this is the only way to get to the back of the page). 
      Transport Smart Forms
    How does one transport SMARTFORM? SE01?  
    How do you make sure that both, the SMARTFORM & it's function module gets transported? Or does the FM with same name gets generated automatically in the transported client? 
    A smartform is transported no differently than any other object. if it is assigned to a development class that is atteched to a transport layer, it will be transported. 
    The definition is transported, and when called, the function module is regenerated. 
    This leads to an interetsing situation. On the new machine, it is very likely the function module name will be different than the name on the source system. Make sure, before you call the function module, you resolve the external name to the internal name using the 'SSF_FUNCTION_MODULE_NAME' function module. 
    Typically, generate the SF, then use the pattern to being in the interface. Then change the call function to use the name you get back from the above function module. 
      Smartforms: protect lines in main window.
    How to protect lines in the main window from splitting between pages? 
    It was easy with SAPscript, but how to do it with SF's.   For 4.7 version if you are using tables, there are two options for protection against line break: 
    - You can protect a line type against page break.
    - You can protect several table lines against page break for output in the main area.
    Protection against page break for line types 
    - Double-click on your table node and choose the Table tab page. 
    - Switch to the detail view by 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. 
    Protection against page break for several table lines 
    - Expand the main area of your table node in the navigation tree. 
    - Insert a file 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 file using Drag&Drop. Otherwise, create the table lines as subnodes of the file. 
    - Choose the Output Options tab page of the file node and set the Page Protection option.   All table lines that are in the file with the Page Protection option set are output on one page. 
    Regards,
    Rohini.

  • Need information on SMARTFORMS

    hi i m looking for some information on SMARTFORMS.
    why it is needed?
    what is difference between smartforms and sapscripting?
    if someone could send some docs. how to work on smartforms it will begreat

    Hi,
    Here I am sending the full information about smartforms. Reward if helpful.
    SAP Smart Forms (BC-SRV-SCR)
    Purpose
    You use SAP Smart Forms to create and maintain forms for mass printing in SAP Systems. As output medium SAP Smart Forms support a printer, a fax, e-mail, or the Internet (by using the generated XML output).
    In addition to the tool, SAP delivers a selection of forms for central business processes. This includes forms in Customer Relationship Management (CRM) as well as in the applications SD, FI, and HR of the R/3 Release.
    SAP Smart Forms offer the following advantages:
    •     Creating and maintaining forms requiring half the time
    •     Adapting forms without any programming knowledge due to entirely graphical user interface
    •     Web Publishing using the generated XML output
      The SAP Smart Forms replace the SAPscript forms. SAPscript forms will also be supported in the future; you can use them without making any changes for years to come. You can use SAPscript texts in the Smart Forms. Migration of SAPscript forms into Smart Forms is supported.
    Features
    SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can configure forms with data from an SAP System for the relevant business processes.
    To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
    You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics. To make changes, use Drag&Drop, Copy&Paste, and select different attributes. These actions do not include writing of coding lines or using a Script language.
    For Web publishing, the system provides a generated XML output of the processed form.
    You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
    You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
    SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
    SAP Smart Forms also support postage optimizing.
    General Concepts on Form Printing
    Form printing covers creating and maintaining a form for mass printing in SAP Systems. This includes design and layout of the form as well as form logic.
    The layout determines the page structure, that is the number of differently structured pages and the positions of the output areas on these pages. Within the output areas, you use tables, paragraphs, paragraph formats and character formats to structure and format texts and data.
    The form logic controls the dynamic formatting of the form. It allows you to display variable fields, to display texts only if a certain condition is true (for first dunning, use this text, for second dunning another), or to repeatedly process invoice items within a table.
    Forms can be:
    •     Order confirmations
    •     Invoices
    •     Account statements
    •     Checks
    •     Salary statements
    •     Delivery notes
    •     Customs forms
    •     Industry-specific forms, such as quality forms in automobile manufacturing
    The concepts on form printing presented below are independent of any tool. As of mySAP.com release 4.6C use the SAP Smart Forms [Extern] in SAP Systems.
    This documentation does not cover document output and control on printers. Description of the process ends with transferring a processed file to the output management, which in the R/3 System is the spool.
    Structure of a Form
    Definition
    A form consists of pages, output areas, addresses, graphics (such as company logo), and data or text contents. Within an output area, you can use static or dynamic tables to display data or texts in lines, columns, or cells. To further structure and format text and data, use paragraphs with the paragraph and character formats.
    SAP calls output areas "windows". You can position windows freely on a page (see also Pages of a Form [Seite 8] and Main Windows and Subwindows [Seite 8]).
    Example of a Form Structure
    We use a simple invoice. For certain customers, we display their flight bookings with prices in a table in a window. The invoice also contains other windows for the company logo, the sender address, the customer address, company-specific data (clerk, customer number, reference, date, and so on), bank data, and pagination.
    The first page displays the customer letter, followed by a table containing the flight bookings of that customer. The output length of the table depends on the number of booking items (dynamic table). The table header contains the column headings, the table footer contains the total. If the space on the first page is not sufficient to take all items, the table continues on the next page, thereby repeating the column headings. In addition, the first page contains:
    •     the company logo inserted as graphic in bitmap format.
    •     the customer address. This address appears only on the first page (for the window in the envelope) and is preceded by the sender address in small font.
    •     a window containing company-related data in several fonts and font sizes (invoice, clerk, phone/fax, reference, customer number, date).
    •     the footer containing the company and bank data.
    The second page contains the current page number and the total number of pages in the document.
    Pages of a Form
    Definition
    On the pages of a form you determine the page layout and the sequence of pages with different structures.
    The page layout includes the page format (for example, DIN A4, Letter, DIN A5 landscape) and the position of the windows on a page.
    Use
    The individual pages of a form differ in their structure. The first page of an invoice, for example, contains the address, which you do not want to display on the next page; and you want to display the General Terms of Business on the last page. For each page, you must specify a next page to make the page sequence clear. You can also repeatedly call the same page if you want recursive output (for example, if the list of invoice items is very long and does not fit onto one document page).
    The page break either is triggered automatically by the main window (see also Main Window and Subwindows [Seite 8]) or you code it manually into the form logic (see also Specifying the Page Sequence [Seite 52]).
    Many forms contain only two pages of different structure: the first page, which calls the next page, and the next page, which calls itself. If the text does not entirely fit onto the second page, another document page is automatically displayed.
    Main Window and Subwindows
    Definition
    On a page, there are two different types of output areas for texts and data: the main window and the subwindow.
    Use
    You can position windows anywhere on a page, even overlapping. You can position the same window (determined by the technical name) on several pages of a form, so that the same contents are displayed on all these pages. You can choose a different size for the window on each page, except for the main window.
    Main Window
    In a main window you display text and data, which can cover several pages (flow text). As soon as a main window is completely filled with text and data, the system continues displaying the text in the main window of the next page. It automatically triggers the page break.
    You can define only one window in a form as main window.
    The main window must have the same width on each page, but can differ in height.
    A page without main window must not call itself as next page, since this would trigger an endless loop. In such a case, the system automatically terminates after three pages.
    Subwindows
    In a subwindow you display text and data in a predetermined output area. There is no flow text display with page break. If you position a subwindow with the same name on several pages, the system displays the contents of this subwindow on each page.
    Text and data that do not fit into the subwindow are truncated and not displayed.
    Texts and Data in a Form
    Definition
    You enter text in an editor (see also Positioning Text on a Form [Seite 26]).
    Data can be character strings or numbers. The system reads this data from a database and uses fields (parameters) to dynamically display it (see also Using Parameters in a Form [Seite 37]).
    Use
    To display text and data in table format (for example, lists or invoice items), you use tables or templates.
    To format texts and fields (data), you use paragraph and character formats. You assign paragraph formats to entire paragraphs and character formats to individual character strings, for example, to highlight a word.
    The paragraph format determines:
    •     Font family and font size,
    •     Indents and spacing,
    •     Text alignment within the paragraph,
    •     Tabs,
    •     Outline options, such as numbering,
    •     Protection of paragraphs against page breaks.
    To determine the paragraph and character formats, use the Smart Styles (see also Smart Styles [Seite 54]).
    Overview
    This section describes the architecture  [Seite 10]of SAP Smart Forms and how to create a form [Seite 11]. Essential for creating forms is to understand the form logic [Seite 13].
    Architecture
    If you create forms for an application, you want to include application data into the form. The architecture of SAP Smart Forms separates application data retrieval from the actual definition of the form:
    In a Smart Form you describe:
    •     The layout of your form (element positions on a page)
    •     Individual elements you want to display (text, graphics, addresses, tables, and so on)
    •     the form logic you use, for example, to read application data from internal tables, to introduce conditions, and to control process flows (see also: Form Logic: Introduction [Seite 13])
    •     a form interface to transfer application data to the form definition
    When you activate the Smart Form, the system generates a function module that encapsulates all attributes of the Smart Form. As soon as the application program calls the function module, the Smart Form uses the modules interface (which corresponds to the form interface) to transfer any table data previously selected and to print the form according to the form description.
    The form description can also contain statements that select further data during form processing. However, you should not use this method of data retrieval. Especially if you print mass forms, performance will deteriorate considerably.
    Creating Forms Using SAP Smart Forms
    This section gives an overview of how to create a form in which to display application data from database tables.
    For more detailed information on this procedure, see Using SAP Smart Forms [Seite 14].
    When creating a form, you must:
    1.     Retrieve the application data [Seite 11].
    2.     Describe your form [Seite 12].
    3.     Pass the application data to the form [Seite 38].
    Printing the Form
    Call a function module generated by Smart Forms to print your form. Smart Forms support the forllowing output options:
    •     The form is printed on a printer connected to the SAP System. Before printing, use the print preview to check whether the form is correct.
    •     The function module generates an XSF datastream that transfers, for example, the form description including the retrieved data to programs of third-party companies.
    Retrieving Application Data
    Prerequisites
    To achieve a good performance when printing a form, you must separate data selection from the use of data in the form. Thus you can bundle database operations before you start processing the form.
    Before you retrieve data, you should know:
    •     Which application data you want to appear in the form
    •     Which database tables you must access to retrieve this data
    Process Flow
    Write an ABAP program to retrieve data or include a retrieval routine into your application. This code consists of statements that select data from the database according to certain selection criteria. Store the retrieved data in internal tables, structures, or variables and transfer it to the form in one step.
    While you initialize the form, you can format the data, which you passed to the form, for output in the form. Formatting data in the form and not in the data retrieval program allows you to use one data retrieval program for several forms with different formatting routines.
    Result
    You store the application data in internal tables of the data retrieval program. Since you know now which table types occur, you can define a form interface to transfer this data to the appropriate form.
    Describing the Form
    You describe a form using a Smart Form. To do this, use the Form Builder (see also: Graphical User Interface [Seite 15]):
    1.     Describe the interface of the form. It results from the application data previously selected.
    2.     Create one or more pages. On a page, you can position windows, addresses, and graphics. Within a window, you can create additional elements.
    3.     Create elements (text, graphics, tables, and so on) for each page, using other tools of the Form Builder:
    &#61485;     Use the Form Painter [Seite 17] to position windows, graphics, and addresses on a page (the other elements are displayed in an assigned window).
    &#61485;     Use the PC Editor [Seite 19] to write your texts.
    &#61485;     Use the Table Painter [Seite 20] to format your tables.
    For an overview of the elements available on page level, see Node Types: Overview [Seite 23].
    4.     Use the flow control [Seite 50] to control whether and when to print pages and elements.
    Result
    When you activate your Smart Form, the Form Builder generates a function module that encapsulates the form description.
    Form Logic: Introduction
    In the Form Builder you describe a Smart Form by a set of nodes. To do this, you build up a tree structure on the left side of the user interface:
    This graphic already contains some nodes. The node Global Settings as well as its three successors Form attributes, Form interface, and Global definitions always exist for any newly created forms. To describe the Form logic, create a hierarchy under the node Pages and windows. This hierarchy determines the rules used to process the nodes of the tree. Depending on the node type, this could include:
    •     printing the node contents (text, addresses, graphics).
    •     executing the node statements.
    •     executing the successors of a node according to other rules (for example, in a loop).
    You use the form logic to control the flow of the form output. The following rules apply throughout:
    1.     The nodes in the tree structure are processed from top to bottom. This is easier to understand, if you imagine all nodes to be expanded.
    2.     For each node there is a tab, which you can use to link the node to a condition [Seite 51]. If the condition is true, the system processes the node. If not, it skips the node and all its successors.
    3.     You must define a next page for each page. However, you can also go to other pages dynamically (see also: Flow Control [Seite 50]).
    In addition, the page break depends on how much space there is left on the current page.
    For the complete rules for processing the tree structure, see Processing a Form [Seite 63].
    Example for Form Logic
    The diagram below shows the tree structure of the root node Pages and windows:
    The numbering of the nodes also shows the sequence in which they are processed (from top to bottom). The first node is the root node. The successors of a node are all nodes included directly under this node in the hierarchy. For node 5 these are the nodes 6 to 9 (direct successors are only the nodes of the next hierarchy level, that is 6, 7, and 9).
    A node without a successor node is also called end node. Elementary nodes can never have successors (see also Node Types: Overview [Seite 23]). If the condition of node 7 is false, neither node 7 nor node 8 are processed. Processing resumes directly with node 9.
    In this example, we assume that no pages are called dynamically and that there is enough space on the page for the output.
    Using SAP Smart Forms
    Graphical User Interface
    Use
    SAP Smart Forms provide a graphical user interface that helps you create and maintain the layout and the form logic of a form: the SAP Form Builder. You need neither have any programming knowledge nor use a Script language to adapt standard forms. Basic ABAP programming skills are required only in special cases (for example, to call a function module you created or for complex and extensive conditions).
    Features
    The SAP Form Builder of the SAP Smart Forms consists of:
    •     Form Painter for creating the layout of a form,
    •     PC Editor for entering texts and fields into output areas,
    •     Navigation tree for maintaining the form logic,
    •     Table Painter for creating templates and tables,
    •     Form check.
    To define text formats, use style maintenance (transaction SMARTSTYLES;see also Smart Styles [Seite 54]).
    Activities
    The SAP Smart Forms initial screen is the starting point for maintaining forms, styles [Seite 54], and text modules [Seite 54]:
    1.     Choose transction SMARTFORMS.
    The dialog window SAP Smart Forms: Request appears.
    2.     Select Form, Style, or Text module, depending on which object you want to create, display, or change.
    3.     Enter the name of the object.
    4.     Choose Create, Change, or Display.
    Depending on the radio button you selected (Form, Style, Text module), the system branches to the Form Builder, the style maintenance (transaction SMARTSTYLES ), or to the text module maintenance.
    Navigating in the SAP Form Builder
    The screen capture below shows the three different areas of the SAP Form Builder: The navigation tree (hierarchy structure of a Smart Form) on the left, the maintenance screen in the middle, and the Form Painter on the right.
    If you select a tree in the node, the system updates the maintenance screen and marks the relevant window in the Form Painter. You can also select a window in the Form Painter; the system them marks the relevant node in the tree.
    In the tree you determine the hierarchy of the form logic (see also Form Logic: Introduction [Seite 13]); in the Form Painter you determine the layout. If you, for example, move a window in the tree, this does not effect the layout of the Smart Form.
    Tree Navigation
    Selecting a Node
    To select a node in the tree, double-click it. The system updates the maintenance screen accordingly.
    Drag&Drop
    Use Drag&Drop to move (left mouse button) or copy (Ctrl + left mouse button) subtrees.
    Drag&Drop is a "move" operation, consisting of a "cut" and a "paste" operation with its own clipboard. If the node you are moving can be appended either on the same level as the target node or as a successor of the target node, the context menu offers both possbilities.
    Context Menu
    Use the right mouse button to display a sensitive context menu in the tree (that is, depending on the current node type). The following functions exist:
    •     Creating or deleting (only in change mode)
    Depending on the selected node type only valid node types appear.
    •     Clipboard operations (see below), such as cutting, copying to clipboard, pasting from clipboard (only in change mode)
    •     Expanding and collapsing a subtree
    Clipboard
    There are three clipboard operations:
    •     Copy
    Copies the selected node with all its successor nodes into the clipboard.
    •     Cut
    Copies the selected node with all its successor nodes into the clipboard and deletes the copied nodes from the tree.
    •     Paste
    Before pasting, the system checks whether and where you are allowed to append the root node of the clipboard contents.
    Maintenance Screen
    On the maintenance screen you can select different tab pages depending on the node type. For more information see Node Types: Overview [Seite 23].
    Form Painter
    You can suppress or display the Form Painter (choose Form Painter on/off). For more information on how to work with the Form Painter see Graphical Form Painter [Seite 17].
    Form Painter
    Use
    You use the Form Painter to design the layout of the pages of a Smart Form. You can include windows and graphics on a page, determine their positions and choose the window sizes.
    The Form Painter offers the following functions:
    •     Design area with ruler, cursor with help lines, and grid and main grid
    •     Display of the cursor position in the ruler, which you can suppress and set
    •     Two-level grid with engage function, which you can customize at will
    •     When creating, changing, and moving a window, the window size appears in the ruler.
    •     Detachable toolbar containing the most important functions
    •     Autoscrolling when moving windows; placing windows into the background
    •     Zoom factors you can set to any value and autozooming of the design area to the window size
    •     Sensitive context menu
    •     Placing a scanned graphic into the background of the design area (see also Printing Graphics [Seite 31])
    Activities
    To display or suppress the Form Painter choose Form Painter on/off.
    To make detailed settings in the Form Painter (for example, step size of the grid, zoom factors, and so on), choose Settings in its toolbar.
    PC Editor
    You use the PC Editor to enter and format texts and fields.
    Among others, the PC Editor offers the following functions:
    •     Enter, delete, select, cut, and copy texts (see also Entering Text in the PC Editor [Seite 27]).
    •     Assign paragraph and character formats (for a list of the available formats use the list boxes Paragraph formats and Character formats)
    •     Include, change, and delete fields (see also Using Fields in the Form [Seite 42])
    The PC Editor displays fields with a gray background.
    Table Painter
    Use
    You use the Table Painter to design templates and tables in a window (see also Displaying a Table with Static Data [Seite 33]).
    The Table Painter offers the following functions:
    •     Drawing lines and columns
    •     Inserting, cutting, copying, and deleting lines
    •     Deleting cells
    •     Changing cell size and moving cell separator lines
    •     Splitting cells
    •     Selecting table patterns
    Activities
    To display or suppress the Table Painter, choose Table Painter on/off on the Table tab on the maintenance screen of a table or template.
    The design area does not mirror the size of your window into which you include the table. Therefore, remember to check the size in the ruler.
    If you want to insert two tables one after the other, you must create two tables in the window node one after the other.
    To execute a function, mark a cell and choose the function in the context menu (right mouse button).
    To select a table pattern, select the Table tab in the node and choose Select pattern.
    To make detailed settings in the Table Painter (for example, step size of the grid, zoom factors, and so on), choose Settings in its toolbar.
    Style Builder
    The screen capture shows the Style Builder that you use to define Smart Styles. On the left, you see the style tree which consists of predetermined nodes (header data, folder for paragraph formats, folder for character formats). You can navigate between the nodes and create new nodes. On the right, you see the maintenance screen with its tab pages (here, for example, standard settings for the font in the selected color blue). At the bottom you see the preview of the selected font.
    For detailed information on how to create and maintain a Smart Style see Smart Styles [Seite 54].
    Field List and Error List
    Field List
    The field list displays the following data in a tree structure:
    •     all tables, structures, and fields passed via the form interface [Seite 38].
    •     system fields [Seite 43] and fields you defined in the global definitions [Seite 41]
    This allows you to check that you enter the correct field name when you include a field, and that the Smart Form actually knows the field.
    To display the field list, in the Form Builder choose Field list on/off.
    Error List
    When you check the Smart Form and any errors occur, the system displays a list of errors and warnings at the bottom of the maintenance screen. To find the error or warning in the tree, select the node in the second column. The system then goes to the corresponding position in the tree and you can correct the error.
    To check the entire Smart Form choose Check. If an error occurs the error list appears.
    For more information on testing and checking forms see Checking and Testing a Smart Form [Seite 58].
    Node Types: Overview
    When you create a Smart Form, the tree structure of the Form Painter already contains two root nodes:
    •     You use the successors of the Global Settings node to maintain Form attributes, the Form interface, and Global definitions.
    •     You use the successors of the Pages and windows node to create the pages of your form, position elements on these pages, and determine the sequence in which you want to process these elements.
    Apart from the two root nodes, each node has attributes. You can maintain these attributes on tabs on the right half of the screen. The attributes you can maintain on the tabs General Attributes, Output Options, and Conditions are the same for most of the node types (see: Shared Attributes of the Node Types [Seite 24]).
    Successors of Node Pages and windows
    As direct successors to root node Pages and windows you can create only page nodes. The tables below describe these page nodes and the other successors:
    Output areas
    Node type     Description     Possible direct successors
    Page [Seite 25]
    A page of the form. Direct successors of this node can be placed directly on the page.     Window, graphic, address
    Window [Seite 26]
    Output area on a page. There are main windows and subwindows.     All except window and page nodes
    Elementary nodes (without successors)
    Node type     Description
    Text [Seite 26]
    You use this node to print any texts (and table contents), except addresses.
    Graphic [Seite 31]
    You use this node to position graphics in the form. To include background graphics, use node type Page.
    Address [Seite 30]
    You use this node to include an address. The system reads the address data directly from the database tables and formats them for print output.
    Table output
    Node type     Description     Possible direct successors
    Template [Seite 33]
    Output of a table containing static data     All except window, page, table, and template nodes
    Table [Seite 46]
    Output of a table containing application data     As with template node
    Flow control
    Node type     Description     Possible direct successors
    Command [Seite 52]
    Executes special commands (next page, paragraph numbering, printer control)     (no successor)
    Loop [Seite 52]
    Processes successor node repeatedly.     All except window and page nodes
    Alternative [Seite 51]
    Branches depending on condition.     Direct successors are automatically the nodes TRUE and FALSE. The direct successors of these are all nodes except window and page nodes.
    Other nodes
    Node type     Description     Possible direct successors
    Folder [Seite 36]
    Combines successor nodes to logical groups     All except window and page nodes
    Complex section [Seite 60]
    Combines all attributes of the node types template, table, loop, folder     All except window and page nodes
    Program lines [Seite 61]
    Executes ABAP program code (for example, conversion routines).     (no successors)
    Shared Attributes of the Node Types
    The following tab pages are used in common by several node types:
    Tabs for general node attributes
    Name     Description
    General Attributes     Shows contents or description of the node
    Output Options     Contains attributes such as position, style, box and shading
    Conditions [Seite 51]
    Allows to display the node only if certain conditions are true (see also: Flow Control [Seite 50])
    The node types Table, Template, Loop, Folder, and Complex section share a different tab in the place of General Attributes.
    Output Options
    Except for the page nodes in the subtree Pages and windows, you can always use this tab to determine a box and shading for the respective node. Nodes with text output also have the attribute Style. You use this attribute to overwrite for the current subtree the style that was set in the form.
    Depending on where you insert a node, it can have additional output options (for example, if the predecessor is a template [Seite 33]).
    Basic Elements of a Form
    Creating Pages
    Use
    Each form consists of one or more pages. The first page in the tree structure is the start page (when you create a form, the start page already exists). With this page, processing of the form starts.
    When you call pages repeatedly or process pages again because the main window is not filled yet, a page node creates several print pages.
    See also: General Concepts on Form Printing [Seite 7].
    Procedure
    1.     Open the context menu for an existing page node and choose Create &#61614; Page.
    2.     Enter a unique name for the node and a description (for example, business terms).
    3.     Determine the format and the mode of the page counter [Seite 53] on the General Attributes tab. In the default setting, the next page is the page itself.
    4.     Determine the print attributes of the page on the Output Options tab (see F1 help).
    5.     Determine a background graphic for the entire page on the Background tab. For information on how to select the graphic see Printing Graphics [Seite 31]. If you do not determine an Output mode in the Output attributes box (in print preview only, on the printer as well), the system ignores the background graphic.
    If you select an output mode, the user can still choose Background graphic in the print preview to display or suppress it.
    Result
    You can now define the page contents. For each page, the Form Painter shows an individual layout. Whether the page is included into the printout depends on whether it is evaluated during form processing [Seite 62] (a page can be omitted even though it is part of the tree structure).
    Creating Windows
    Use
    Windows are output areas for all output data. You can set the size and position of a window graphically in the Form Painter. There are main windows and subwindows [Seite 8]. The most important difference is that the output in a main window can cover several pages.
    After you created a form, a main window already exists on the first page.
    Prerequisites
    A page [Seite 25] exists on which you want to create a window.
    Procedure
    6.     Open the context menu for an existing page node and choose Create &#61614; Window.
    If you create the window in the Form Painter using the context menu, you can use the mouse to position it immediately.
    7.     Enter a unique name for the node and a description (for example, booked flights).
    8.     On the General Attributes tab indicate whether the window is a Main window. If you want to create a subwindow, leave the checkbox empty.
    For each page you can indicate only one main window.
    9.     The Position and Size values in the Output options box correspond to the position in the Form Painter. If you want to, maintain other attributes [Seite 24].
    Result
    You can see the window in the Form Painter and in the tree structure. You can always change the specification of the main window or subwindow.
    Positioning Texts on the Form
    Use
    You display all texts in the form using text nodes. The only exception are addresses [Seite 30], which use their own node.
    Integration
    The predecessor node [Seite 14] of the text node determines its use:
    Examples for using text nodes
    Predecessor node     Used to
    Subwindow     Exactly position text on one or more pages
    Main window     Display text in relation to other nodes in the main window; it may cover several pages
    Template     Display texts for table cells of a static table [Seite 33]
    Table     Display table contents
    Header and footer [Seite 49]
    Display column headings and grand totals in tables
    Event node [Seite 48]
    Display subtotals in a table
    Features
    There are the following text types:
    •     Text element: to enter new text in the PC Editor [Seite 27]
    •     Text module: to include a text module [Seite 28]
    •     Include text: to include an existing SAPscript text [Seite 29]
    Positioning the Text
    The position of the text depends on the direct predecessor node (for example, you can assign text of a table cell) as well as on the processing sequence in the tree structure. In addition, you determine output of a text node in relation to the preceding node on the same level [Seite 14]. You can append the text directly to the output of that node or start it in a new paragraph or a new line (select via radiobutton).
    Entering Texts in the PC Editor
    Use
    You use the PC Editor [Seite 19] to enter new text. The position of this text on the form is determined by the predecessor node.
    To include data from the form interface (data from application tables) or system data (date, time) into the text, use system fields or user-defined fields, respectively, in the text (see Using Parameters in the Form [Seite 37]). When processing the form, Smart Forms replace these fields with the corresponding values.
    Procedure
    1.     To create a text node, call the context menu for that node in the tree structure that should receive the text. Then choose Create &#61614; Text.
    2.     Enter a unique name for the node and a node description (for example, letter).
    3.     On the General Attributes tab choose Text element as text type.
    Since you edit a text element, an included text, or a text module exclusively using the text node, the system stores only information on the selected type. When you change the text type, the system therefore asks for your confirmation.
    4.     Enter your text in the PC Editor
    &#61485;     either directly on the tab if you use the inplace version of the PC Editor
    &#61485;     or choose Text editor to go to the fullscreen mode of the PC Editor. If, after entering the text, you use the green arrow (F3) to leave the fullscreen editor, the system transfers the text into the inplace version.
    5.     In the Text node box choose whether you want the text to start with a new paragraph or only in a new line. You can also choose to append the text directly to the end of the current paragraph.
    6.     If desired, choose the Output Options [Seite 24] tab to maintain the style or box and shading of the text.
    Result
    The system displays the node in the tree structure, including its name and description.
    Including Text Modules
    Use
    You use the text type Text module of the text node [Seite 26] to refer to an existing text module  [Seite 54]in the system. This allows you to easily use texts from text modules in several forms. In addition, it is not necessary to load the entire form description to maintain these texts.
    You can use text modules in two ways:
    •     Refer to the text module. The text then appears read-only in the PC editor and is included when you print the form.
    •     Copy the text module. The system then copies the text of the module and automatically converts the text node into an editable text element.
    Text modules can be used cross-client and are connected to the transport and translation systems.
    Prerequisites
    The text module you want to include must exist in the system. To create a text module use the SAP Smart Forms initial screen [Seite 15].
    Procedure
    5.     To create a text node, call the context menu for that node in the tree structure that shall contain the text and choose Create &#61614; Text.
    6.     Enter a unique name for the node and a description (for example, business terms).
    7.     On the General attributes tab select the text type Text module.
    Since you edit a text element, an included text, or a text module exclusively via the text node, the system stores only information on the selected type. When you change the text type, the system therefore asks for your confirmation.
    8.     Enter the name of the text module in the Text name field. Or click on the black arrow and enter the name of a field to be evaluated dynamically [Seite 37].
    9.     If you want to change the text of the text module for the current form, choose Copy. The Form Builder changes the text type to Text element and copies the text of the module into the PC Editor, where you can edit it. In this case, the original text module remains unchanged.
    10.     Use the checkbox Always copy style from text to determine that the style of the text module is of higher priority than that of the text node or any style inherited from a predecessor. This is important if you specified the name of a field in step 4 (see F1 help).
    11.     If required, use the Output options [Seite 24] tab to maintain attributes for style, box and shading of the text.
    Result
    The system displays the node including name and description in the tree structure. It includes the relevant text itself in the moment the form is processed. If you refer to a text module, it appears in the PC Editor in read-only mode, if you copy it you can edit it.
    Including SAPscript Texts
    Use
    You use the text type Include text of the text node to refer to a SAPscript text that already exists in the system. To identify the text, you need the text name, the text object, the text ID, and the language. Thus, you can easily use the texts in several forms. In addition, you need not load the entire form description [Seite 12] to maintain these texts.
    This text type corresponds to the SAPscript statement INCLUDE. However, Smart Forms do not allow any control statements in include texts. When processing the form, they are simply ignored.
    To administer application-specific form texts, applications use transaction SE75 to define their own text objects with subordinate text IDs. Use text object TEXT with text ID ST to enter general standard texts. To maintain them, use the standard text editor (transaction SO10).
    If there is no need for you to use old SAPscript texts, you better use text modules [Seite 28]. They can be used cross-client and are connected to the transport and translation systems.
    Procedure
    1.     To create a text node, call the context menu for that node in the tree structure that shall receive the text and choose Create &#61614; Text.
    2.     Enter a unique name for the node and a node description (for example, letter).
    3.     On the General Attributes tab choose Include text as text type.
    Since you edit a text element, an included text, or a text module exclusively via the text node, the system stores only information on the selected type. When you change the text type, the system therefore asks for your confirmation.
    4.     In the Text key box, identify the include text.
    &#61485;     To identify individual text objects, use the search help in this field.
    &#61485;     The search help of the Text name field allows you include the attributes of SAPscript texts into the search.
    7.     If required, use the Paragraph formats box to format the include text:
    &#61485;     The style assigned to the text node contains a format for the standard paragraph ('*'). If you enter a paragraph format in the Standard paragraph field, this format overwrites the style format for all standard paragraphs in the include text that use this paragraph format.
    &#61485;     Use the First paragraph field to set a paragraph format for the first paragraph of the include text. This format also overwrites the format set in the style. If you set the First paragraph field but leave the Standard paragraph field empty, the system uses the format set in the First paragraph field for any standard paragraphs in the include text.
    6.     In the Text node box choose whether you want the text to start in a new paragraph, in a new line, or directly at the end of the current paragraph.
    7.     If desired, choose the Output Options [Seite 24] tab to maintain the style or box and shading of the text.
    Result
    The system displays the node in the tree structure, including its name and description. The included text is included only at the moment the form is processed.
    Inserting Addresses
    Use
    In many applications, addresses are administered using the Central Address Administration [Extern]. Depending on how the address is used, the application uses a particular address type [Extern]. The addresses are stored in the database tables of the central address administration and identified by the application via a number.
    You use the address node to insert an address into the form. This guarantees that the address is formatted according to the postal rules of the sender country.
    Prerequisites
    Your application must administer addresses using the central address administration. Otherwise you must use the text node [Seite 26] to insert your addresses.
    Procedure
    1.     To create an address node, call the context menu for that node in the tree structure that you want to contain the text and choose Create &#61614; Text.
    Create the address node as direct successor of the page node or use the context menu in the layout of the Form Painter. You can then position the address anywhere on the page.
    2.     Enter a unique name for the node and a description (for example, customer address).
    3.     Determine the address type on the General attributes tab.
    For a description of how to determine the address type dynamically and how to use fields instead of fixed values, see Using Parameters in the Form [Seite 37].
    4.     For organization addresses you must specify only an address number. For any other address types, you must specify a person number and an address number. To do this, use the search help.
    5.     In the box Additional address specifications you can maintain other attributes to specify how you want to display the address:
    &#61485;     Use field Output starts with paragraph to set the paragraph format of the style that you want to use to display the address.
    &#61485;     If the number of lines you specify in the field Number of lines to be used is smaller than the number of lines required to display the address, the central address administration suppresses lines of the address.
    &#61485;     As default, the system uses as sender country the country that was specified when creating the address. You can use the parameter Sender country to overwrite this setting.
    &#61485;     For addresses that have a P.O. box as well as a street address, use the other fields in the box to determine which of these addresses to display.
    6.     If desired, you can use the Output Options [Seite 24] tab to maintain attributes for style, box, and shading of the text. In addition, you can set values for position and size of the output area (instead of in the Form Painter).
    Result
    The system displays the node including name and description in the tree structure. If you insert the address as direct successor of a page or by using the Form Painter, the system displays an extra output area for the address. The address itself is inserted only at the moment the form is processed. You cannot view it in the Form Builder.
    Printing Graphics
    Use
    You use the graphic node to display graphics, such as a company logo, on the form. For performance reasons, make sure that the graphics are held in the printer memory. SAP Smart Forms support this method, provided that:
    •     The printer can be controlled accordingly.
    •     There is enough memory space on the printer.
    •     You activated this property in transaction SE78 (see below).
    In this case, the system sends the graphics to the printer only once during one print job.
    To include background graphics, use the Background graphic tab of a page node.
    Prerequisites
    You use the SAPscript Graphic Administration (transaction SE78) to import graphics into the SAP-System:
    1.     Double-click on a graphic format in the tree structure in the forder Document server &#61614; GRAPHICS General graphics.
    2.     Choose Graphic &#61614; import.
    The transaction imports the graphic and stores it on the Business Document Server (BDS). Now you can display it on a form.
    See also: Graphic Administration [Seite 65]
    Procedure
    1.     To create a graphic node, call the context menu for that node in the tree structure that you want to contain the graphic and choose Create &#61614; Graphic.
    Create the graphic node as direct successor of the page node or use the context menu in the layout of the Form Painter. You can then position the graphic anywhere on the page.
    In the Form Painter the system displays a small box for the newly created node.
    2.     Enter a unique name for the node and a description (for example, company logo).
    3.     On the General Attributes tab determine whether you want to include a colored graphic or a graphic in black and white.
    4.     Use the fields Object, ID, and Name to identify the graphic. Use F4 help of the Name field to copy the values of these fields. If you copy them with ENTER, the system displays the graphic in the Form Painter.
    The box for the graphic in the Form Painter also contains the name of the graphic node, which in part overlays the graphic.
    5.     In the Technical Attributes box determine the graphic resolution according to what the printer supprts. Small resolutions increase the size of the graphic on the form, higher resolutions reduce the size.
    6.     For graphic nodes that are displayed in a window, there is a box Horizontal position in addition to the general output options [Seite 24]. The parameters Reference point and Alignment determine the horizontal position in the window, while the vertical position is determined by the previous output in the window.
    At present, you cannot overlay graphics with text. However, if you use a template node [Seite 33], you can display graphics and text side by side.
    Result
    The system displays the node with name and description in the tree structure. If you insert a graphic as direct successor of a page or if you used the Form Painter, the system displays the graphic. Graphics in windows are inserted only when the form is processed. You can therefore not see them in the Form Builder. In addition, the system automatically dispalys the graphic on the next page if there is not enough space left on the current page.
    Displaying a Static Table
    Use
    Use node type Template to display a table whose layout and size (number of lines and columns) is determined before the runtime of the print program.
    To create a template, define a table layout to determine the cell structure for each line. The cells are used to display the contents of the successor nodes of the template node. This allows you to position text and a graphic side by side (see Displaying Graphics in Templates [Seite 36]).
    The template node is also suited for label printing.
    Integration
    You can use system fields or your own fields &#61630; for example, to display the current date &#61630; in table cells (see also Using Parameters in the Form [Seite 37]).
    To display application data, use the table node. For this node type the number of table lines to be displayed is not known before the form is actually printed (the number depends on the volume of application data selected in the data retrieval program [Seite 38]).
    Prerequisites
    You can create a template node only as a successor to a window node. If you want to display the template in a particular area of the page, create a subwindow for it. Otherwise, use the main window.
    Features
    The node type displays a table layout [Seite 34]. You can either enter the table layout directly or use the Table Painter to define it.
    To set other attributes, use the attributes the node types share [Seite 24].
    Activities
    To use a template, you must:
    1.     Define the table layout [Seite 34].
    2.     Display contents in the table cells [Seite 35].
    Defining the Table Layout
    Use
    You use the table layout to determine:
    •     The number of lines and cells
    •     The height of each line
    •     The width of each cell
    •     The alignment of the table in the window
    •     Whether and where to display separator lines or frames
    Procedure
    Create a template node and maintain the attributes Width, Horizontal alignment, and Vertical alignment (See F1 help).
    Use the table control on the Template tab to define the layout of the lines. Each line of the template must have a definition. You can use one line in the table control to define either the layout of one template line or a common layout for several template lines:
    •     Use the columns From and To to specify the lines of your template, for which the definition applies. The numbering starts with 1. The intervals in the line definition may neither overlap nor leave gaps.
    •     The Height you specify applies for all cells of this line. Specify a Width for each cell you want to display. The sum of the width values must amount to the specified Width of the template.
    •     You can reuse the Name of the template line for other lines of the same template. Enter it in the Reference column of the desired lines. The system then copies the values you specified for the line height and the individual cell widths.
    Use the Pattern box to select the desired table pattern.
    Example
    You define the following lines in the table control (in the example without measurement units):
    Name     From     To     Reference     Height     1.     2.     3
    Line1_2     1     2          1     1     2     3
    Line3     3     3          2     2     2     2
    Line4     4     4     Line1_2     1     1     2     3
    You use the Pattern box to specify that all cells are separated by visible lines and that the template is framed.
    Result
    On the form, the template may look like this:
    Displaying Contents in Cells
    Use
    The template node defines the table layout [Seite 34]. The successor nodes of the template node determine the data to be displayed in the table cells.
    Prerequisites
    You already created a template node as successor of a window node and defined the table layout.
    Procedure
    1.     Use the context menu of the template node to create successor nodes.
    For clarity reasons create one folder node [Seite 36] for each line. The folder node is an outline node that you can use to combine related nodes. For folder nodes, you need not fill in the input fields in the Output structure box (see next step).
    2.     The Output options tabs of the inserted nodes now contain an additional box Output structure with the fields Line and Column. Assign each node to the cell in which you want the output to appear.
    You can assign several nodes to one cell. The output sequence within the cell is determined by the sequence of the nodes in the tree.
    Result
    The system displays the contents in the print preview or prints them, respectively.

  • Smartforms: add a space before address information

    Hi All,
    In my smartform I have created a window with a border (option "Line With" - tab: "Output Options". Under this object I have created an address form type "Organizationa Address(1) and I have set "Use Street(S) as "Additional Address Specifications".
    Now my issue is about to obtain a space before all information showed by the address. This is to avoid information too close to the left border of the window. I tryed defining a text object before the address object, under my window definition but I did not received any effect.
    Any suggestion will be well appreciated. Many thanks in advance for your kind help.
    Regards,
        Giovanni
    Edited by: gio1234 on Oct 1, 2009 2:13 PM

    Hi Giovanni,
    You can get around this problem by creating another window, slightly larger than the one that currently contains the address node and use this to draw the border.
    Also, as you can assign the address directly to the page you could then get rid of your current window.
    Regards,
    Nick

  • Missing information in smartform

    SDV1 transaction produces a list of quotations from expiring contracts.When I try to view the print preview of the quotation that is generated as a spool output,some information like the boat details dont appear.This smart form is a custom developement .
    The same smart form is called by means of VA23 tcode(has the same output type as that of SDV1), wherin all information are present.As the smartform is being called background in the former case, we have'nt been able to debug it either.
    Can any one throw light on what the issue could be due to?

    Hi Nithya,
    Check If the Program is performing any standard actions in the middle.
    Are you passing the information to smartform via a 'Z' program or a standard program is assigned? If standard is uesd for generating the spool as well find the difference between how it is called when SY-BATCH = X.
    Definitely there would be some behavioral change between spool generation and background step!
    Thanks
    Krish.

  • Information about Smartform

    Hi All,
    We are presently working with SRM 4.0 with extended classic scenario .
    I want to know the following things about PO output smartforms.
    1)Regarding PO output smartform :  in u2018smartformsu2019 transciation system is showing many  smartforms for PO output, In this regard , I want to know, which smartform system is calling when we click on PO print preview.
    2)Where we can see that which smart form is linked to PO preview button ?
    3)How to switchover to external de-bugging and how to debug smart form ?
    Thanks in advance
    Sachin.
    Edited by: sachin patil on Feb 12, 2009 12:45 PM

    Hi Sachin,
    Please check the following documentation in IMG settings:
    Supplier Relationship Management --> SRM Server --> Cross application basic settings --> set output actiona and output format --> define actions for document output.
    Also see the implementation for the BAdI: BBP_OUTPUT_CHANGE_SF
    Thanks,
    Pradeep
    Edited by: Pradeep Purushottam on Feb 12, 2009 5:24 PM

  • Request of Information on smartforms

    Hi guys,
    can any one help me in using text as Watermark in smartforms.
    And using header text in the smartforms.
    Message was edited by: Sam Sean T

    Hi Sam
    Check these Links out
    http://www.sapfans.com/forums/viewtopic.php?t=170361&view=previous&sid=e01c23b1cb0ff108b5a32f2ffa5335df
    http://www.sapgenie.com/phpBB2/viewtopic.php?p=2999&sid=9200dde51fe22fac07b8cf68e4975821
    Regards,
    Santosh

  • Error while Activating a Smartform!!

    This smartform was first developed in 4.6 version in german language. Now, its being done in ECC 6.0 version with changes in naming conventions of the fields and the hardcode values in the logic.
    After the changes made to the fields names or table names or hardcoded values. it resulted  with warnings. Now when i try to Activate it. It pops and information message stating that "A serious error has occurred
    The transaction had to be terminated
    Press the "Yes" button
    to download the data required for further support to the front end"
    If selected 'Yes' the error log is downloaded into a flat file which looks like stated as below " DZSD_INVOICE01_SF              GR%GRAPHIC1                             Hintergrundbild
    DZSD_INVOICE01_SF              PAFIRST                                 Erste Seite
    DZSD_INVOICE01_SF              GR%GRAPHIC4                             Neue Grafik 4
    DZSD_INVOICE01_SF              WIABB_LOGO                              ABB_LOGO
    DZSD_INVOICE01_SF              CD%CONDITION139                         Neue Alternative 139
    DZSD_INVOICE01_SF              OA%OUTATTRIB168                        
    DZSD_INVOICE01_SF              COSTEUERUNG_ABSENDERABGABE             
    DZSD_INVOICE01_SF              SEABSENDER_STANDARDAUSGABE             
    DZSD_INVOICE01_SF              CD%CONDITION228                         Neue Alternative 228
    DZSD_INVOICE01_SF              TISENDER_POSTFACH_DEUTSCH               Senderadresse Postfach
    DZSD_INVOICE01_SF              CD%CONDITION4                           Neue Alternative 4
    DZSD_INVOICE01_SF              OA%OUTATTRIB43                         
    DZSD_INVOICE01_SF              TISENDER_STRASSE_DEUTSCH                Senderadresse Strasse
    DZSD_INVOICE01_SF              CD%CONDITION5                           Neue Alternative 4
    DZSD_INVOICE01_SF              OA%OUTATTRIB52                         
    DZSD_INVOICE01_SF              TISENDER_POSTFACH_ENGLISCH              Senderadresse Postfach
    DZSD_INVOICE01_SF              CD%CONDITION239                         Neue ...."
    and so on...
    if selected 'NO', then an error message pops up stating " Internal error (illegal structure of data storage)" for which i need to either choose the 'EXIT' button which would take me out of the transaction.
    Please let me know as to resolve this problem and what could i do to get the smartform activated.
    Would appreciate an early response!!
    Thanks a lot!!,
    M. Keerthi Shanker

    Thanks to everyone here...
    Special Thanks to Jayanthi...
    I have changed the I_ITEMS's structure in Form Interfaces of the form.
    Now its working fine...
    Regards
    Pavan

  • Can't send smartform to external mail address

    Hi, everyone.
    Now, after creating some self-defined smartforms, we want to send its
    PDF copy to
    our external mail address. From this point, I had some try.
    Reference to SAP Library, I make a testing program named 'YPDF_TEST'.
    However, one exception always exists when running and error message id
    is 'XS806' - means
    "No delivery to &, invalid recipient address"
    I filled the address with following fields.
    [ dev_mail_recipient-logsys = 'CLNT600'.
    dev_mail_recipient-objtype = 'RECIPIENT'.
    dev_mail_recipient-objkey = '[email protected]'. ]
    I just can't understand the real reason why it doesn't work.
    Through debugging, I found the error occurs when handling the following
    codes
    in function "SX_ADDRESS_TO_DEVTYPE".
    [ swc_create_object o_recipient 'RECIPIENT' recipient_id-objkey.
    swc_get_property o_recipient 'CommunicationType' m_recipient-type.
    get_property_longvalue o_recipient m_recipient-address. ]
    On the current situation, if can't come over this problem,
    we may not build the connection and don't provide information in time.
    Failed to send, I yet try another function - added the tail but on earthdidn't get it ~~~
    Would you give me some hints or advice ?
    Any help is appreciated.
    ====================
    <i>REPORT ypdf_test .
    DATA: fm_name TYPE rs38l_fnam.
    DATA: my_control_pars TYPE ssfctrlop. "for CONTROL_PARAMETERS
    DATA: my_output_info TYPE ssfcrescl. "for JOB_OUTPUT_INFO
    DATA: output_options TYPE ssfcompop.
    DATA: e_devtype TYPE rspoptype.
    DATA: gw_lcprint TYPE ziebsflc001.
    DATA: bin_file TYPE xstring,
    bin_filesize TYPE i,
    ndiv TYPE i, offset TYPE i,
    nmod TYPE i.
    DATA: BEGIN OF bin_table OCCURS 0,
    x TYPE xstring,
    END OF bin_table.
    DATA: lines LIKE tline OCCURS 0.
    DATA: dev_mail_sender LIKE swotobjid, "B20K061818
    dev_mail_recipient LIKE swotobjid.
    DATA: dev_mail_applobj_tab LIKE swotobjid OCCURS 10 WITH HEADER LINE.
    DATA: param LIKE itcpp.
    my_control_pars-no_dialog = 'X'.
    my_control_pars-getotf = 'X'.
    Get genereated function name of Smartform
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = 'ZDEMO_SMART_FORM_PPF'
    IMPORTING
    fm_name = fm_name
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    ENDIF.
    Get Device type
    CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
    EXPORTING
    i_language = sy-langu
    I_APPLICATION = 'SAPDEFAULT'
    IMPORTING
    e_devtype = e_devtype
    EXCEPTIONS
    no_language = 1
    language_not_installed = 2
    no_devtype_found = 3
    system_error = 4
    OTHERS = 5 .
    IF sy-subrc <> 0.
    ENDIF.
    output_options-tdprinter = e_devtype.
    set needed mail option
    my_control_pars-device = 'MAIL'.
    dev_mail_sender-logsys = 'CLNT600'.
    dev_mail_sender-objtype = 'RECIPIENT'.
    dev_mail_sender-objkey = 'CHI_DEV03'.
    dev_mail_recipient-logsys = 'CLNT600'.
    dev_mail_recipient-objtype = 'RECIPIENT'.
    dev_mail_recipient-objkey = '[email protected]'.
    CALL FUNCTION fm_name
    EXPORTING
    control_parameters = my_control_pars
    mail_recipient = dev_mail_recipient
    mail_sender = dev_mail_sender
    output_options = output_options
    ip_carrid = 'ID'
    ip_connid = '8290'
    ip_fldate = sy-datum
    ip_bookid = '12345678'
    ip_customid = '09876521'
    ip_luggweight = 90
    ip_wunit = 'KG'
    ip_smoker = 'X'
    IMPORTING
    job_output_info = my_output_info
    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.
    Another try ***
    *DATA: param LIKE itcpp.
    *DATA: BEGIN OF off_obj.
    INCLUDE STRUCTURE soodk.
    *DATA: END OF off_obj,
    ok TYPE c,
    msgid TYPE symsgid,
    msgno TYPE symsgno,
    msgv1 TYPE symsgv,
    msgv2 TYPE symsgv,
    msgv3 TYPE symsgv,
    msgv4 TYPE symsgv.
    *DATA: dev_mail_applobj_tab LIKE swotobjid OCCURS 10 WITH HEADER LINE.
    *CALL FUNCTION 'CONVERT_OTF_AND_MAIL'
    EXPORTING
    mailoptions = param
    mail_sender = dev_mail_sender
    mail_recipient = dev_mail_recipient
    IMPORTING
    office_objid = off_obj
    mail_ok = ok
    msgno = msgno
    msgid = msgid
    msgv1 = msgv1
    msgv2 = msgv2
    msgv3 = msgv3
    msgv4 = msgv4
    TABLES
    mail_application_object_ids = dev_mail_applobj_tab
    otf = my_output_info-otfdata.</i>

    Hi,
    You can follow a different approach. Send the output of the Smartform to the spool.
    You have a Function Module to read the spool and convert it to PDF . Then there is one more function module to attach the PDF and send it as a mail.
    You need to configure SMTP in Tcode : SCOT.
    Search the forum with emailpdfattachment
    You have umpteen postings available.
    Pls reward if useful.
    Regards,
    Laxman Nayak

  • Smartforms output as HTML in email

    Hi,
    I want to send the output of a smartform as html in email body.
    I found and used this bolg: :<a href="/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp HTML Email from SAP CRM/ERP</a>
    I did everything as per the blog.
    However I am getting the email as:
    sf @media print {.xsfnoprint{ display : none ;}}/* Default css layout information for SAP Smart Forms (XSF Output) Last modified: 12.05.2003 /@media screen { body { background-color : #EFEFEF ; }}@media screen { .page { border-style : outset ; border-width : 2pt ; background-color : white ; }}/@media print { .page { overflow: hidden; }}// unification browser-dependent settings /table { border-spacing: 0pt; empty-cells: show;}tr { vertical-align: top; }td input img img.icon / End of default.css */.SYSTEM div#B.par{ font-family : "Courier New" ; font-size : 12pt ; font-weight : normal ; line-height : 4.23mm ; text-decoration : none ; text-align : justify ; clear : both ;}.SYSTEM div#L.par{ font-family : "Courier New" ; font-size : 12pt ; font-weight : normal ; line-height : 4.23mm ; text-decoration : none ; text-align : left ; clear : both ;}.SYSTEM a.SYSTEM span#H.char{ font-weight : bold ;}.SYSTEM span#I.char{ font-style : italic ;}.SYSTEM span#U.char{ text-decoration : underline ;}#sfPAGE1-001.page@media screen {#MAIN.win{ overflow : auto ;}}@media print {#MAIN.win{ overflow : hidden ;}}#sfPAGE1-001.page #MAIN.win
    Welcome
    <IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48">
    I am using: Lotus notes client for email and my smartform contains only two text elements: one containing text Welcome and other containing text
    <IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48">
    When I display the document using SOST, I get the output as
    Address bar has this:  C:\Documents and Settings\EDC LTIL02\SapWorkDir\TESTHTMLEMAILFROMSMARTFORMOUTPUT_20070928154506.046_X.MHT
    and window contains:
    Welcome
    <IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48"> "
    Regards,
    Reema
    Message was edited by:
            Reema Shahbazkar
    In case anyone needs to have a look at my code:
    REPORT  ZSMARTFORM_2_HTML_EMAIL.
    get generated function module for the smartform
    DATA: FM_NAME TYPE RS38L_FNAM.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME                 = 'ZSF_SAMPLE_HTML'
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
    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.
    get smartform contetnt
    set smartform output options
    data:
      control_parameters type SSFCTRLOP,
      OUTPUT_OPTIONS     TYPE SSFCOMPOP,
      DOCUMENT_OUTPUT_INFO  TYPE SSFCRESPD,
      JOB_OUTPUT_INFO  TYPE SSFCRESCL,
      JOB_OUTPUT_OPTIONS TYPE SSFCRESOP,
      XSFPARAM_LINE TYPE SSFXSFP,
      P_HTML TYPE TRFRESULT,
      P_GRAPHICS TYPE TSF_XSF_GR,
      WA_RETURN TYPE BAPIRET2.
    CONSTANTS: C_GR_DIR TYPE TDTEXT VALUE '/MYGRAPHICS'.
    control_parameters-NO_DIALOG = 'X'.
    *control_parameters-GETOTF = 'X'.
    OUTPUT_OPTIONS-TDNEWID = SPACE.
    OUTPUT_OPTIONS-TDIMMED = SPACE.
    OUTPUT_OPTIONS-XSFCMODE = 'X'.  "RUNTIME SETTINGS FROM SMARTFORM HEADER TO BE USED
    OUTPUT_OPTIONS-XSF = 'X'.  "XSF OUTPUT ACTIVATED
    OUTPUT_OPTIONS-XSFOUTMODE = 'A'.  "XSF OUTPUT STREAM PASSED DIRECTLY TO CALLING PROGRAM AS AN INTERNAL TABLE.
    CLEAR: OUTPUT_OPTIONS-XSFOUTDEV.  "OUTPUT SPOOL DEVICE
    OUTPUT_OPTIONS-XSFFORMAT = 'X'.  "ADDITIONALLLY TO XSF, HTML AND CSS LAYOUT INFORMATION IS ALSO PASSED TO CALLING PROGRAM
    XSFPARAM_LINE-NAME = 'GRAPHICS'.
    XSFPARAM_LINE-VALUE = 'EXTRACT'.
    APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
    XSFPARAM_LINE-NAME = 'GRAPHICS-DIRECTORY'.
    XSFPARAM_LINE-VALUE = C_GR_DIR.
    APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
    XSFPARAM_LINE-NAME = 'CONTENT-ID'.
    XSFPARAM_LINE-VALUE = 'ENABLE'.
    APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
    CALL GENERATED FUNCTION MODULE TO GET FORM CONTENTS
    CALL FUNCTION FM_NAME
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = CONTROL_PARAMETERS
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
       OUTPUT_OPTIONS             = OUTPUT_OPTIONS
      USER_SETTINGS              = 'X'
    IMPORTING
       DOCUMENT_OUTPUT_INFO       = DOCUMENT_OUTPUT_INFO
       JOB_OUTPUT_INFO            = JOB_OUTPUT_INFO
       JOB_OUTPUT_OPTIONS         = JOB_OUTPUT_OPTIONS
    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.
    SEPARATE HTML GRAPHICAL N CSS LAYOUT CONTENT
    P_HTML = JOB_OUTPUT_INFO-XMLOUTPUT-TRFRESULT.
    P_GRAPHICS[] = JOB_OUTPUT_INFO-XMLOUTPUT-XSFGR[].
    PROCEED TO SEND EMAIL
    DATA: HTML_DATA TYPE TRFRESULT,
          L_HTML_RAW LIKE LINE OF HTML_DATA-CONTENT,
          HTML_XSTR TYPE XSTRING.
    CLEAR: HTML_XSTR.
    LOOP AT P_HTML-CONTENT INTO L_HTML_RAW.
      CONCATENATE HTML_XSTR L_HTML_RAW INTO HTML_XSTR IN BYTE MODE.
    ENDLOOP.
    HTML_XSTR = HTML_XSTR(P_HTML-LENGTH).
    SPECIAL CHARACTER CONVERSION
    DATA: HTML_STR TYPE STRING,
          HTML_LEN TYPE I.
    CALL FUNCTION 'SCP_TRANSLATE_CHARS'
      EXPORTING
        INBUFF                   = HTML_XSTR
      INBUFFLG                 = 0
       INCODE                   = '4110'  "utf-8
      OUTBUFFLG                = 0
      OUTCODE                  = '0000'
       CSUBST                   = 'X'
      SUBSTC_HASH              = ' '
      SUBSTC_DOT               = ' '
       SUBSTC_SPACE             = 'x'
      SUBSTC                   = '00035'
    IMPORTING
      INUSED                   =
       OUTBUFF                  = HTML_STR
      OUTOVERFLOW              =
       OUTUSED                  = HTML_LEN
      SUBSTED                  =
      INPUT_ENDS_IN_CHAR       =
      ERRMSG                   =
    EXCEPTIONS
      INVALID_CODEPAGE         = 1
      INTERNAL_ERROR           = 2
      CANNOT_CONVERT           = 3
      FIELDS_BAD_TYPE          = 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.
    CHANGE ENCODING UTF-8 TO LATIN1
    REPLACE ALL OCCURRENCES OF 'UTF-8' IN HTML_STR WITH 'iso-8859-1' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '<IMG' IN HTML_STR WITH '<IMG' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '/>' IN HTML_STR WITH '/>' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '<A>' IN HTML_STR WITH '' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '<' IN HTML_STR WITH '<' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '>' IN HTML_STR WITH '>' IGNORING CASE.
    HTML_LEN = STRLEN( HTML_STR ).
    DATA: L_OFFSET TYPE I,
          L_LENGTH TYPE I,
          L_DIFF TYPE I,
          LT_SOLI TYPE SOLI_TAB,
          LS_SOLI TYPE SOLI.
    L_OFFSET = 0.
    L_LENGTH = 255.
    WHILE L_OFFSET < HTML_LEN.
      L_DIFF = HTML_LEN - L_OFFSET.
      IF L_DIFF > L_LENGTH.
        LS_SOLI-LINE = HTML_STR+L_OFFSET(L_LENGTH).
      ELSE.
        LS_SOLI-LINE = HTML_STR+L_OFFSET(L_DIFF).
      ENDIF.
      APPEND LS_SOLI TO LT_SOLI.
      ADD L_LENGTH TO L_OFFSET.
    ENDWHILE.
    DATA: LO_MIME_HELPER TYPE REF TO CL_GBT_MULTIRELATED_SERVICE.
    CREATE OBJECT LO_MIME_HELPER
      EXPORTING
        CODEPAGE = '1133'.
    CALL METHOD LO_MIME_HELPER->SET_MAIN_HTML
      EXPORTING
        CONTENT     = LT_SOLI
       FILENAME    =
       DESCRIPTION =
    HANDLE GRAPHICS
    DATA: L_GRAPHIC TYPE SSF_XSF_GR,
          GR_XSTR TYPE XSTRING,
          L_GR_RAW TYPE BAPICONTEN,
          L_CONTENT_ID TYPE STRING,
          L_CONTENT_TYPE TYPE W3CONTTYPE,
          L_OBJ_LEN TYPE SO_OBJ_LEN,
          L_FILENAME TYPE STRING,
          LT_SOLIX TYPE SOLIX_TAB,
          LS_SOLIX TYPE SOLIX.
    LOOP AT P_GRAPHICS INTO L_GRAPHIC.
      CLEAR: GR_XSTR.
      LOOP AT L_GRAPHIC-CONTENT INTO L_GR_RAW.
        CONCATENATE GR_XSTR L_GR_RAW-LINE INTO GR_XSTR IN BYTE MODE.
      ENDLOOP.
      GR_XSTR = GR_XSTR(L_GRAPHIC-LENGTH).
      L_OFFSET = 0.
      L_LENGTH = 255.
      CLEAR LT_SOLIX[].
      WHILE L_OFFSET < L_GRAPHIC-LENGTH.
        L_DIFF = L_GRAPHIC-LENGTH - L_OFFSET.
        IF L_DIFF > L_LENGTH.
          LS_SOLIX-LINE = GR_XSTR+L_OFFSET(L_LENGTH).
        ELSE.
          LS_SOLIX-LINE = GR_XSTR+L_OFFSET(L_DIFF).
        ENDIF.
        APPEND LS_SOLIX TO LT_SOLIX.
        ADD L_LENGTH TO L_OFFSET.
      ENDWHILE.
      CONCATENATE C_GR_DIR L_GRAPHIC-GRAPHICS '.BMP' INTO L_FILENAME.
      CONCATENATE C_GR_DIR L_GRAPHIC-GRAPHICS '.BMP' INTO L_CONTENT_ID.
      L_CONTENT_TYPE = L_GRAPHIC-HTTPTYPE.
      L_OBJ_LEN = L_GRAPHIC-LENGTH.
    ADD IMAGES TO EMAIL
      CALL METHOD LO_MIME_HELPER->ADD_BINARY_PART
        EXPORTING
          CONTENT      = LT_SOLIX
         FILENAME     =
         EXTENSION    =
         DESCRIPTION  =
          CONTENT_TYPE = L_CONTENT_TYPE
          LENGTH       = L_OBJ_LEN
          CONTENT_ID   = L_CONTENT_ID
    ENDLOOP.
    DATA: LO_DOC_BCS TYPE REF TO CL_DOCUMENT_BCS,
          P_SUBJECT TYPE SO_OBJ_DES,
          LV_GBT_MIME TYPE REF TO CX_GBT_MIME,
          LV_BCOM_MIME TYPE REF TO CX_BCOM_MIME,
          LV_DOCUMENT_BCS TYPE REF TO CX_DOCUMENT_BCS.
      P_SUBJECT = 'TEST HTML EMAIL FROM SMARTFORM OUTPUT'.
      TRY.
      CALL METHOD CL_DOCUMENT_BCS=>CREATE_FROM_MULTIRELATED
        EXPORTING
          I_SUBJECT          = P_SUBJECT
          I_LANGUAGE         = SY-LANGU
          I_IMPORTANCE       = '5'
          I_SENSITIVITY      = 'F'
          I_MULTIREL_SERVICE = LO_MIME_HELPER
        RECEIVING
          RESULT             = LO_DOC_BCS
       CATCH CX_DOCUMENT_BCS INTO LV_DOCUMENT_BCS.
       CATCH CX_BCOM_MIME INTO LV_BCOM_MIME.
       CATCH CX_GBT_MIME INTO LV_GBT_MIME.
      ENDTRY.
    RECEIVERS
    DATA: P_RECEIVERS TYPE TABLE OF SOMLRECI1,
          RECEIVER TYPE SOMLRECI1,
          L_MAIL_ADDRESS TYPE AD_SMTPADR,
          LO_BCS TYPE REF TO CL_BCS,
          LV_SEND_REQ_BCS TYPE REF TO CX_SEND_REQ_BCS,
          L_USERNAME TYPE UNAME,
          SEND_PARTNER TYPE BU_PARTNER,
          LI_SENDER TYPE REF TO IF_SENDER_BCS,
          LV_ADDRESS_BCS TYPE REF TO CX_ADDRESS_BCS,
          LV_SENT_TO_ALL TYPE BOOLEAN.
    CLEAR RECEIVER.
    RECEIVER-RECEIVER = '[email protected]'.
    RECEIVER-REC_TYPE = 'U'.
    RECEIVER-COM_TYPE = 'INT'.
    APPEND RECEIVER TO P_RECEIVERS.
    L_USERNAME = SY-UNAME.
    CLEAR RECEIVER.
    LOOP AT P_RECEIVERS INTO RECEIVER.
      L_MAIL_ADDRESS = RECEIVER-RECEIVER.
      TRY.
      CALL METHOD CL_BCS=>CREATE_PERSISTENT
        RECEIVING
          RESULT = LO_BCS
       CALL METHOD LO_BCS->SET_DOCUMENT
         EXPORTING
           I_DOCUMENT = LO_DOC_BCS
       CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
      ENDTRY.
    CREATE SENDER
    CLASS CL_CAM_ADDRESS_BCS DEFINITION LOAD.
    TRY.
      IF L_USERNAME NS '@'.
        L_USERNAME = SEND_PARTNER.
        TRANSLATE L_USERNAME TO UPPER CASE.
        LI_SENDER ?= CL_SAPUSER_BCS=>CREATE( L_USERNAME ).
      ELSE.
        DATA: L_FROM_MAIL_ADDRESS TYPE AD_SMTPADR.
        L_FROM_MAIL_ADDRESS = L_USERNAME.
        LI_SENDER ?= CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( I_ADDRESS_STRING = L_FROM_MAIL_ADDRESS ).
      ENDIF.
      CALL METHOD LO_BCS->SET_SENDER
        EXPORTING
          I_SENDER = LI_SENDER
    CATCH CX_ADDRESS_BCS INTO LV_ADDRESS_BCS.
    CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
    ENDTRY.
    create recepient
    data: LO_RECEPIENT TYPE REF TO IF_RECIPIENT_BCS.
    TRY.
    CALL METHOD CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS
       EXPORTING
         I_ADDRESS_STRING = L_MAIL_ADDRESS
        I_ADDRESS_NAME   =
        I_INCL_SAPUSER   =
       RECEIVING
         RESULT           = LO_RECEPIENT
      CATCH CX_ADDRESS_BCS INTO LV_ADDRESS_BCS.
    ENDTRY.
    TRY.
    CALL METHOD LO_BCS->ADD_RECIPIENT
       EXPORTING
         I_RECIPIENT  = LO_RECEPIENT
        I_EXPRESS    =
        I_COPY       =
        I_BLIND_COPY =
        I_NO_FORWARD =
      CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
    ENDTRY.
    SEND EMAIL DOCUMENT
    TRY.
    CALL METHOD LO_BCS->SEND_REQUEST->SET_REQUESTED_STATUS
      EXPORTING
        I_REQUESTED_STATUS = 'N'
    TRY.
    CALL METHOD LO_BCS->SEND
    EXPORTING
       I_WITH_ERROR_SCREEN = SPACE
      RECEIVING
        RESULT              = LV_SENT_TO_ALL
    CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
    ENDTRY.
    ENDTRY.
    ENDLOOP.
    COMMIT WORK.

    Hi,
    I want to send the output of a smartform as html in email body.
    I found and used this bolg: :<a href="/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp HTML Email from SAP CRM/ERP</a>
    I did everything as per the blog.
    However I am getting the email as:
    sf @media print {.xsfnoprint{ display : none ;}}/* Default css layout information for SAP Smart Forms (XSF Output) Last modified: 12.05.2003 /@media screen { body { background-color : #EFEFEF ; }}@media screen { .page { border-style : outset ; border-width : 2pt ; background-color : white ; }}/@media print { .page { overflow: hidden; }}// unification browser-dependent settings /table { border-spacing: 0pt; empty-cells: show;}tr { vertical-align: top; }td input img img.icon / End of default.css */.SYSTEM div#B.par{ font-family : "Courier New" ; font-size : 12pt ; font-weight : normal ; line-height : 4.23mm ; text-decoration : none ; text-align : justify ; clear : both ;}.SYSTEM div#L.par{ font-family : "Courier New" ; font-size : 12pt ; font-weight : normal ; line-height : 4.23mm ; text-decoration : none ; text-align : left ; clear : both ;}.SYSTEM a.SYSTEM span#H.char{ font-weight : bold ;}.SYSTEM span#I.char{ font-style : italic ;}.SYSTEM span#U.char{ text-decoration : underline ;}#sfPAGE1-001.page@media screen {#MAIN.win{ overflow : auto ;}}@media print {#MAIN.win{ overflow : hidden ;}}#sfPAGE1-001.page #MAIN.win
    Welcome
    <IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48">
    I am using: Lotus notes client for email and my smartform contains only two text elements: one containing text Welcome and other containing text
    <IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48">
    When I display the document using SOST, I get the output as
    Address bar has this:  C:\Documents and Settings\EDC LTIL02\SapWorkDir\TESTHTMLEMAILFROMSMARTFORMOUTPUT_20070928154506.046_X.MHT
    and window contains:
    Welcome
    <IMG src="https://www.sdn.sap.com/sd/img/logo_header.gif" border="0" aligh="left" width="559" height="48"> "
    Regards,
    Reema
    Message was edited by:
            Reema Shahbazkar
    In case anyone needs to have a look at my code:
    REPORT  ZSMARTFORM_2_HTML_EMAIL.
    get generated function module for the smartform
    DATA: FM_NAME TYPE RS38L_FNAM.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME                 = 'ZSF_SAMPLE_HTML'
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
    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.
    get smartform contetnt
    set smartform output options
    data:
      control_parameters type SSFCTRLOP,
      OUTPUT_OPTIONS     TYPE SSFCOMPOP,
      DOCUMENT_OUTPUT_INFO  TYPE SSFCRESPD,
      JOB_OUTPUT_INFO  TYPE SSFCRESCL,
      JOB_OUTPUT_OPTIONS TYPE SSFCRESOP,
      XSFPARAM_LINE TYPE SSFXSFP,
      P_HTML TYPE TRFRESULT,
      P_GRAPHICS TYPE TSF_XSF_GR,
      WA_RETURN TYPE BAPIRET2.
    CONSTANTS: C_GR_DIR TYPE TDTEXT VALUE '/MYGRAPHICS'.
    control_parameters-NO_DIALOG = 'X'.
    *control_parameters-GETOTF = 'X'.
    OUTPUT_OPTIONS-TDNEWID = SPACE.
    OUTPUT_OPTIONS-TDIMMED = SPACE.
    OUTPUT_OPTIONS-XSFCMODE = 'X'.  "RUNTIME SETTINGS FROM SMARTFORM HEADER TO BE USED
    OUTPUT_OPTIONS-XSF = 'X'.  "XSF OUTPUT ACTIVATED
    OUTPUT_OPTIONS-XSFOUTMODE = 'A'.  "XSF OUTPUT STREAM PASSED DIRECTLY TO CALLING PROGRAM AS AN INTERNAL TABLE.
    CLEAR: OUTPUT_OPTIONS-XSFOUTDEV.  "OUTPUT SPOOL DEVICE
    OUTPUT_OPTIONS-XSFFORMAT = 'X'.  "ADDITIONALLLY TO XSF, HTML AND CSS LAYOUT INFORMATION IS ALSO PASSED TO CALLING PROGRAM
    XSFPARAM_LINE-NAME = 'GRAPHICS'.
    XSFPARAM_LINE-VALUE = 'EXTRACT'.
    APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
    XSFPARAM_LINE-NAME = 'GRAPHICS-DIRECTORY'.
    XSFPARAM_LINE-VALUE = C_GR_DIR.
    APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
    XSFPARAM_LINE-NAME = 'CONTENT-ID'.
    XSFPARAM_LINE-VALUE = 'ENABLE'.
    APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.
    CALL GENERATED FUNCTION MODULE TO GET FORM CONTENTS
    CALL FUNCTION FM_NAME
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = CONTROL_PARAMETERS
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
       OUTPUT_OPTIONS             = OUTPUT_OPTIONS
      USER_SETTINGS              = 'X'
    IMPORTING
       DOCUMENT_OUTPUT_INFO       = DOCUMENT_OUTPUT_INFO
       JOB_OUTPUT_INFO            = JOB_OUTPUT_INFO
       JOB_OUTPUT_OPTIONS         = JOB_OUTPUT_OPTIONS
    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.
    SEPARATE HTML GRAPHICAL N CSS LAYOUT CONTENT
    P_HTML = JOB_OUTPUT_INFO-XMLOUTPUT-TRFRESULT.
    P_GRAPHICS[] = JOB_OUTPUT_INFO-XMLOUTPUT-XSFGR[].
    PROCEED TO SEND EMAIL
    DATA: HTML_DATA TYPE TRFRESULT,
          L_HTML_RAW LIKE LINE OF HTML_DATA-CONTENT,
          HTML_XSTR TYPE XSTRING.
    CLEAR: HTML_XSTR.
    LOOP AT P_HTML-CONTENT INTO L_HTML_RAW.
      CONCATENATE HTML_XSTR L_HTML_RAW INTO HTML_XSTR IN BYTE MODE.
    ENDLOOP.
    HTML_XSTR = HTML_XSTR(P_HTML-LENGTH).
    SPECIAL CHARACTER CONVERSION
    DATA: HTML_STR TYPE STRING,
          HTML_LEN TYPE I.
    CALL FUNCTION 'SCP_TRANSLATE_CHARS'
      EXPORTING
        INBUFF                   = HTML_XSTR
      INBUFFLG                 = 0
       INCODE                   = '4110'  "utf-8
      OUTBUFFLG                = 0
      OUTCODE                  = '0000'
       CSUBST                   = 'X'
      SUBSTC_HASH              = ' '
      SUBSTC_DOT               = ' '
       SUBSTC_SPACE             = 'x'
      SUBSTC                   = '00035'
    IMPORTING
      INUSED                   =
       OUTBUFF                  = HTML_STR
      OUTOVERFLOW              =
       OUTUSED                  = HTML_LEN
      SUBSTED                  =
      INPUT_ENDS_IN_CHAR       =
      ERRMSG                   =
    EXCEPTIONS
      INVALID_CODEPAGE         = 1
      INTERNAL_ERROR           = 2
      CANNOT_CONVERT           = 3
      FIELDS_BAD_TYPE          = 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.
    CHANGE ENCODING UTF-8 TO LATIN1
    REPLACE ALL OCCURRENCES OF 'UTF-8' IN HTML_STR WITH 'iso-8859-1' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '<IMG' IN HTML_STR WITH '<IMG' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '/>' IN HTML_STR WITH '/>' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '<A>' IN HTML_STR WITH '' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '<' IN HTML_STR WITH '<' IGNORING CASE.
    REPLACE ALL OCCURRENCES OF '>' IN HTML_STR WITH '>' IGNORING CASE.
    HTML_LEN = STRLEN( HTML_STR ).
    DATA: L_OFFSET TYPE I,
          L_LENGTH TYPE I,
          L_DIFF TYPE I,
          LT_SOLI TYPE SOLI_TAB,
          LS_SOLI TYPE SOLI.
    L_OFFSET = 0.
    L_LENGTH = 255.
    WHILE L_OFFSET < HTML_LEN.
      L_DIFF = HTML_LEN - L_OFFSET.
      IF L_DIFF > L_LENGTH.
        LS_SOLI-LINE = HTML_STR+L_OFFSET(L_LENGTH).
      ELSE.
        LS_SOLI-LINE = HTML_STR+L_OFFSET(L_DIFF).
      ENDIF.
      APPEND LS_SOLI TO LT_SOLI.
      ADD L_LENGTH TO L_OFFSET.
    ENDWHILE.
    DATA: LO_MIME_HELPER TYPE REF TO CL_GBT_MULTIRELATED_SERVICE.
    CREATE OBJECT LO_MIME_HELPER
      EXPORTING
        CODEPAGE = '1133'.
    CALL METHOD LO_MIME_HELPER->SET_MAIN_HTML
      EXPORTING
        CONTENT     = LT_SOLI
       FILENAME    =
       DESCRIPTION =
    HANDLE GRAPHICS
    DATA: L_GRAPHIC TYPE SSF_XSF_GR,
          GR_XSTR TYPE XSTRING,
          L_GR_RAW TYPE BAPICONTEN,
          L_CONTENT_ID TYPE STRING,
          L_CONTENT_TYPE TYPE W3CONTTYPE,
          L_OBJ_LEN TYPE SO_OBJ_LEN,
          L_FILENAME TYPE STRING,
          LT_SOLIX TYPE SOLIX_TAB,
          LS_SOLIX TYPE SOLIX.
    LOOP AT P_GRAPHICS INTO L_GRAPHIC.
      CLEAR: GR_XSTR.
      LOOP AT L_GRAPHIC-CONTENT INTO L_GR_RAW.
        CONCATENATE GR_XSTR L_GR_RAW-LINE INTO GR_XSTR IN BYTE MODE.
      ENDLOOP.
      GR_XSTR = GR_XSTR(L_GRAPHIC-LENGTH).
      L_OFFSET = 0.
      L_LENGTH = 255.
      CLEAR LT_SOLIX[].
      WHILE L_OFFSET < L_GRAPHIC-LENGTH.
        L_DIFF = L_GRAPHIC-LENGTH - L_OFFSET.
        IF L_DIFF > L_LENGTH.
          LS_SOLIX-LINE = GR_XSTR+L_OFFSET(L_LENGTH).
        ELSE.
          LS_SOLIX-LINE = GR_XSTR+L_OFFSET(L_DIFF).
        ENDIF.
        APPEND LS_SOLIX TO LT_SOLIX.
        ADD L_LENGTH TO L_OFFSET.
      ENDWHILE.
      CONCATENATE C_GR_DIR L_GRAPHIC-GRAPHICS '.BMP' INTO L_FILENAME.
      CONCATENATE C_GR_DIR L_GRAPHIC-GRAPHICS '.BMP' INTO L_CONTENT_ID.
      L_CONTENT_TYPE = L_GRAPHIC-HTTPTYPE.
      L_OBJ_LEN = L_GRAPHIC-LENGTH.
    ADD IMAGES TO EMAIL
      CALL METHOD LO_MIME_HELPER->ADD_BINARY_PART
        EXPORTING
          CONTENT      = LT_SOLIX
         FILENAME     =
         EXTENSION    =
         DESCRIPTION  =
          CONTENT_TYPE = L_CONTENT_TYPE
          LENGTH       = L_OBJ_LEN
          CONTENT_ID   = L_CONTENT_ID
    ENDLOOP.
    DATA: LO_DOC_BCS TYPE REF TO CL_DOCUMENT_BCS,
          P_SUBJECT TYPE SO_OBJ_DES,
          LV_GBT_MIME TYPE REF TO CX_GBT_MIME,
          LV_BCOM_MIME TYPE REF TO CX_BCOM_MIME,
          LV_DOCUMENT_BCS TYPE REF TO CX_DOCUMENT_BCS.
      P_SUBJECT = 'TEST HTML EMAIL FROM SMARTFORM OUTPUT'.
      TRY.
      CALL METHOD CL_DOCUMENT_BCS=>CREATE_FROM_MULTIRELATED
        EXPORTING
          I_SUBJECT          = P_SUBJECT
          I_LANGUAGE         = SY-LANGU
          I_IMPORTANCE       = '5'
          I_SENSITIVITY      = 'F'
          I_MULTIREL_SERVICE = LO_MIME_HELPER
        RECEIVING
          RESULT             = LO_DOC_BCS
       CATCH CX_DOCUMENT_BCS INTO LV_DOCUMENT_BCS.
       CATCH CX_BCOM_MIME INTO LV_BCOM_MIME.
       CATCH CX_GBT_MIME INTO LV_GBT_MIME.
      ENDTRY.
    RECEIVERS
    DATA: P_RECEIVERS TYPE TABLE OF SOMLRECI1,
          RECEIVER TYPE SOMLRECI1,
          L_MAIL_ADDRESS TYPE AD_SMTPADR,
          LO_BCS TYPE REF TO CL_BCS,
          LV_SEND_REQ_BCS TYPE REF TO CX_SEND_REQ_BCS,
          L_USERNAME TYPE UNAME,
          SEND_PARTNER TYPE BU_PARTNER,
          LI_SENDER TYPE REF TO IF_SENDER_BCS,
          LV_ADDRESS_BCS TYPE REF TO CX_ADDRESS_BCS,
          LV_SENT_TO_ALL TYPE BOOLEAN.
    CLEAR RECEIVER.
    RECEIVER-RECEIVER = '[email protected]'.
    RECEIVER-REC_TYPE = 'U'.
    RECEIVER-COM_TYPE = 'INT'.
    APPEND RECEIVER TO P_RECEIVERS.
    L_USERNAME = SY-UNAME.
    CLEAR RECEIVER.
    LOOP AT P_RECEIVERS INTO RECEIVER.
      L_MAIL_ADDRESS = RECEIVER-RECEIVER.
      TRY.
      CALL METHOD CL_BCS=>CREATE_PERSISTENT
        RECEIVING
          RESULT = LO_BCS
       CALL METHOD LO_BCS->SET_DOCUMENT
         EXPORTING
           I_DOCUMENT = LO_DOC_BCS
       CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
      ENDTRY.
    CREATE SENDER
    CLASS CL_CAM_ADDRESS_BCS DEFINITION LOAD.
    TRY.
      IF L_USERNAME NS '@'.
        L_USERNAME = SEND_PARTNER.
        TRANSLATE L_USERNAME TO UPPER CASE.
        LI_SENDER ?= CL_SAPUSER_BCS=>CREATE( L_USERNAME ).
      ELSE.
        DATA: L_FROM_MAIL_ADDRESS TYPE AD_SMTPADR.
        L_FROM_MAIL_ADDRESS = L_USERNAME.
        LI_SENDER ?= CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( I_ADDRESS_STRING = L_FROM_MAIL_ADDRESS ).
      ENDIF.
      CALL METHOD LO_BCS->SET_SENDER
        EXPORTING
          I_SENDER = LI_SENDER
    CATCH CX_ADDRESS_BCS INTO LV_ADDRESS_BCS.
    CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
    ENDTRY.
    create recepient
    data: LO_RECEPIENT TYPE REF TO IF_RECIPIENT_BCS.
    TRY.
    CALL METHOD CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS
       EXPORTING
         I_ADDRESS_STRING = L_MAIL_ADDRESS
        I_ADDRESS_NAME   =
        I_INCL_SAPUSER   =
       RECEIVING
         RESULT           = LO_RECEPIENT
      CATCH CX_ADDRESS_BCS INTO LV_ADDRESS_BCS.
    ENDTRY.
    TRY.
    CALL METHOD LO_BCS->ADD_RECIPIENT
       EXPORTING
         I_RECIPIENT  = LO_RECEPIENT
        I_EXPRESS    =
        I_COPY       =
        I_BLIND_COPY =
        I_NO_FORWARD =
      CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
    ENDTRY.
    SEND EMAIL DOCUMENT
    TRY.
    CALL METHOD LO_BCS->SEND_REQUEST->SET_REQUESTED_STATUS
      EXPORTING
        I_REQUESTED_STATUS = 'N'
    TRY.
    CALL METHOD LO_BCS->SEND
    EXPORTING
       I_WITH_ERROR_SCREEN = SPACE
      RECEIVING
        RESULT              = LV_SENT_TO_ALL
    CATCH CX_SEND_REQ_BCS INTO LV_SEND_REQ_BCS.
    ENDTRY.
    ENDTRY.
    ENDLOOP.
    COMMIT WORK.

  • SMARTFORMS - Adicionar linha no Smart em tempo de execução

    Bom dia Pessoal.
    Desenvolvi um Fomulário no Smartforms para Nota QM - RNC Fornecedor, onde pego determinado número de nota, e através desse número copio as informações das tabelas em uma estrutura de dados no qual criei. Tudo estava tranquilo, até que a tabela 'QMMA' apareceu. Tenho vários registros para uma nota, tornando-se necessário imprimir as informações desses registros no SmartForms.
    O SmartForms esta desenvolvido para receber apenas uma linha de registro, porém seria necessário adicionar linhas no formulário. Dependendo da nota, pode existir um registo ou N registros. Ficando conforme demonstra a imagem a baixo. Sendo assim, tem como via código, deixar o SmartForms dinâmico? Se não, qual seria a solução?
    Exemplo.:
    Caso alguém possa me ajudar desde já agradeço.
    Att. Guilherme Urbinatti.

    I tried to understand your question using Altavista's Babel fish.
    As far as I know you cannot change the menu programmatically.
    The only way is to merge all of your menus to one big menu and hide the
    appropriate menu entries using SET_MENU_ITEM_PROPERTY.
    Babel fish translates my answer to
    Tanto quanto eu sei você não pode mudar o menu programmatically.
    A única maneira deve fundir todos seus menus a um menu grande e
    esconder as entradas apropriadas do menu usando SET_MENU_ITEM_PROPERTY.

  • In SMARTFORMS when openee a Text Node,   Giving a Short Dump

    Hi
    I am getting Short Dump in SMARTFORMS Transaction, when ever I opened a Text Node and made some changes in it.
    With out opening a Text Node I can able to change and activate the SmartForm.
    But if I open a Text Node I can able to make changes in the Text Node but later if i click on any other Node, it is giving a Short Dump.
    But all other systems in my office are working fine.
    I have tried the Utilities->Settings-> and changed the editor also. 
    I have also Installed the SAPGUI once again for this Issue. But still I am getting the same problem.
    Can anyone Please help me on this Issue.
    I am sending the error enalysis of the Short Dump.
    Error analysis
        Short text of error message:
        Control Framework : Error processing control
        Long text of error message:
         Diagnosis
             An error occurred when the system tried to process the commands
             from the Automation Queue on the presentation server.
             There are several possible reasons for this:
             - The installation of the SAP GUI on the presentation server is
             faulty or obsolete.
             - There is an error in the application program
             - There is an error in the SAPGUI or an integrated control
         Procedure
             1. Make sure that you have imported the appropriate Support
             Package, the current kernel, and GUI patch for the release of your
             system
             2. Check whether the error occurs locally on one or a few PCs, or
             generally on all PCs. Note whether the error only occurs for some
             users, for example because of a specific Customizing setting.
             If it only occurs locally, this suggests an installation problem
             with the PC. Check the installation; if necessary, reinstall the
             software. In the dump, search for the SY-MSGLI field, since it may
             point to the cause of the error.
             3. Activate the Automation Trace (in accordance with SAP Note
             158985).
             4.Start the transaction and continue until the screen immediately
             before the dump.
             5. From the System -> Utilities menu, choose Autom. Queue,
             Synchronous Processing.
             The status bar of the GUI displays the text:
                "Automation synchron flush mode on"
             6. If you now proceed with the application, the short dump will
             display the ABAP call that caused the error; the Automation Trace
             will contain the error on the presentation server.
             7. If necessary, load the short dump and trace files on to
             sapservX, so that SAP can analyze them.
        Technical information about the message:
        Message class....... "CNDP"
        Number.............. 006
    Thanks in Advance.

    Hi
    I think dump is because of SAP GUI. If you are ECC 6.0 then install SAP GUI 710 with patch level  2 or more and check
    Regards
    Shiva

  • Driver program for BIll of lading smartform

    Hi all,
    Can you please provide me the standard driver program for bill of lading smartform.
    or for purchase order smartform.
    Thanks and regards,
    Rajeev

    Hi,
      For Purchase Order - SAPFM06P.
    And for future info,
      If you Know the Application and Output Type - Then it is very easy to know the Smartform or the Script Used.
    1.Go to NACE and Check.
      For Ex: PO belong to APP type EF, So click on EF and then click on "Output Type " button.
                  Then all the output types will be displayed.Then select the required and Click on "Processing Functions". Then you can see the Configuration details done for this ouput type like which smartform, which subroutine.
    2.Also, You can check the TNAPR table entries by entring the below information
    Output Type, Message transmission medium, Application.
    Thanks & Regards,
    Vamsi.

  • Printing Dunning Letters using Smartforms

    Hi all,
    I have a requirement wherein I need to print dunning letters using smartforms; the dunning data are extracted in program SAPF150D2;I modified the subroutine OFI_DUN_ACT to call function module FI_PRINT_DUNNING_NOTICE_SMARTF.
    Now I need to extract the dunning data in program SAPF150D2 to be imported to my new form using GET_SF_DUNN_DATA, my question is where do I code the calling of FM GET_SFG_DUNN_DATA? I'm a little bit confused on the step by step process of the dunning data extraction to printing of the form... Thanks...

    In the INITIALIZATION of the Smartforms, after the call to  GET_SF_DUNN_DATA, you have a many informations back, of which the record of MHNK and an internal table of MHND, which you can use to select other informations from database.
    So fill or enrich your own internal table in the initialization.
    I enclose thereafter a sample to help you
    * Load data
      CALL FUNCTION 'GET_SF_DUNN_DATA'
           EXPORTING
                is_sfparam          = is_sfparam
           IMPORTING
                es_mhnk             = mhnk
                es_t001             = t001
                es_knb5             = knb5
                es_lfb5             = lfb5
                es_t047             = t047
                es_t047c            = t047c
                es_t047i            = t047i
                es_t056z            = t056z
                es_f150d            = f150d
                es_fsabe            = fsabe
                es_adrnr            = adrnr
                es_uadrnr           = uadrnr
                es_adrs             = adrs
                es_uadrs            = uadrs
                es_t047b            = t047b
                eb_testprint        = testprint
                e_langu             = langu
                e_lang2             = lang2
                es_f150d_esr        = f150d_esr
                es_paymi            = paymi
                es_paymo            = paymo
           TABLES
                t_mhnd              = th_mhnd
           EXCEPTIONS
                no_parameters_found = 1
                OTHERS              = 2.
    IF sy-subrc <> 0.
      sy-msgid = 'FM'.
      sy-msgty = 'E'.
      sy-msgno = 461.
      RAISE others.
    ENDIF.
    h_t040a-text1 = space.
    show_interest = space.
    LOOP AT th_mhnd INTO mhnd WHERE xzins = ' '.
      show_interest = 'X'.
      EXIT.
    ENDLOOP.
    * Load user information
    DATA: usr21 LIKE usr21, addr3_sel LIKE addr3_sel.
    CLEAR: usr21, addr3_sel, addr3_val, adr6.
    * Charger fiche profil
    SELECT SINGLE * FROM usr21 WHERE bname = sy-uname.
    * Récupérer l'adresse
    MOVE-CORRESPONDING usr21 TO addr3_sel.
    CALL FUNCTION 'ADDR_PERS_COMP_GET'
         EXPORTING
              address_pers_in_comp_selection = addr3_sel
         IMPORTING
              address_pers_in_comp_value     = addr3_val
         EXCEPTIONS
              OTHERS                         = 1.
    * load SMTP address
    CLEAR adr6.
    SELECT SINGLE * FROM adr6
      WHERE addrnumber = usr21-addrnumber
        AND persnumber = usr21-persnumber.
    * date format
    SET COUNTRY adrs-land1.
    * Group similar posts
    DATA: xbseg TYPE bseg,
          xbkpf TYPE bkpf,
          xpost TYPE th_outtab.
    REFRESH: t_post, t_cumul_waers.
    LOOP AT th_mhnd INTO mhnd.
    * Select lines to use
      IF mhnk-gmvdt IS INITIAL.
        IF mhnd-xzalb <> space OR mhnd-mansp <> space.
          CONTINUE.
        ELSEIF t047b-xpost NE 'X' AND mhnd-xfael <> 'X'.
          CONTINUE.
        ENDIF.
      ENDIF.
    * Map data
      CLEAR xpost.
      MOVE-CORRESPONDING mhnd TO xpost.
    * Load text from bseg
      SELECT SINGLE sgtxt INTO xpost-sgtxt FROM bseg
        WHERE bukrs EQ mhnd-bbukrs AND belnr EQ mhnd-belnr
          AND gjahr EQ mhnd-gjahr  AND buzei EQ mhnd-buzei.
      PERFORM edit_text CHANGING xpost-zuonr mhnd-xblnr xpost-sgtxt.
    * if "Payment difference" get the date of original document
      IF mhnd-bschl = '06'.
        SELECT SINGLE bldat INTO xpost-bldat
          FROM bkpf
          WHERE bukrs = mhnd-bukrs
            AND belnr = mhnd-rebzg
            AND gjahr = mhnd-rebzj.
      ENDIF.
    * Collect posts to print
      COLLECT xpost INTO t_post.
    * Collect amount per currency
      MOVE-CORRESPONDING xpost TO cumul.
      COLLECT cumul INTO t_cumul_waers.
    ENDLOOP.
    * Load customer information
    SELECT SINGLE * FROM kna1 INTO kna1
      WHERE kunnr = mhnk-kunnr.
    SELECT SINGLE * FROM knb1 INTO knb1
      WHERE bukrs = mhnk-bukrs
        AND kunnr = mhnk-kunnr.
    * Convert date to text
    PERFORM convert_date USING control_parameters-langu mhnk-laufd
      CHANGING text_date.
    PERFORM convert_date USING control_parameters-langu mhnk-prndt_before
      CHANGING text_prev.
    PERFORM convert_date USING control_parameters-langu mhnk-grdat
      CHANGING text_extr.
    Regards

Maybe you are looking for

  • How to retrieve all my backup data after iphone 4 has been restored as new?

    did a factory restore on my iphone 4 today and set it up as a new phone in my itune, last time when i restored from backup, all my older data were synched to my phone... but now i'm clueless about how to get all that back, where are my data once the

  • After install Oracle92 on RedHat80,An Error Occured.

    I successfully Installed Oracle92 on redhat80. but after the installer installed oracle92,an error occured when attemp to run net config,database config ... the error message: jre was not found in /oracle/product/920/oracle.swd.jre/bin/i386/native_th

  • Lightroom 4.1 upgrade installation problem

    Hi ! So, I've downloaded the 4.1 upgrade on the desktop of my Mac. This is the : Lightroom_4_LS11_mac_4_1.dmg When I double tap on it, a new window opens and says that this file is impossible to open because it is a non-recognizable file. Is it somet

  • Unable to view my BCC recipients in Sent Mail - please help!

    I used BCC when sending mail to our alumni group (over 1000 members) about a month ago. I need to view the list of recipients in those e-mails from the BCC field - the problem is in my mail app I cannot view the BCC list for some reason in my sent ma

  • UCCX 7.0 – Agent not logging on 'NATed' UCCX – License server down

    Hello everybody, One external network needs to work with our private CCM/CCX system. The IP phones are installed on our managed network and they work fine, but the Cisco Agent Desktop is installed on the external PCs. To protect and to secure both ne