Smartform subroutine

Hi to all
Please Help me Regarding This i Have to convert integer value into Text format , in smartform
how to call Function Module in Smartform or how to call subroutine from smartform?
Please help me regarding this.
thanks In Advancd
Somnath K.

In global definition there is tab for form routines, write ur form routine inside it, and call respective perform whereever u want ur code, insert codelines node for this purpose.
check this smartform documentation
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf
see page 64 and 95 in it.
кu03B1ятu03B9к
Edited by: kartik tarla on Jan 30, 2009 1:53 PM

Similar Messages

  • Background for smartforms

    Hi,
       Please explain me the steps for creating background in smartforms.
    Regards,
    Sreeja

    Displaying a Background Picture for Copy Purposes
    Use
    In your business procedures, you may often want to use existing forms as patterns for creating new ones. You can easily do this by scanning the exising form into the computer, displaying it as background picture, and copying it over. In the Form Painter, you can use windows to copy over the output areas of a form; in the Table Painter, you can use cells to copy over templates. This section describes how to do it.
    Prerequisites
    You must import any graphics into the SAP System using Administering Form Graphics (transaction SE78 ):
    Double-click a graphic format in the tree structure in the folder Document Server ® GRAPHICS ® General graphics.
    Choose Graphic ® Import.
    The transaction imports the graphic and stores it on the Business Document Server (BDS). Now you can display it in a form.
    See also: Graphic Administration.
    Procedure
    Insert your graphic as background picture of a page (see: Creating Pages). The graphic appears in the Form Painter as soon as you update your entries by pressing ENTER .
    Use the Form Painter to overlay the graphic with a window. To make this easier, select the option Transparent Window on the General tab of the Form Builder settings ().
    Create a template in this window. To position the template, set the Vertical Alignment to Absolute (from top). You find this option on the Template tab in the Details view.
    Without this setting, SAP Smart Forms cannot display a background picture in the Table Painter, because then the vertical position of the template in the window depends on previous, possibly dynamic, output.
    If you encounter problems when trying to set the vertical alignment, save your Smart Form, exit SAP Smart Forms completely, and call the form again. See also Note 375087 in the SAPNet.
    When you switch to the Table Painter after making these settings, an additional checkbox Display Background Picture appears. Mark this checkbox.
    Result
    The background graphic appears in the Table Painter. The right and left margins in the Table Painter, as usual, correspond to the right and left window borders. Copy over the lines of the pattern. To draw lines more exact, deactivate the Align With Grid attribute in the Table Painter.
    With complex patterns, divide the page into several windows. This makes it easier to copy over the individual smaller patterns.
    Step wise
    SMART FORM Creation
    uSING TABLE IN Smart Form
    1) Tcode --> SmartForms
    2) Form name --> Z_SF_TEST Create
    3) Under Global settings
    a) Form Interface
    Table Tab
    ITAB LIKE EKPO
    b) GLOBAL Definitions
    WA_NETPR LIKE EKPO-NETPR
    In smart forms if we want to display quantity and currency fields. We can't directly display currency field and quantity fields
    For that we have to create an extra variable in global definitions
    Ex: netpr FIELD of EKPO
    CREATE program lines and specify WA_NETWR = itab-netpr.
    4) RT CLick on main Window
    CREATE --> TABLE
    Click Table painter
    DEFAULT %LTYPE will be Created
    a) If you want more like Header footer etc add by rt click on %LTYPE1
    Table (Tab)
    %LTYPE Radio(SELECT) 5 CM 5 CM 6 CM
    CLICK on DATA (Tab)
    INTERNAL TABLE ITAB LIKE ITAB
    5)RT click on table control and create --> program lines
    General attribute (Tab)
    INPUT PARAMETER OUTPUT PARAMETER
    itab WA_NETPR
    Code Area
    WA_NETWR = ITAB-NETPR.
    6) RT CLcick on table ctl and create 3 text to display the fields
    a) % text1 +button(insert field)
    FIELD name &itab-ebeln&
    Output options (tab)
    Check New line LINETYPE %Ltype1
    check new cell
    b) % text2
    & itab-ebelp&
    output options
    check new cell
    c) % text2
    & wa_netpr&
    output options
    check new cell
    Report ac
    Tables ekpo.
    Data: itab1 like ekpo occurs 0 with header line.
    select * into table itab1 from ekpo.
    Call function module
    Smartforms are same as sapscripts. The transaction code to create the smart forms is SMARTFORMS. Check out these sites for step by step procedure.
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    http://help.sap.com/saphelp_nw04/helpdata/en/9b/e3b0d9c2a711d3b558006094192fe3/frameset.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sapgenie.com/abap/smartforms_detail.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%0samples/smartforms/smartform%20in%20abap.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/smartforms/subroutine%20and%20select-option%20in%20smartform.pdf
    http://www.sap-basis-abap.com/sapsf001.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9b/e3b0d9c2a711d3b558006094192fe3/frameset.htm
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    http://esnips.com/doc/7e67af5c-6188-4252-8613-41816756d560/from-sappres.pdf
    http://esnips.com/doc/58566115-54a4-4405-8872-8de952e245e5/smartform.pdf
    http://esnips.com/doc/2276d194-dc47-4b1e-9c14-7af0ffe923ca/smartforms-xsf-output.pdf
    http://esnips.com/doc/13b7ae7a-b32c-4b96-b588-881859d4ac99/Template,Table,Loop,Command-in-Smartforms.doc
    http://esnips.com/doc/97acb00a-e513-4611-91f0-c626f460bfc5/Smart_Form_Overview.pdf
    http://esnips.com/doc/77a981b9-8fe3-4fbb-8101-67745c1fe60c/SMART-FORMS_shail.ppt
    http://help.sap.com/saphelp_nw04/helpdata/en/9b/e3b0d9c2a711d3b558006094192fe3/frameset.htm
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    I suggest you to use the Unit CH(CHARACTERS) for the Left Margin and Width and
    LN(LINES) for Upper margin and Height
    SMARTFORMS STEPS.
    1. In Tcode se11 Create a structure(struct) same like the Internal table that you are going to use in your report.
    2. Create Table type(t_struct) of stracture in se11.
    3. In your program declare Internal table(Itab) type table of structure(struct).
    4. Define work area(wa) like line of internal table.
    5. Open Tcode Smartforms
    6. In form Global setting , forminterface Import parameter define Internal table(Itab) like table type of stracture(t_struct).
    7. In form Global setting , Global definitions , in Global data define Work area(wa) like type stracture(struct).
    8. In form pages and window, create Page node by default Page1 is available.
    9. In page node you can create numbers of secondary window. But in form there is only one Main window.
    10. By right click on page you can create windows or Go to Edit, Node, Create.
    11. After creating the window right click on window create table for displaying the data that you are passing through internal table.
    12. In the table Data parameter, loop internal internal table (Itab) into work area(wa).
    13. In table there are three areas Header, Main Area, Footer.
    14. Right click on the Main area create table line by default line type1 is there select it.
    15. Divide line into cells according to your need then for each cell create Text node.
    16. In text node general attribute. Write down fields of your work area(wa) or write any thing you want to display.
    17. Save form and activate it.
    18. Then go to Environment, function module name, there you get the name of function module copy it.
    19. In your program call the function module that you have copied from your form.
    20. In your program in exporting parameter of function pass the internal table(itab).
    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.
    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 or command-controlled )
    &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 ).
    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
    Advantages of SAP Smart Forms
    SAP Smart Forms have the following advantages:
    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)
    You can search www.help.sap.com for more details.
    The following wesites provide details about ABAP and smartforms
    http://cma.zdnet.com/book/abap/index.htm
    http://www.sapgenie.com
    http://www.sappoint.com
    http://abap4.0catch.com/SAP_and_ABAP_Links.html#SAP_Hints_and_Tips
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://help.sap.com/saphelp_46c/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/htm/english.htm
    http://www.sap-img.com/smartforms/smart-001.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sap-img.com/smartforms/smart-002.htm
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-basis-abap.com/smartforms/smartforms-in-details.htm
    http://www.erpgenie.com/abap/smartforms_detail.htm

  • Info on Smartforms...

    Can some plz give the links where i can find enough stuff on smartforms
    thanx

    Hi,
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap-code-samples/smartforms/subroutine and select-option in smart forms.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap-code-samples/smartforms/tutorial with code sample on smart forms.pdf
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    Mailing in smartforms.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap-code-samples/smartforms/smart form in abap.pdf
    Kindly reward points by clicking the star on the left of the reply if you find it as useful.

  • SCRIPT or SFORM?

    Hi Experts,
    Could u please advise? i have requirement to develop form, but i don't know wheather i have to go for Scripts or SF, i am on <b>6.0</b>, in req. they gave Model for Standard form. as i.e.,
    '<b>SD_SHIPMENT_CMR</b>.' output type CMR1.
    I am new to SF, please provide SF tutorial links to develop SF.
    Please suggest.
    Thanks in advance.
    Vishnu.

    Hi
    Check out these sites. These sites will provide u step by step procedure of how to create smartforms.
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    Smart Forms Documentation.
    http://help.sap.com/saphelp_nw04/helpdata/en/9b/e3b0d9c2a711d3b558006094192fe3/frameset.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sapgenie.com/abap/smartforms_detail.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%0samples/smartforms/smartform%20in%20abap.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/smartforms/subroutine%20and%20select-option%20in%20smartform.pdf
    http://www.sap-basis-abap.com/sapsf001.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    Regards
    Sudheer

  • Debug Smart form

    Hi any body tell me How to debug smartform?
            thanks and Regards,
                  Praveen.

    In the Smartform, create a Code Node and within the Code Node you can hardcode a normal abap Break Point.
    Insert a "Program Line" just above the node you want to debug and this program line write a normal abap breakpoint. So whenever you call the smartforms, it will stop at this breakpoint and you can debug onwards.
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sapgenie.com/abap/smartforms_detail.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    Documentation in smartforms:
    http://www.sap-basis-abap.com/sapsf001.htm
    How to trace smartform is available in this link.
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    Tutorials in smartforms:You can download and use the same to study.
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/smartforms/smartform%20in%20abap.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/smartforms/subroutine%20and%20select-option%20in%20smartform.pdf
    I hope this helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • How to call Subroutines,Standard Text  & using Internal Table in SmartForm

    Hi all,
    need help in the following areas.Its very urgent!
    1.How to CAll Subroutines in Smart Forms
    2.How to CAll Standard Text in Smart Forms
    Situation:
    We have an Internal Table T_SALES with all the data which am going to display in the smartform,How to retrive data from an internal table in Smart forms
    Any Help in this direction would be highly appreciated.
    Regards
    Ramu

    Hi,
      When you are using quantity or currency fields, you have to mentiong the reference fileds in a tab called CURRENCY/QUANTITY FILEDS in the GLOBAL DATA node.
    Specifying a Currency or Quantity Reference
    Use
    In the ABAP Dictionary, you can assign a currency or quantity field to a table field. In the output of these fields, the system can then insert the relevant currency or unit:
    ·        If the value field is in the same table as the corresponding currency or quantity field, the system recognizes the reference automatically, and formats the value field according to the currency or unit in the assigned field.
    ·        If the value field is in a different table from the currency or quantity field, the system cannot recognize this reference automatically.
    In the second case, you must indicate this reference to the system in the form, to ensure that the value field is formatted correctly.
    Procedure
    You want to assign a currency or quantity field in one table (for example, CURTAB) to a value field in another table (for example, VALTAB).
           1.      Create the reference to the currency field by entering the following values:
    -         Field Name: VALTAB-VALUE, if this is the value field of VALTAB that you want to display.
    -         Reference Field: CURTAB-CURRENCY, which is the currency field of CURTAB.
           2.      Under Data Type, specify whether the data type is a currency or quantity.
    Result
    In the output of the PDF-based print form, the system formats the value field VALTAB-VALUE according to the assigned value in the currency or quantity field of the global variable CURTAB-CURRENCY.
    Thanks and Regards,
    Bharat Kumar Reddy.V
    Message was Added by: Bharat Reddy V
    Message was Added by: Bharat Reddy V

  • How to use SUBROUTINE in ' PROGRAMMING LINES'code of a smartform

    Hi all,
    i used a subroutine (PERFORM statement ) in 'Programming Line' node of a smartform .
    Then i put the 'FORM ENDFORM ' in 'SUBROUTINES' node of GLOBAL data.
    In Programming line i used
       PERFORM READ_TEXT using p_id p_lan p_obj.
    In SUBROUTINE node of GLOBAL data, i used
    FORM READ_TEXT using p_id p_lan p_obj.
    ENDFORM.
    While executing, my control is going to FORM ENDFORM  & i can see the data in the
    table T_TDLINE while my control is inside the FORM ENDFORM.
    When it comes back to my Programming NODE, there is no data in T_TDLINE table.
    can anyone tell me how & where to define this table T_TDLINE so that i can get the data
    in in my coding lines after PERFORM statement.
    ur Idea is highly appreciated. correct answers will be rewarded.
    Thanks
    pabitra

    1. Define a table in the Global Definiation > GLOBAL data:
    T_TDLINE TYPE TTTEXT.
    2. PERFORM READ_TEXT tables T_TDLINE using p_id p_lan p_obj.
    3. FORM READ_TEXT table IT_TDLINE type TTTEXT
    using p_id p_lan p_obj.
    ENDFORM.
    Now, you will be able access your data in T_TDLINE.
    Regards,
    Naimesh Patel

  • Subroutine code in smartforms?

    How to write subroutine code in smartforms?

    Hi,
    Smarforms
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    SmartForms : some links
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://help.sap.com/saphelp_46c/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/htm/english.htm
    http://www.sap-img.com/smartforms/smart-001.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sap-img.com/smartforms/smart-002.htm
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/SMARTFORMS_tutorial.html
    http://www.allsaplinks.com/smartform_example.html
    http://www.sap-basis-abap.com/sapsf001.htm
    Smart Form PDF Link
    http://help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://sap.ionelburlacu.ro/sap0/sapsf001.htm
    http://help.sap.com/saphelp_erp2004/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/a5/de6838abce021ae10000009b38f842/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/16/a369b1800e4bdda978ee0fe3b7bd2c/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/a5/de6838abce021ae10000009b38f842/content.htm
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-img.com/smartforms/smart-001.htm
    Re: How to Debug a Smartform
    Debug of smartform and sapscript.
    Debugging SmartForms
    Debugging of a subroutine pool.
    http://help.sap.com/saphelp_erp2004/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    Kindly Award Points If You Find The Reply Helpful.
    Cheers,
    Chaitanya.

  • Subroutines in smartforms

    Hi,
    I want to use a subroutine in smartform.I gave the perform statement in the program lines and form statement in form routines in global definitions.
    Now I want to use another perform statement inside this form statement.Can I use a perform inside a form statement?If so,where can I give the form statement for this perform statement?
    Regards,
    Hema

    Hi Hema,
        Have a look
    https://forums.sdn.sap.com/click.jspa?searchID=11559162&messageID=4406782
    https://forums.sdn.sap.com/click.jspa?searchID=11559258&messageID=450138
    Regards
    Kiran Sure

  • Subroutine in smartform

    how i can use a comman subroutine for different place.
    i want to make a common subroutine for these two coding.
    1----
    data: v_date(2) type c,
          v_month(4) type c,
          v_year(4) type c.
    select single eindt from eket
    into w_eindt
    where ebeln = is_ekko-ebeln.
    v_year = w_eindt+0(4).
    v_month = w_eindt+4(2).
    v_date = w_eindt+6(2).
    case v_month.
      WHEN '01'.
        v_month = 'JAN'.
      WHEN '02'.
        v_month = 'FEB'.
      WHEN '03'.
        v_month = 'MAR'.
      WHEN '04'.
        v_month = 'APR'.
      WHEN '05'.
        v_month = 'MAY'.
      WHEN '06'.
        v_month = 'JUN'.
      WHEN '07'.
        v_month = 'JUL'.
      WHEN '08'.
        v_month = 'AUG'.
      WHEN '09'.
        v_month = 'SEP'.
      WHEN '10'.
        v_month = 'OCT'.
      WHEN '11'.
        v_month = 'NOV'.
      WHEN '12'.
        v_month = 'DEC'.
      WHEN OTHERS.
    ENDCASE.
    concatenate v_date v_month v_year into w_eindt1 SEPARATED BY '-' .
    condense w_eindt1.
    clear : v_year,
            v_month,
            v_date.
    2----
    data: v_date1(2) type c,
          v_month1(4) type c,
          v_year1(4) type c.
    v_year1 = is_ekko-bedat+0(4).
    v_month1 = is_ekko-bedat+4(2).
    v_date1 = is_ekko-bedat+6(2).
    case v_month1.
      WHEN '01'.
        v_month1 = 'JAN'.
      WHEN '02'.
        v_month1 = 'FEB'.
      WHEN '03'.
        v_month1 = 'MAR'.
      WHEN '04'.
        v_month1 = 'APR'.
      WHEN '05'.
        v_month1 = 'MAY'.
      WHEN '06'.
        v_month1 = 'JUN'.
      WHEN '07'.
        v_month1 = 'JUL'.
      WHEN '08'.
        v_month1 = 'AUG'.
      WHEN '09'.
        v_month1 = 'SEP'.
      WHEN '10'.
        v_month1 = 'OCT'.
      WHEN '11'.
        v_month1 = 'NOV'.
      WHEN '12'.
        v_month1 = 'DEC'.
      WHEN OTHERS.
    ENDCASE.
    concatenate v_date1 v_month1 v_year1 into w_bedat SEPARATED BY '-' .
    condense w_bedat.
    clear : v_year1,
            v_month1,
            v_date1.
    for 1st coding
    I/P is like  22.10.2207
    O/P is coming   22-AUG-2007
    same for 2nd.
    I/P is like   12.07.2005
    O/P is coming 12-JUL-2005
    i want a subroutine for these.

    Create the Below Function Module and Call it in your Program Line  to convert the date Format.
    FUNCTION Z_DATE_CONVERT_GLOBAL.
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(IDATE) TYPE  SY-DATUM
    *"  EXPORTING
    *"     REFERENCE(DAY) TYPE  C
    *"     REFERENCE(MONTH) TYPE  C
    *"     REFERENCE(YEAR) TYPE  C
    *"     REFERENCE(STEXT) TYPE  T247-KTX
    *"     REFERENCE(LTEXT) TYPE  T247-LTX
    *"     REFERENCE(USERDATE) TYPE  C
    *"     REFERENCE(OUT_DATE) TYPE  C
    *"  EXCEPTIONS
    *"      INPUT_DATE_IS_INITIAL
    *"      TEXT_FOR_MONTH_NOT_MAINTAINED
    * Date Formats For User Profiles
    *    1     DD.MM.YYYY
    *    2     MM/DD/YYYY
    *    3     MM-DD-YYYY
    *    4     YYYY.MM.DD
    *    5     YYYY/MM/DD
    *    6     YYYY-MM-DD
      TABLES : USR01, T247.
      DATA: USRTYPE LIKE USR01-DATFM.
      DATA: SEPARATOR(1) TYPE C.
    IF IDATE IS INITIAL.
      RAISE INPUT_DATE_IS_INITIAL.
    ENDIF.
    * GET THE DATE COMPONENTS
      DAY = IDATE+6(2).
      MONTH = IDATE+4(2).
      YEAR = IDATE+0(4).
    * READ THE TEXT FOR THE MONTH
      SELECT SINGLE * FROM T247 WHERE SPRAS EQ SY-LANGU
                                 AND MNR EQ MONTH.
      IF SY-SUBRC EQ 0.
        MOVE T247-KTX TO STEXT.
        MOVE T247-LTX TO LTEXT.
      ELSE.
        RAISE TEXT_FOR_MONTH_NOT_MAINTAINED.
      ENDIF.
    * FOR CONVERTING TO THE DATE FORMAT OF THE USER PROFILE.
      SELECT SINGLE DATFM FROM USR01 INTO USRTYPE
                         WHERE BNAME EQ SY-UNAME.
    IF SY-SUBRC EQ 0.
      CASE USRTYPE.
    *      when the user profile is****************************
    * Date Formats For User Profiles
    *    1     DD.MM.YYYY
    *    2     MM/DD/YYYY
    *    3     MM-DD-YYYY
    *    4     YYYY.MM.DD
    *    5     YYYY/MM/DD
    *    6     YYYY-MM-DD
        WHEN '1'.
          SEPARATOR = '.'.
          CONCATENATE DAY MONTH YEAR INTO USERDATE SEPARATED BY SEPARATOR.
          CONCATENATE DAY  LTEXT YEAR INTO OUT_DATE SEPARATED BY SPACE.
        WHEN '2'.
          SEPARATOR = '/'.
          CONCATENATE  MONTH DAY YEAR INTO USERDATE SEPARATED BY SEPARATOR.
          CONCATENATE DAY  LTEXT YEAR INTO OUT_DATE SEPARATED BY SPACE.
        WHEN '3'.
          SEPARATOR = '-'.
          CONCATENATE  MONTH DAY YEAR INTO USERDATE SEPARATED BY SEPARATOR.
          CONCATENATE DAY  LTEXT YEAR INTO OUT_DATE SEPARATED BY SPACE.
        WHEN '4'.
          SEPARATOR = '.'.
          CONCATENATE YEAR MONTH DAY INTO USERDATE SEPARATED BY SEPARATOR.
          CONCATENATE DAY  LTEXT YEAR INTO OUT_DATE SEPARATED BY SPACE.
        WHEN '5'.
          SEPARATOR = '/'.
          CONCATENATE YEAR MONTH DAY INTO USERDATE SEPARATED BY SEPARATOR.
          CONCATENATE DAY  LTEXT YEAR INTO OUT_DATE SEPARATED BY SPACE.
    WHEN '6'.
          SEPARATOR = '-'.
          CONCATENATE YEAR MONTH DAY INTO USERDATE SEPARATED BY SEPARATOR.
          CONCATENATE DAY  LTEXT YEAR INTO OUT_DATE SEPARATED BY SPACE.
      ENDCASE.
    ELSE.
    WRITE IDATE DD/MM/YYYY TO USERDATE.
    ENDIF.
    ENDFUNCTION.

  • 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

  • HOW TO USE PERFORM STATEMENT IN SMARTFORMS

    Hi,
    Can anyone tell me how to use call subroutine in smartform?
    Thanks & Regards,
    Gauarv.

    Hi,
    Hope this helps you..
    You can use the PERFORM command to call an ABAP subroutine
    (form) from
    any program, subject to the normal ABAP runtime
    authorization
    checking. You can use such calls to subroutines for
    carrying out
    calculations, for obtaining data from the database that is
    needed at
    display or print time, for formatting data, and so on.
    PERFORM commands, like all control commands, are executed
    when a
    document is formatted for display or printing.
    Communication between a
    subroutine that you call and the document is by way of
    symbols whose
    values are set in the subroutine.
    The system does not execute the PERFORM command within
    SAPscript
    replace modules, such as TEXT_SYMBOL_REPLACE or
    TEXT_INCLUDE_REPLACE.
    The replace modules can only replace symbol values or
    resolve include
    texts, but not interpret SAPscript control commands.
    Syntax in a form window:
    /: PERFORM <form> IN PROGRAM <prog>
    /: USING &INVAR1&
    /: USING &INVAR2&
    /: CHANGING &OUTVAR1&
    /: CHANGING &OUTVAR2&
    /: ENDPERFORM
    INVAR1 and INVAR2 are variable symbols and may be of any of
    the four
    SAPscript symbol types.
    OUTVAR1 and OUTVAR2 are local text symbols and must
    therefore be
    character strings.
    The ABAP subroutine called via the command line stated
    above must be
    defined in the ABAP report prog as follows:
    FORM <form> TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    ENDFORM.
    The values of the SAPscript symbols passed with /: USING...
    are now
    stored in the internal table IN_TAB . Note that the system
    passes the
    values as character string to the subroutine, since the
    field Feld
    VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR
    80). See the
    example below on how to access the variables.
    The internal table OUT_TAB contains names and values of the
    CHANGING
    parameters in the PERFORM statement. These parameters are
    local text
    symbols, that is, character fields. See the example below
    on how to
    return the variables within the subroutine.
    From within a SAPscript form, a subroutine GET_BARCODE in
    the ABAP
    program QCJPERFO is called. Then the simple barcode
    contained there
    ('First page', 'Next page', 'Last page') is printed as
    local variable
    symbol.

  • Smartform output

    Hi all,
    I have imported standard SAP SmartForm  /smb40/sdorc_a and I am using it with standard SAP program /smb40/rvador01
    but when i try to test it i get an error Output could not be issued
    If anyone can provide me with any info on this one???
    Thanks in advance,
    Maja

    See,
    Standard smartforms are ment to be executed using some t.code. If you go to se38 and try to execute the program you wont get the output. The type of driver program is always 'S' (Subroutine pool).
    All you have to do is identify which tcode is using the driver and form.Goto Tcode NACE and check whether the configration is done properly or not. Once you are satis fied with the setting goto the tcode which uses the form Enter the nessasary data and see the output.
    Take the help of functionals for Nace configration and showing you the first out.If you are doing any changed in the form ot program you need to make sure thet the program will be called with some standard tcode and the configration is done properly.
    Thanks,
    sandeep.

  • Calling different pages in smartforms

    Dear Friends,
    I need one solution in smartforms, i need to print the different labels in my smartform. For example i have to print three labels
    and one normal layout. Three labels means having some fixed data of three rows maximum and these labels repetatively i need to print based on some conditions those conditions i am doing in driver program itself.
    For example assume first label i need to print 2 times,second 2 times and third 14 times then final layout contains header and items  section as usual.
    So here in the first page only i need to print first label then i have to call the new page to print second label then i have to call the
    new page to print third label as there are 14 labels in third page i have to print 9 labels and in the fourth page i have to print remaining  5 labels and i need to call new page to print the last section, the last section is like normal layout there mainwindow and everything is there.
    Please help me to handle this scenario.
    Any help will be highly appreciated.
    Thanks a lot in advance.

    This approach to make call from SAPscript. Its concept is similar to make call to a subroutine in another program. I would presume you understand how to use USING and CHANGING parameter. =)
    SAPscript -
    /: Perform get_date in program z_at_date
    /:    using &p_year&
    /:    changing &new_date&
    /: endperform.
    program z_at_date -
    form get_date TABLES rec_in  STRUCTURE itcsy
                                    rec_out STRUCTURE itcsy..
    DATA:
       v_year type char10.
    sap script and subroutine uses itcsy structure to transmit parameters
    first parameter is incoming while second parameter is out going
    their function is like an internal table with header line
    all data types between SAPscript and subroutine are string.
    so, you might need additional conversion.
    read incoming parameter with exact name from SAPscript
      READ TABLE rec_in WITH KEY name = 'P_YEAR'.
      IF sy-subrc EQ 0.
        v_year = rec_in-value.
      ENDIF.
    to return value, use the exact name on the second structure
        CONCATENATE v_year v_year INTO v_year.
        READ TABLE rec_out WITH KEY name = 'NEW_DATE'.
        IF sy-subrc EQ 0.
          rec_out-value = v_year.
          MODIFY rec_out TRANSPORTING value WHERE name = 'NEW_DATE'.
        ENDIF.
    endform.
    Hope this helps =)

Maybe you are looking for

  • Change the colour of a gray object to white

    Hi - I'm wanting to alter an image grey moulded piece of resin, to white. Hows the best way to do this?

  • Change of User Account in E-Recruiting

    Did E-Recruiting ever intend for the change of a User Account in R/3 for an Internal Employee who is a Recruiter, or a Manager, or an Administrator? For example, an employee's 0105-0001 user id is initially set to 'xxx'. So, in E-Recruiting this empl

  • Memory Leak Doubt

    Hi All, I have a doubt about memory leak in Java. Consider the following code. public class Class1 implements java.io.Serializable private static java.util.ArrayList known = new java.util.ArrayList(); private final String name; private final int valu

  • Can one execute a "carrier rate shop" in SAP

    I have done several searches within the documentation areas and cannot determine if one can execute a "carrier rate shop" within SAP (e.g. TP/VS, TM, LE). Am wondering if standard SAP has the ability to input a origin-destination pair (e.g. ZIP code,

  • Choppy video/audio playback after two suspend/resume cycles?

    Hello! Today I figured out, that my video and audi playback becomes choppy after two or more suspend-cycles. Can somebody confirm this? I'm running a up-to-date Archlinux on my ThinkPad t430s. Several applications are affected: mplayer (virtual termi