Global defination ...in smart forms..

hi all  'smart forms' gurus...
how to declare table fields in global defination wat is to rite under variable name and associated type..

Hi,
In 'Global Data' tab, variable name is name of internal tables or work areas or global variables etc...
Ex:
In 'Types' tab declare all user defined structures, data types.
TYPES:
BEGIN OF r_itab,
vbeln TYPE vbrk-vbeln,
vkorg TYPE vbrk-vkorg,
vtweg TYPE vbrk-vtweg,
spart TYPE vbrk-spart,
fkdat TYPE vbrk-fkdat,
END OF r_itab.
In 'Global Data' tab, declare internal tables, work areas, global variables.
Varibale name        Type assignment         Associated type
ITAB                       TYPE TABLE OF         R_ITAB            <----- Internal table
WA                         TYPE                         R_ITAB            <----- Work area
VAR                        TYPE                          I                     <----- Variable

Similar Messages

  • How to print global variable in smart form table cell

    hi,
    i have smartform and i insert table in it, i also have set global variable, i want to show variable in table cell.
    regards
    shahid rais

    Hi Shahid Rais 
    You can use this global variable that has been declared in anywhere as you like.
    For displaying global variable in table lines, You can first set the column and row of the table by using the table tab in table node . Then, u can decide either the variable u want to used will be placed on header, main, or footer. After that, right click on one of the table part, and choose create table line. After choosing the correct line type as already been declared in the table painter, just simply right click on the table cell, and then create text node.
    You can now enter your variable by using "insert field".
    And don't forget the & & signs before and after your variable name.
    Regards,
    William Prawira

  • Dispalying different field at SMART FORM report

    hi,
    i have created a code for displaying GRTXT i-e(Reason for Movement) in smart from from table T157E.This is the code:
    SELECT SINGLE GRTXT FROM T157E
      INTO GV_GRTXT
      WHERE GRUND eq '1'
      or    grund eq '2'
      or    grund eq '3'
      AND   SPRAS eq 'E'.
    where GV_GRTXT is a Global Definations at smart form.when i execute it,it gives me filed in GERMAN even tough i restricted it with SPRAS field and given me wrong REASON FOR MOVEMNT.for example at MIGO application it shows me INCOMPLETE
    with GRUND(Reason for Movement) 2 and at my report it shows me Qualität mangelhaft with GRUND(Reason for Movement)  2.
    Kindly tell me in the coding what is the mistake which had been made by me.
    Thanks.
    sappk25

    hi Suhas Saha,
    If i have to display GRUND (1,2,3) in my coding how can i display it because when i use AND conidition in coding it gives null values:
    SELECT SINGLE GRTXT FROM T157E
      INTO GV_GRTXT
      WHERE bwart eq '122'
      AND GRUND eq 001
      AND GRUND eq 002
      AND GRUND eq 003
      AND SPRAS eq 'E''.
    and if i used OR condition it gives me result in GERMAN i-e:
    SELECT SINGLE GRTXT FROM T157E
      INTO GV_GRTXT
      WHERE bwart eq '122'
      AND GRUND eq 001
      or GRUND eq 002
      or GRUND eq 003
      AND SPRAS eq 'E'
    and in the last if i used IN condition it gives the result of wrong REASON OF MOVEMENT at smart form which i verify from MIGO.i-e:
    SELECT SINGLE GRTXT FROM T157E
      INTO GV_GRTXT
      WHERE bwart eq '122'
      AND GRUND in (001,002,003)
      AND SPRAS eq 'E'
    Thanks,
    sappk25

  • Smart forms and global data

    are parameters defined in global data in smart forms unavailable in form routines to be used
    I am working on lbbil_invoice std smart form for invoices and trying to use gs_it_gen type lbbil_it_gen that is been defined in global data. Will I have to define another wa of the same type in my sub routine ?

    I am working on a smart form right now
    I define in global data
    gv_fabrictext type char64
    gv_fabriccode type mara-j3afcc
    then in my form routines i create a sub routine
    FORM fcc_values USING gv_fabrictext.
    and making computations to calculate gv_fabrictext
    then i use a program code and call perform fcc_values using gv_fabrictext with gv_fabrictext as input and output parameters
    Is this correct? Why do I have to define gv_fabriccode type mara-j3afcc  in the form routine even though its been defined in global data

  • Global definitions error  in Smart Forms

    Hi friends ,
    I'm printing invoices of 3 tables....in this i have to print VBRP net value details field is netwr,for this field already i have assigned waerk in currency/quant fields...even i am getting this below  error..
    "Global Definitions     The data object "IM_FS_VBRK" does not have a component called "WAERK"."
    would u tell me how can i rectify this error.

    Hi,
    How have you defined IM_FS_VBRK in Global definitions of smart forms?
    Regards,
    Jayesh

  • 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.

  • Smart Form for Delivery Returns

    Hi guys
    I am in the process of defining a Smart Form as an output after doing a Goods Return in MIGO via a Delivery.
    And I am using the form ZSD_DELNOTE_SUPP in the transaction 'SAPSMARTFORMS'
    however, i am not able to determine which are the fields that would be relevant to defining this....
    I keep putting in and taking out fields, but I am still not able to generate an output
    Can anyone please shed some light on this
    Thank you
    Rukshana

    Hiya Andrew
    if you type in SMARTFORMS - it takes u to the form painter.
    I wish I could use a standard existing form but I dont knw any
    My requirement is
    When we do a MIGO for a Returns Delivery {A02 return Delivery -movement type 122} via a SD delivery document, we need to generate an output.
    My transactions would be - MIGO, then VL02n, then MB02 and I attach the output type to my material document;
    I do a get printout now, however its very basic and not what the users need.
    So I need to create a Smart form; My problem is that I did find a standard smart form for deliveries from SAP Help - ZSD_DELNOTE_SUPP but this holds only SD specific tables and fields
    My requirement includes MM specific stuff too - and thats where I am stuck
    Thanks for the support
    Rukshana

  • Variable declared in global definition smart form

    Hi,
    We have defined an internal table 'it_table' in the global definition. We are unable to use  'it_table' in 'Page and Windows' loop statement.
    Kindly suggest.
    Regards,

    Hi Sanjay,
      There are 2 cases exist for your problem :
       1. If you are filling the desired internal table and wants to pass that table to your smart form for loop processing than you have to declare it in the form interface ; As the name itself sounds the interface ,Which means it provide an interface to pass data from Print program (Driver program) to smart form.
        But for this the table type can be only the DDIC structure not the one you are declaring in your print program as it will not recognize it.
      2. But in second case if you are filling the internal table into your smart from than ,table should be declared in the Global definition.
         The way is as :
         Go to ->global definition->type tab declare the type as :
          types : begin of t_vbap,
              vbeln type vbeln_va,
              posnr type POSNR_VA,
              matnr type matnr,
              netwr type NETWR_AP,
            end of t_vbap.
         Now declare a table type for the previously created type as follows :
         types : it_vbap type t_vbap occurs 0.
         (You can go to SE11 and create a table type there also for same)
         Now go to the Global data tab and declare your table as follows :
         I_VBAP    TYPE   IT_VBAP
         Now I_VBAP will be a table. and you can carry on your processing.
    Please award point by clicking star.

  • How to drag global data in text editor in smart forms

    Hello friends,
    I am doing a smartform. I tried to drag the global data from field list and drop it in text editor but its not working.
    can you please help me how to do that or is it need any extra settings?
    Please help me friends.
    Thanks,
    Manisha
    Edited by: PATIL MANISHA on Apr 23, 2010 12:14 PM

    Hi Manisha,
    It is looking very strange. But still try to do following may be helpfull.
    1. First activate your smart form after declaring the variable in Global definition. Then try to drag n drop from Field list
    2. Or else click on Editor tab of Text node, Then Goto-> change editor (You will get a editor same as Sapscripts)
    put the variable like that:
    HT : &W_TOTAL-MASSG&
    Try this. Best luck...
    Regrads,
    Lokesh.

  • Diff. btwn Form Interface & Global definations?

    Hi Guys,
    Wat r the differences between Form Interface and Global definations(if possible with example)? Pls. list out.
    Thank you.

    When you create a SmartForm and activate it creates a function module which has same interface as the Form Interface of the smartform. Smartforms are always called by calling the corresponding function module. There is 1 fm for each smartform. The form interface has the IMPORT, EXPORT, TABLES and EXCEPTION, same like in a fm
    Global definitions in smartforms is used to define data variables, type definitions, field symbols, form routines etc which are used globally withing the smartform. Every part of SmartForm  can access these objects defined in Global definitions.
    <a href="http://img483.imageshack.us/img483/297/globaldefinitionsqa4.jpg">SmartForms Global Definitions</a>
    <a href="http://img390.imageshack.us/img390/2193/forminterfacebo2.jpg">Form Interface of a Smartform</a>

  • How to define variable for smart form in coding

    hi all,
    i have to create a variable for smart form which is i already created in  smart form but facing some sort of difficulties.
    for example:
    DATA:  formname  TYPE ZCCCL_GOODS_RECEIPT.(SMART FORM NAME)
    DATA:  formname  TYPE ZCCL_RETURN_VENDOR. (SMART FORM NAME)
    DATA:  formname   TYPE ZCCL_GOODS_RESERVATION.(SMART FORM NAME)
    CASE in_mseg-bwart.
      WHEN '101' or '105' or '321'.
      formname = 'FORM_RECEIPT'.
      WHEN '122' or '124'.
      formname = 'FORM_RETURN_VENDOR'.
      WHEN '201' or '261'.
      formname = 'FORM_GOODS_RESERVATION'.
    ENDCASE.
    So this the logic im using but it gave me error like:
    Type  ZCCCL_GOODS_RECEIPT is unknown.
    Kindly tell me if this coding is wrong than what should i use.
    Thanks.

    Declare variable name for smartform as
    Formname type TDSFNAME in import tab.

  • Function module of smart form delivered an error

    Hi All,
    I am getting an error like this
    "Function module /1BCDWB/SF00000007 of smart form delivered an error"
    FUNCTION /1BCDWB/SF00000007.
    ""Global interface:
    *"       IMPORTING
    *"             VALUE(ARCHIVE_INDEX) TYPE  TOA_DARA OPTIONAL
    *"             VALUE(ARCHIVE_PARAMETERS) TYPE  ARC_PARAMS OPTIONAL
    *"             VALUE(CONTROL_PARAMETERS) TYPE  SSFCTRLOP OPTIONAL
    *"             VALUE(MAIL_APPL_OBJ) TYPE  SWOTOBJID OPTIONAL
    *"             VALUE(MAIL_RECIPIENT) TYPE  SWOTOBJID OPTIONAL
    *"             VALUE(MAIL_SENDER) TYPE  SWOTOBJID OPTIONAL
    *"             VALUE(OUTPUT_OPTIONS) TYPE  SSFCOMPOP OPTIONAL
    *"             VALUE(USER_SETTINGS) TYPE  TDBOOL DEFAULT 'X'
    *"             VALUE(ARCHIVE_INDEX_TAB) TYPE  TSFDARA OPTIONAL
    *"             REFERENCE(ORDERADM_H) TYPE  CRMT_OUTPUT_ORDERADM_H_COM
    *"             REFERENCE(ACTIVITY_H) TYPE  CRMT_OUTPUT_ACTIVITY_H_COM
    *"             REFERENCE(OPPORT_H) TYPE  CRMT_OUTPUT_OPPORT_H_COM
    *"             REFERENCE(ORGMAN_H) TYPE  CRMT_OUTPUT_ORGMAN_H_COM
    *"             REFERENCE(PARTNER_H) TYPE  CRMT_OUTPUT_PARTNER_H_COMT
    *"             REFERENCE(PRICINGDATA_H) TYPE
    *"                             CRMT_OUTPUT_PRICINGDATA_H_COM
    *"             REFERENCE(SALES_H) TYPE  CRMT_OUTPUT_SALES_H_COM
    *"             REFERENCE(SHIPPING_H) TYPE  CRMT_OUTPUT_SHIPPING_H_COM
    *"             REFERENCE(PAYPLAN_D_H) TYPE
    *"                             CRMT_OUTPUT_PAYPLAN_D_H_COMT
    *"             REFERENCE(CUMULAT_H) TYPE  CRMT_OUTPUT_CUMULAT_H_COM
    *"             REFERENCE(CUSTOMER_H) TYPE  CRMT_OUTPUT_CUSTOMER_H_COM
    *"             REFERENCE(ACS_H) TYPE  CRMT_ACS_H_COM
    *"             REFERENCE(BILLING_H) TYPE  CRMT_OUTPUT_BILLING_H_COMT
    *"             REFERENCE(CANCEL_H) TYPE  CRMT_OUTPUT_CANCEL_H_COMT
    *"             REFERENCE(APPOINTMENT_H) TYPE
    *"                             CRMT_OUTPUT_APPOINTMENT_H_COMT
    *"             REFERENCE(BILLPLAN_D_H) TYPE
    *"                             CRMT_OUTPUT_BILLPLAN_D_H_COMT
    *"             REFERENCE(BILLPLAN_H) TYPE  CRMT_OUTPUT_BILLPLAN_H_COMT
    *"             REFERENCE(STATUS_D_H) TYPE  CRMT_OUTPUT_STATUS_D_H_COMT
    *"             REFERENCE(STATUS_H) TYPE  CRMT_OUTPUT_STATUS_H_COMT
    *"             REFERENCE(SRV_SUBJECT_H) TYPE
    *"                             CRMT_OUTPUT_SRV_SUBJECT_H_COMT
    *"             REFERENCE(SRV_SUBJECT_I) TYPE
    *"                             CRMT_OUTPUT_SRV_SUBJECT_H_COMT
    *"             REFERENCE(SRV_REASON_H) TYPE
    *"                             CRMT_OUTPUT_SRV_REASON_H_COMT
    *"             REFERENCE(SRV_RESULT_H) TYPE
    *"                             CRMT_OUTPUT_SRV_RESULT_H_COMT
    *"             REFERENCE(SRV_REFOBJ_H) TYPE
    *"                             CRMT_OUTPUT_SRV_REFOBJ_H_COMT
    *"             REFERENCE(SRV_REFOBJ_I) TYPE
    *"                             CRMT_OUTPUT_SRV_REFOBJ_H_COMT
    *"             REFERENCE(ORDERADM_I) TYPE  CRMT_OUTPUT_ORDERADM_I_COMT
    *"             REFERENCE(ORDERADM_I_IN) TYPE
    *"                             CRMT_OUTPUT_ORDERADM_I_IN_COMT
    *"             REFERENCE(ORDERADM_I_QT) TYPE
    *"                             CRMT_OUTPUT_ORDERADM_I_QT_COMT
    *"             REFERENCE(ORGMAN_I) TYPE  CRMT_OUTPUT_ORGMAN_I_COMT
    *"             REFERENCE(PRICINGDATA_I) TYPE
    *"                             CRMT_OUTPUT_PRICINGDATA_I_COMT
    *"             REFERENCE(PRICING_I) TYPE  CRMT_OUTPUT_PRICING_I_COMT
    *"             REFERENCE(PRODUCT_I) TYPE  CRMT_OUTPUT_PRODUCT_I_COMT
    *"             REFERENCE(SALES_I) TYPE  CRMT_OUTPUT_SALES_I_COMT
    *"             REFERENCE(SERVICE_I) TYPE  CRMT_OUTPUT_SERVICE_I_COMT
    *"             REFERENCE(SCHEDLIN_I) TYPE  CRMT_OUTPUT_SCHEDLIN_I_COMT
    *"             REFERENCE(SCHEDLIN_I_CF) TYPE
    *"                             CRMT_OUTPUT_SCHEDLIN_I_CF_COMT
    *"             REFERENCE(SHIPPING_I) TYPE  CRMT_OUTPUT_SHIPPING_I_COMT
    *"             REFERENCE(PARTNER_I) TYPE  CRMT_OUTPUT_PARTNER_I_COMT
    *"             REFERENCE(ITEM_CSTICS_I) TYPE  CRMT_ITEM_CSTICS_TAB
    *"             REFERENCE(CUSTOMER_I) TYPE  CRMT_OUTPUT_CUSTOMER_I_COMT
    *"             REFERENCE(BILLING_I) TYPE  CRMT_OUTPUT_BILLING_I_COMT
    *"             REFERENCE(CANCEL_I) TYPE  CRMT_OUTPUT_CANCEL_I_COMT
    *"             REFERENCE(FINPROD_I) TYPE  CRMT_OUTPUT_FINPROD_I_COMT
    *"             REFERENCE(ORDPRP_I) TYPE  CRMT_OUTPUT_ORDPRP_I_COMT
    *"             REFERENCE(APPOINTMENT_I) TYPE
    *"                             CRMT_OUTPUT_APPOINTMENT_I_COMT
    *"             REFERENCE(BILLPLAN_D_I) TYPE
    *"                             CRMT_OUTPUT_BILLPLAN_D_I_COMT
    *"             REFERENCE(BILLPLAN_I) TYPE  CRMT_OUTPUT_BILLPLAN_I_COMT
    *"             REFERENCE(STATUS_I) TYPE  CRMT_OUTPUT_STATUS_I_COMT
    *"             REFERENCE(WORKING_SET_E_S_BBP) TYPE
    *"                             /1CN/WORKING_SET_E_S_BBP_T
    *"             REFERENCE(LANGUAGE) TYPE  SY-LANGU
    *"             REFERENCE(SERVICE_I_ASSI) TYPE
    *"                             CRMT_OUTPUT_SERVICE_I_***_COMT
    *"             VALUE(FORM_TYPE) TYPE  C OPTIONAL
    *"             REFERENCE(Y_V_PARTNER_FLAG) TYPE  C OPTIONAL
    *"       EXPORTING
    *"             VALUE(DOCUMENT_OUTPUT_INFO) TYPE  SSFCRESPD
    *"             VALUE(JOB_OUTPUT_INFO) TYPE  SSFCRESCL
    *"             VALUE(JOB_OUTPUT_OPTIONS) TYPE  SSFCRESOP
    *"       EXCEPTIONS
    *"              FORMATTING_ERROR
    *"              INTERNAL_ERROR
    *"              SEND_ERROR
    *"              USER_CANCELED
    DATA: %INPUT     TYPE SSFCOMPIN,
          %RESULT_OP TYPE SSFCRESOP,
          %RESULT_PD TYPE SSFCRESPD,
          %RESULT_CL TYPE SSFCRESCL,
          %TABDEF    LIKE LINE OF %TABDEFS,
          %ARCTAB    TYPE TSFDARA,
          BEGIN OF %FULLNAME,
            FORM TYPE TDSFNAME VALUE 'YCRM_ORDER_SERVICE_RMA',
            VARI TYPE TDVARIANT,
            ACTV TYPE TDBOOL VALUE 'X',
          END OF %FULLNAME.
    TYPES: T_XDF_ELEM(255)    TYPE C,
           T_XDF_ATTR(255)    TYPE C.
    DATA:  IMPORT_PARAMETER   TYPE TABLE OF RSIMP WITH HEADER LINE,
           CHANGING_PARAMETER TYPE TABLE OF RSCHA WITH HEADER LINE,
           TABLES_PARAMETER   TYPE TABLE OF RSTBL WITH HEADER LINE,
           EXPORT_PARAMETER   TYPE TABLE OF RSEXP WITH HEADER LINE,
           EXCEPTION_LIST     TYPE TABLE OF RSEXC WITH HEADER LINE.
    DATA:  XDF_TABLE          TYPE TSFIXML,
           XDF_LENGTH         TYPE I.
    DATA:  XDF_DOCUMENT       TYPE REF TO IF_IXML_DOCUMENT,
           XDF_PARAMETER      TYPE REF TO IF_IXML_ELEMENT,
           L_NAME             TYPE STRING,
           L_VALUE            TYPE STRING,
           L_OBJECT           TYPE STRING,
           L_DATE             TYPE STRING,
           L_TIME             TYPE STRING,
           RC                 TYPE SY-SUBRC.
    FIELD-SYMBOLS: <DATA_OBJECT> TYPE ANY.
    CLASS CL_IXML DEFINITION LOAD.
    CONSTANTS: C_XDF_ROOT_ELEMENT TYPE T_XDF_ELEM VALUE 'XDF',
           C_XDF_ATTR_TYPE       TYPE T_XDF_ATTR VALUE 'TYPE',
           C_XDF_ATTR_TIMESTAMP  TYPE T_XDF_ATTR VALUE 'TIMESTAMP',
           C_XDF_ATTR_OBJ        TYPE T_XDF_ATTR VALUE 'OBJECT'.
    DATA:  XDF_FACTORY      TYPE REF TO IF_IXML,
           XDF_ROOT_ELEMENT TYPE REF TO IF_IXML_ELEMENT.
    DATA:  L_GETSTATE    TYPE DDTYPEGET,
           L_TYPE        TYPE DDTYPEKIND,
           L_TYPE_NAME   TYPE TYPENAME,
           L_DDIC_OBJ    TYPE DDTYPES OCCURS 0 WITH HEADER LINE,
           L_DD02L_STATE TYPE DD02L   OCCURS 0 WITH HEADER LINE,
           L_DD04L_STATE TYPE DD04L   OCCURS 0 WITH HEADER LINE,
           L_DD40L_STATE TYPE DD40L   OCCURS 0 WITH HEADER LINE,
           L_XMLOUTPUT   TYPE SSFXMLOUT,
           L_SFSY        TYPE SFSY.
    TYPE-POOLS: ABAP.
    DATA: XDF2_IXML        TYPE REF TO IF_IXML,
          XDF2_DOCUMENT    TYPE REF TO IF_IXML_DOCUMENT,
          XDF2_SRC_OBJECTS TYPE ABAP_TRANS_SRCBIND_TAB,
          XDF2_SRC_OBJECT  LIKE LINE OF XDF2_SRC_OBJECTS.
    DEFINE XDF2_APPEND_SRC_OBJECT.
      XDF2_SRC_OBJECT-NAME  = '&1'.
      TRANSLATE XDF2_SRC_OBJECT-NAME TO UPPER CASE.
      GET REFERENCE OF &2 INTO XDF2_SRC_OBJECT-VALUE.
      APPEND XDF2_SRC_OBJECT TO XDF2_SRC_OBJECTS.
    END-OF-DEFINITION.
    DEFINE XDF_GET_DDIC_INFO.
      CLEAR L_DDIC_OBJ.
      IF NOT &2 IS INITIAL.
        L_TYPE_NAME = &2.
      ELSEIF NOT &1-TYP IS INITIAL.
        L_TYPE_NAME = &1-TYP.
      ELSEIF NOT &1-LINE_OF IS INITIAL.
        L_TYPE_NAME = &1-LINE_OF.
      ELSEIF NOT &1-TABLE_OF IS INITIAL.
        L_TYPE_NAME = &1-TABLE_OF.
      ELSE.
        CLEAR L_TYPE_NAME.
      ENDIF.
      CALL FUNCTION 'DDIF_TYPEINFO_GET'
           EXPORTING TYPENAME = L_TYPE_NAME
           IMPORTING TYPEKIND = L_TYPE.
      L_DDIC_OBJ-TYPENAME = L_TYPE_NAME.
      L_DDIC_OBJ-TYPEKIND = L_TYPE.
      IF NOT L_DDIC_OBJ IS INITIAL.
        COLLECT L_DDIC_OBJ.
      ENDIF.
    END-OF-DEFINITION.
    DEFINE XDF_CREATE_DATA_STREAM.
      CLEAR: L_OBJECT, L_DATE, L_TIME, L_NAME, L_TYPE_NAME, L_VALUE.
      IF &3 = 'T'.
        CONCATENATE &1-PARAMETER '[]' INTO L_NAME.
      ELSE.
        L_NAME = &1-PARAMETER.
      ENDIF.
      IF NOT &2 IS INITIAL.
        ASSIGN (L_NAME) TO <DATA_OBJECT>
               CASTING TYPE (&2).
        L_TYPE_NAME = &2.
      ELSEIF NOT &1-TYP IS INITIAL.
        ASSIGN (L_NAME) TO <DATA_OBJECT>
               CASTING TYPE (&1-TYP).
        L_TYPE_NAME = &1-TYP.
      ELSEIF NOT &1-LINE_OF IS INITIAL.
        ASSIGN (L_NAME) TO <DATA_OBJECT>.
        L_TYPE_NAME = &1-LINE_OF.
      ELSEIF NOT &1-TABLE_OF IS INITIAL.
        ASSIGN (L_NAME) TO <DATA_OBJECT>.
        L_TYPE_NAME = &1-TABLE_OF.
      ELSE.
        ASSIGN (L_NAME) TO <DATA_OBJECT>.
        CLEAR L_TYPE_NAME.
      ENDIF.
      CALL FUNCTION 'SDIXML_DATA_TO_DOM'
           EXPORTING
                 NAME        = L_NAME
                 DATAOBJECT  = <DATA_OBJECT>
           IMPORTING
                 DATA_AS_DOM = XDF_PARAMETER
           CHANGING
                  DOCUMENT    = XDF_DOCUMENT
             EXCEPTIONS
                  OTHERS      = 1.
      L_NAME  = C_XDF_ATTR_TYPE.
      L_VALUE = L_TYPE_NAME.
      CALL METHOD XDF_PARAMETER->SET_ATTRIBUTE
           EXPORTING NAME      = L_NAME
                        VALUE     = L_VALUE
           RECEIVING RVAL      = RC.
      CLEAR L_DDIC_OBJ.
      READ TABLE L_DDIC_OBJ WITH KEY TYPENAME = L_TYPE_NAME.
      CASE L_DDIC_OBJ-TYPEKIND.
        WHEN 'S'.
          READ TABLE L_DD02L_STATE WITH KEY TABNAME = &1-TYP.
          L_DATE = L_DD02L_STATE-AS4DATE.
          L_TIME = L_DD02L_STATE-AS4TIME.
          L_OBJECT = 'TABL'.
        WHEN 'E'.        " data elements
          READ TABLE L_DD04L_STATE WITH KEY ROLLNAME = &1-TYP.
          L_DATE = L_DD04L_STATE-AS4DATE.
          L_TIME = L_DD04L_STATE-AS4TIME.
          L_OBJECT = 'DTEL'.
        WHEN 'L'.        " table types
          READ TABLE L_DD40L_STATE WITH KEY TYPENAME = &1-TYP.
          L_DATE = L_DD40L_STATE-AS4DATE.
          L_TIME = L_DD40L_STATE-AS4TIME.
          L_OBJECT = 'TTYP'.
        WHEN OTHERS.
          CLEAR: L_DATE, L_TIME, L_OBJECT.
      ENDCASE.
      L_NAME  = C_XDF_ATTR_OBJ.
      CALL METHOD XDF_PARAMETER->SET_ATTRIBUTE
           EXPORTING NAME      = L_NAME
                     VALUE     = L_OBJECT
           RECEIVING RVAL      = RC.
      L_NAME  = C_XDF_ATTR_TIMESTAMP.
      CONCATENATE L_DATE L_TIME INTO L_VALUE.
      CALL METHOD XDF_PARAMETER->SET_ATTRIBUTE
           EXPORTING NAME      = L_NAME
                     VALUE     = L_VALUE
           RECEIVING RVAL      = RC.
      CALL METHOD XDF_ROOT_ELEMENT->APPEND_CHILD
           EXPORTING NEW_CHILD = XDF_PARAMETER
           RECEIVING RVAL      = RC.
      CHECK RC = 0.
    END-OF-DEFINITION.
    CLEAR DOCUMENT_OUTPUT_INFO.
    CLEAR JOB_OUTPUT_INFO.
    CLEAR JOB_OUTPUT_OPTIONS.
    L_SFSY = SFSY.
    CLEAR SFSY.
    SFSY-PAGE = L_SFSY-PAGE.
    SFSY-FORMPAGES = L_SFSY-FORMPAGES.
    SFSY-JOBPAGES = L_SFSY-JOBPAGES.
    SFSY-XDF = L_SFSY-XDF.
    SFSY-XDF2 = L_SFSY-XDF2.
    CLEAR INTSFSY.
    IF CONTROL_PARAMETERS-NO_OPEN = SPACE.
       CALL FUNCTION 'SSF_CREATE_COMPOSER_INPUT'
            EXPORTING
                 ARCHIVE_PARAMETERS = ARCHIVE_PARAMETERS
                 USER_SETTINGS      = USER_SETTINGS
                 MAIL_SENDER        = MAIL_SENDER
                 MAIL_RECIPIENT     = MAIL_RECIPIENT
                 MAIL_APPL_OBJ      = MAIL_APPL_OBJ
                 OUTPUT_OPTIONS     = OUTPUT_OPTIONS
                 CONTROL_PARAMETERS = CONTROL_PARAMETERS
            IMPORTING
                 INPUT              = %INPUT.
      IF OUTPUT_OPTIONS-XSFCMODE = SPACE.
        %INPUT-XSF        = ' '.
        %INPUT-XSFOUTMODE = ' '.
        %INPUT-XSFOUTDEV  = ' '.
        %INPUT-XSFACTION  = ' '.
        %INPUT-XSFFORMAT  = ' '.
      ENDIF.
      CALL FUNCTION 'SSFCOMP_OPEN'
           EXPORTING  INPUT  = %INPUT
           IMPORTING  RESULT = %RESULT_OP
           EXCEPTIONS OTHERS = 1.
      IF SY-SUBRC <> 0.
        %VARIANT = SPACE.
        PERFORM %RAISE.
      ENDIF.
      JOB_OUTPUT_OPTIONS = %RESULT_OP.
    ENDIF.
    IF SFSY-XDF = 'X'.
      CALL FUNCTION 'FUNCTION_IMPORT_INTERFACE'
           EXPORTING
                FUNCNAME           = '/1BCDWB/SF00000007'
                INACTIVE_VERSION   = SPACE
           TABLES
                IMPORT_PARAMETER   = IMPORT_PARAMETER
                CHANGING_PARAMETER = CHANGING_PARAMETER
                TABLES_PARAMETER   = TABLES_PARAMETER
                EXPORT_PARAMETER   = EXPORT_PARAMETER
                EXCEPTION_LIST     = EXCEPTION_LIST
           EXCEPTIONS
                OTHERS             = 1.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      L_GETSTATE-TBHD = L_GETSTATE-TBFD = L_GETSTATE-DTEL = 'X'.
      L_GETSTATE-TTHD = L_GETSTATE-TTFD = 'X'.
      LOOP AT IMPORT_PARAMETER.
        XDF_GET_DDIC_INFO IMPORT_PARAMETER IMPORT_PARAMETER-DBFIELD.
      ENDLOOP.
      LOOP AT CHANGING_PARAMETER.
        XDF_GET_DDIC_INFO CHANGING_PARAMETER
                          CHANGING_PARAMETER-DBFIELD.
      ENDLOOP.
      LOOP AT TABLES_PARAMETER.
        XDF_GET_DDIC_INFO TABLES_PARAMETER TABLES_PARAMETER-DBSTRUCT.
      ENDLOOP.
      CALL FUNCTION 'DD_TYPEINFO_GET'
           EXPORTING  GETSTATE    = L_GETSTATE
           TABLES     DDTYPES_TAB = L_DDIC_OBJ[]
                      DD02L_TAB   = L_DD02L_STATE[]
                      DD04L_TAB   = L_DD04L_STATE[]
                      DD40L_TAB   = L_DD40L_STATE[].
      XDF_FACTORY = CL_IXML=>CREATE( ).
      XDF_DOCUMENT = XDF_FACTORY->CREATE_DOCUMENT( ).
      L_NAME = C_XDF_ROOT_ELEMENT.
      XDF_ROOT_ELEMENT
           = XDF_DOCUMENT->CREATE_ELEMENT( NAME = L_NAME ).
      CALL METHOD XDF_DOCUMENT->APPEND_CHILD
           EXPORTING  NEW_CHILD  = XDF_ROOT_ELEMENT
           RECEIVING  RVAL       = RC.
      CHECK RC = 0.
      LOOP AT IMPORT_PARAMETER.
        XDF_CREATE_DATA_STREAM IMPORT_PARAMETER
                               IMPORT_PARAMETER-DBFIELD 'I'.
      ENDLOOP.
      LOOP AT CHANGING_PARAMETER.
        XDF_CREATE_DATA_STREAM CHANGING_PARAMETER
                               CHANGING_PARAMETER-DBFIELD 'C'.
      ENDLOOP.
      LOOP AT TABLES_PARAMETER.
        XDF_CREATE_DATA_STREAM TABLES_PARAMETER
                               TABLES_PARAMETER-DBSTRUCT 'T'.
      ENDLOOP.
      CALL FUNCTION 'SSFCOMP_XDF_OUTPUT'
           EXPORTING  DOCUMENT = XDF_DOCUMENT
           EXCEPTIONS OTHERS   = 1.
    ELSEIF SFSY-XDF2 = 'X'.
      XDF2_IXML     = CL_IXML=>CREATE( ).
      XDF2_DOCUMENT = XDF2_IXML->CREATE_DOCUMENT( ).
      XDF2_APPEND_SRC_OBJECT ARCHIVE_INDEX ARCHIVE_INDEX.
      XDF2_APPEND_SRC_OBJECT ARCHIVE_PARAMETERS ARCHIVE_PARAMETERS.
      XDF2_APPEND_SRC_OBJECT CONTROL_PARAMETERS CONTROL_PARAMETERS.
      XDF2_APPEND_SRC_OBJECT MAIL_APPL_OBJ MAIL_APPL_OBJ.
      XDF2_APPEND_SRC_OBJECT MAIL_RECIPIENT MAIL_RECIPIENT.
      XDF2_APPEND_SRC_OBJECT MAIL_SENDER MAIL_SENDER.
      XDF2_APPEND_SRC_OBJECT OUTPUT_OPTIONS OUTPUT_OPTIONS.
      XDF2_APPEND_SRC_OBJECT USER_SETTINGS USER_SETTINGS.
      XDF2_APPEND_SRC_OBJECT ARCHIVE_INDEX_TAB ARCHIVE_INDEX_TAB.
      XDF2_APPEND_SRC_OBJECT ORDERADM_H ORDERADM_H.
      XDF2_APPEND_SRC_OBJECT ACTIVITY_H ACTIVITY_H.
      XDF2_APPEND_SRC_OBJECT OPPORT_H OPPORT_H.
      XDF2_APPEND_SRC_OBJECT ORGMAN_H ORGMAN_H.
      XDF2_APPEND_SRC_OBJECT PARTNER_H PARTNER_H.
      XDF2_APPEND_SRC_OBJECT PRICINGDATA_H PRICINGDATA_H.
      XDF2_APPEND_SRC_OBJECT SALES_H SALES_H.
      XDF2_APPEND_SRC_OBJECT SHIPPING_H SHIPPING_H.
      XDF2_APPEND_SRC_OBJECT PAYPLAN_D_H PAYPLAN_D_H.
      XDF2_APPEND_SRC_OBJECT CUMULAT_H CUMULAT_H.
      XDF2_APPEND_SRC_OBJECT CUSTOMER_H CUSTOMER_H.
      XDF2_APPEND_SRC_OBJECT ACS_H ACS_H.
      XDF2_APPEND_SRC_OBJECT BILLING_H BILLING_H.
      XDF2_APPEND_SRC_OBJECT CANCEL_H CANCEL_H.
      XDF2_APPEND_SRC_OBJECT APPOINTMENT_H APPOINTMENT_H.
      XDF2_APPEND_SRC_OBJECT BILLPLAN_D_H BILLPLAN_D_H.
      XDF2_APPEND_SRC_OBJECT BILLPLAN_H BILLPLAN_H.
      XDF2_APPEND_SRC_OBJECT STATUS_D_H STATUS_D_H.
      XDF2_APPEND_SRC_OBJECT STATUS_H STATUS_H.
      XDF2_APPEND_SRC_OBJECT SRV_SUBJECT_H SRV_SUBJECT_H.
      XDF2_APPEND_SRC_OBJECT SRV_SUBJECT_I SRV_SUBJECT_I.
      XDF2_APPEND_SRC_OBJECT SRV_REASON_H SRV_REASON_H.
      XDF2_APPEND_SRC_OBJECT SRV_RESULT_H SRV_RESULT_H.
      XDF2_APPEND_SRC_OBJECT SRV_REFOBJ_H SRV_REFOBJ_H.
      XDF2_APPEND_SRC_OBJECT SRV_REFOBJ_I SRV_REFOBJ_I.
      XDF2_APPEND_SRC_OBJECT ORDERADM_I ORDERADM_I.
      XDF2_APPEND_SRC_OBJECT ORDERADM_I_IN ORDERADM_I_IN.
      XDF2_APPEND_SRC_OBJECT ORDERADM_I_QT ORDERADM_I_QT.
      XDF2_APPEND_SRC_OBJECT ORGMAN_I ORGMAN_I.
      XDF2_APPEND_SRC_OBJECT PRICINGDATA_I PRICINGDATA_I.
      XDF2_APPEND_SRC_OBJECT PRICING_I PRICING_I.
      XDF2_APPEND_SRC_OBJECT PRODUCT_I PRODUCT_I.
      XDF2_APPEND_SRC_OBJECT SALES_I SALES_I.
      XDF2_APPEND_SRC_OBJECT SERVICE_I SERVICE_I.
      XDF2_APPEND_SRC_OBJECT SCHEDLIN_I SCHEDLIN_I.
      XDF2_APPEND_SRC_OBJECT SCHEDLIN_I_CF SCHEDLIN_I_CF.
      XDF2_APPEND_SRC_OBJECT SHIPPING_I SHIPPING_I.
      XDF2_APPEND_SRC_OBJECT PARTNER_I PARTNER_I.
      XDF2_APPEND_SRC_OBJECT ITEM_CSTICS_I ITEM_CSTICS_I.
      XDF2_APPEND_SRC_OBJECT CUSTOMER_I CUSTOMER_I.
      XDF2_APPEND_SRC_OBJECT BILLING_I BILLING_I.
      XDF2_APPEND_SRC_OBJECT CANCEL_I CANCEL_I.
      XDF2_APPEND_SRC_OBJECT FINPROD_I FINPROD_I.
      XDF2_APPEND_SRC_OBJECT ORDPRP_I ORDPRP_I.
      XDF2_APPEND_SRC_OBJECT APPOINTMENT_I APPOINTMENT_I.
      XDF2_APPEND_SRC_OBJECT BILLPLAN_D_I BILLPLAN_D_I.
      XDF2_APPEND_SRC_OBJECT BILLPLAN_I BILLPLAN_I.
      XDF2_APPEND_SRC_OBJECT STATUS_I STATUS_I.
      XDF2_APPEND_SRC_OBJECT WORKING_SET_E_S_BBP WORKING_SET_E_S_BBP.
      XDF2_APPEND_SRC_OBJECT LANGUAGE LANGUAGE.
      XDF2_APPEND_SRC_OBJECT SERVICE_I_ASSI SERVICE_I_ASSI.
      XDF2_APPEND_SRC_OBJECT FORM_TYPE FORM_TYPE.
      XDF2_APPEND_SRC_OBJECT Y_V_PARTNER_FLAG Y_V_PARTNER_FLAG.
      XDF2_APPEND_SRC_OBJECT JOB_OUTPUT_INFO JOB_OUTPUT_INFO.
      CALL TRANSFORMATION ID
           SOURCE (XDF2_SRC_OBJECTS)
           RESULT XML XDF2_DOCUMENT.
      CALL FUNCTION 'SSFCOMP_XDF2_OUTPUT'
        EXPORTING
          DOCUMENT = XDF2_DOCUMENT
        EXCEPTIONS
          OTHERS   = 1.
      IF SY-SUBRC <> 0. RAISE ERROR. ENDIF.
    ELSE.
      %FULLNAME-VARI = %VARIANT.
      %VARIANT = SPACE.
      IF %HEADER IS INITIAL.
        IMPORT HEADER   TO %HEADER
               REFTAB   TO %REFTAB
               DOCSTRUC TO %DOCSTRUC
               TABDEF   TO %TABDEFS
               FROM DATABASE STXFCONTR(SF) ID %FULLNAME.
        IF SY-SUBRC <> 0.
          CALL FUNCTION 'SSFRT_SET_ERROR_PARAMETERS'
               EXPORTING I_FORM      = 'YCRM_ORDER_SERVICE_RMA'.
          CALL FUNCTION 'SSFRT_WRITE_ERROR'
               EXPORTING I_ERRNUMBER = SSF_ERR_NO_RUNTIME_OBJECT
                         I_MSGID     = 'SSFCOMPOSER'
                         I_MSGNO     = '002'
                         I_MSGV1     = 'YCRM_ORDER_SERVICE_RMA'.
          PERFORM %RAISE.
        ENDIF.
        SELECT SINGLE SDATE STIME FROM D010SINF
          INTO (%HEADER-SDATE, %HEADER-STIME)
          WHERE PROG    = '/1BCDWB/SAPLSF00000007'
            AND R3STATE = 'A'.
        IF SY-SUBRC <> 0.
          CLEAR: %HEADER-SDATE,
                 %HEADER-STIME.
        ENDIF.
      ENDIF.
      LOOP AT %TABDEFS INTO %TABDEF.
        CALL FUNCTION 'SSFCOMP_TABLE_DEFINITION'
             EXPORTING  CPI    = %HEADER-CPI
                        LPI    = %HEADER-LPI
             CHANGING   TABDEF = %TABDEF
             EXCEPTIONS OTHERS = 1.
        IF SY-SUBRC <> 0. PERFORM %RAISE. ENDIF.
      ENDLOOP.
      CALL FUNCTION 'SSFRT_SET_REFERENCES'
           EXPORTING I_REFTAB = %REFTAB .
      CALL FUNCTION 'SSFRT_SET_LANGUAGES'
           EXPORTING I_CONTROL_PARAMETERS = CONTROL_PARAMETERS
                     I_MASTERLANGUAGE     = 'E'
                     I_THRULANG           = ' '
                     I_INSTALL_LANG       = ' '
           IMPORTING O_LANGUAGES          = %LANGUAGES.
      %HEADER-LANGU = %LANGUAGES-LANGU1.
      %WEXIT = SPACE.
      PERFORM %GLOBAL_CLEAR.
      PERFORM %GLOBAL_INIT.
      CLEAR %ARCTAB.
      IF ARCHIVE_INDEX_TAB[] IS INITIAL.
        APPEND ARCHIVE_INDEX TO %ARCTAB.
      ELSE.
        %ARCTAB = ARCHIVE_INDEX_TAB.
      ENDIF.
    > CALL FUNCTION 'SSFCOMP_PROCESS_DOCUMENT'
           EXPORTING  HEADER           = %HEADER
                      DOCSTRUC         = %DOCSTRUC
                      STARTPAGE        = CONTROL_PARAMETERS-STARTPAGE
                      ARCHIV_INDEX_TAB = %ARCTAB
                      MAIL_APPL_OBJECT = MAIL_APPL_OBJ
           IMPORTING  RESULT           = %RESULT_PD
           EXCEPTIONS OTHERS           = 1.
      IF SY-SUBRC <> 0. PERFORM %RAISE. ENDIF.
      DOCUMENT_OUTPUT_INFO = %RESULT_PD.
    ENDIF.
    The function module 'SSFCOMP_PROCESS_DOCUMENT' is returning sy-subrc value 1.
    Could you please tell me how to rectify this error
    Thanks and Regards,
    Soumya.

    The error I am getting is a formatting error as shown below:
    L_ERROR-MSGTY                  E
    L_ERROR-MSGID                  SSFCOMPOSER
    L_ERROR-MSGV1                  YTI_FCR004_RETREP_TYPE

  • INCLUDE TEXT IN SMART-FORMS

    Hi,
    I m converting Sap-script into smart form.
    In SAP-script "Header'' window contain code like that:
    /:   INCLUDE &T024E-TXKOP& OBJECT TEXT ID ADRS LANGUAGE &EKKO-SPRAS& PARAGRAP >
    I need to use this logic in my Smart-form "Header" node.
    Plz tell me how can i use this logic without any error.
    It's very urgent.
    Thanks & Regards,
    Gaurav.

    Hello Gaurav,
    You need to create a text element for this. In the text element type, you have a drop-down where you select include text.
    There are corresponding boxes for OBJECT & ID where you type in TEXT & ADRS respectively.
    You gotto define 2 global variables: V_TXKOP & V_SPRAS which you have to populate from T024E & EKKO respectively.
    In fact its much easier than SAPscrits. In case of any issues do let me know.
    Regards,
    Suhas

  • How to use standard Smart forms

    hi All,
    Pls give me the detail for smartform ie how to use standard smart forms and how to modify them in SAP 4.7EE
    Thanks,
    Nitin

    Hi,
    first u copy the standrad smartform to z and then modify it,
    SOME STANDARD SMARTFORMS
    SF_EXAMPLE_01,
    SF_EXAMPLE_02,
    SF_EXAMPLE_03,
    LB_BILL_INVOICE,
    ENETR SMARTFORMS TCODE
    PRESS F4 HERE U FIND ALL STANDARD SMARTFORMS
    OR
    U GO TO TRANSACTION CODE NACE
    SAMPLE PROGRAM FOR SMARTFORM,
    . 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.
    Thanks&Regards,
    Phani
    POINTS HELPFUL

  • Smart Form problem with address layout

    Hello everyone,
    I need your help please for a smart form problem. We need the address layout for great britain with street1, street2 etc. but currently street2 is alligned before street1.
    We are using the FM ADDRESS_INTO_PRINTFORM (SAP standard address node) and according to the documenation the layout for GB is different as we see it currently.
    We have checked the sold-to and all contact persons, they have as country GB and language EN maintained.
    In customizing for address screen layout there is nothing chosen (tested to set up Europe, but did not change anything).
    For the customizing 'specify my countries...' we have maintained GB as country with the address layout key 006, vehicle country key GB and language key EN.
    For the described setting shouldn't there be designed the address in our smart forms according to 006? Anyhting in customizing we missed?
    Thanks a lot for your answers.
    Torsten

    Hi,
    Try to use line priority of FM, below is a brief of documentation. You can read it more in FM documentation:
    Control Parameters
    See also the parameter documentation.
    ADDRESS_TYPE - Address type (from 3.0C)
    There are three types of address:
    Address type '1': addresses of firms or organizations; the address
    structure which is used in most SAP applications as 'Address'.
    Address type '2': address of a person
    Address type '3': work address, usually the address of a contact person
    in a company
    The default value SPACE for the address type is handled like type '1',
    and is needed for the upwards-compatibility of the function module.
    Which parameters are used for which address type is explained in the
    ADDRESS_TYPE parameter documentation.
    The three character "address layout key" of the recipient country (LAND1) controls which of the available country-specific routines is used to format addresses for the country in question. This key is stored in field T005-ADDRS and is entered in Customizing under Global settings -> Set countries -> Define countries, on the detail screen under "Address layout key".
    Keys for customer routines in the SAP enhancement SZAD0001 can be
    maintained via the transaction SM30 (extended table maintenance),table
    name T005A, in the customer name range, and be assigned in country customizing.
    The address attributes are passed in the structures ADDRESS1 (type 1), ADDRESS2 (type 2), ADDRESS3 (type 3) or ADRSWA_IN (type SPACE).
    NUMBER_OF_LINES (ADRSWA_IN-ANZZL)
    The number of lines available for the address layout. If the number of
    lines is not sufficient for the complete layout of an address, then
    lines are consecutively suppressed according to the rules of the country in question. Use the parameter LINE_PRIORITY (ADRSWA_IN-PRIOR) overrules the standard sequence in which the output lines are to be suppressed.
    LINE_PRIORITY (ADRSWA_IN-PRIOR)
    If not equal to SPACE, this field overwrites the standard sequence in
    which the lines are suppressed if the available number of lines ANZZL is
    insufficient.
    The standard sequence is defined as follows:
    Type 1:   'AP43HRT7I86LC2BS5O'       (GB:  'APRT4327I86CBS5LO')
    Type 2:   'APHRT7I86LCBS5O'          (GB:  'PRT7I86CBS5LO')
    Type 3:   'APF43HR7I86TLC2BSND5O'    (GB:  'APRT4327I86CBS5LNDIO')
    where (if they occupy a line of their own):
    A = Title
    P = Mandatory empty line 1
    F = Function of the contact person in the company
    4 = Name 4
    3 = Name 3
    H = Different city
    R = Region
    T = District
    L = Name of country
    C = Postal code
    T = District
    7 = Street 3 (field STR_SUPPL2)
    I = Street 5 (field LOCATION)
    8 = Street 4 (field STR_SUPPL3)
    6 = Street 2 (field STR_SUPPL1)
    L = Country
    C = Postal code
    2 = Name 2
    B = PO Box
    S = Street or PO Box
    5 = c/o name
    N = Name (and title) of a person
    D = Department
    O = City
    Which of these attributes are available for maintenance can vary. All
    fields exist in Business Address Services.
    STREET_HAS_PRIORITY (ADRSWA_IN-WAREN)
    'X': Street has priority over PO Box (delivery address for example)
    ' ': PO Box has priority over street. This is the default value.
    regards,

Maybe you are looking for