Home > Ask the SAP software/management Experts > SAPscript and Smart Forms Questions & Answers > How to add database retrieval logic for use in a Smart Form
Ask The SAP Expert: Questions & Answers
EMAIL THIS

How to add database retrieval logic for use in a Smart Form

Mark Smithson EXPERT RESPONSE FROM: Mark Smithson

Pose a Question
Other SAP Categories
Meet all SAP Experts
Become an Expert for this site


SAP news, tips and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 03 November 2005
How can I retrieve data in form logic from a database table, if the data from that table is not getting supplied by a print program into a Smart Form?

>
Thanks for the excellent question!

From a high-level perspective, there are two places to add database retrieval logic for use in a Smart Form:
(1) The print program
(2) The form itself

If you add this logic to the print program, there are two rules:

  • Don't modify standard SAP code (e.g. use a Z-version instead)
  • Make sure the import/export parameters between the form and print program are in sync
  • If you add this logic to the form itself, you can put it either at the top of the form under Global definitions (in 'Initialization' or 'Form routines') or in a 'Program lines' node within the body of the form itself. However, if you go with the second option, there are other rules:

  • Don't put the logic in the MAIN window
  • Don't put the logic in a secondary window which can be hit more than once during form output
  • The reason is that the form will generate an ABAP function module. All of its program logic will become part of this code. So basic ABAP programming standards should apply, including efficient database access (e.g. no SELECT statements in nested loops, no retrieval of irrelevant table columns or rows).

    To put it another way, avoid accessing the database more than necessary. Program nodes which can be hit multiple times as the form is output should only pull from pre-populated tables passed from the top of the form or from the print program -- not from the database.


    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



    RELATED CONTENT
    SAPscript and Smart Forms
    Modifying standard SAP Smart Forms for purchase orders
    How to solve output alignment problems with SAPscript printing
    Using SAP Smart Forms to change layout of Plant Maintenance
    How to fix Smart Forms printing double purchase orders
    Deriving the name of a Smart Style from a Smart Form
    Fixing a common OPEN_FORM and START_FORM error in SAPscript
    Avoid printing out blank address lines in SAP Smart Forms
    Setting soft breakpoints in ABAP that reside in Smart Forms
    Printing specifics on the last page of a Smart Form
    Unwelcome change in Smart Forms icons

    SAPscript and Smart Forms
    Modifying standard SAP Smart Forms for purchase orders
    How to solve output alignment problems with SAPscript printing
    Using SAP Smart Forms to change layout of Plant Maintenance
    How to fix Smart Forms printing double purchase orders
    Deriving the name of a Smart Style from a Smart Form
    SAP administration information for a Basis interview
    Transferring R/3 Admin skills to SAP NetWeaver
    Easier maintenance of output types, procedures, conditions, etc.
    Avoid printing out blank address lines in SAP Smart Forms
    Setting soft breakpoints in ABAP that reside in Smart Forms
    SAPscript and Smart Forms Research

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary



    Search and Browse the Expert Answer Center
    Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
    Browse our Expert Advice



    SAP White Paper Topics
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
    SearchSAP.com is a search service provided by TechTarget and is completely
    independent of and not affiliated with SAP AG.
      TechTarget - The IT Media ROI Experts