SAP ABAP Forms Interview Questions: Smart Forms and Adobe Forms


SAP ABAP INTERVIEW SERIES • PART 7

Smart Forms and Adobe Forms Interview Guide

Architecture, driver programs, dynamic function modules, PDF output, debugging, practical code and real project scenarios.

Forms questions test more than layout knowledge. Interviewers want to know whether you can connect application data to a form, control output safely, debug production failures and select the right technology. This guide covers the concepts most often discussed in SAP ABAP interviews. Availability and recommended output technology can differ by SAP release and landscape, so confirm the design against your project system.

1. End-to-end form flow

1. Driver program
Read and prepare business data.
2. Interface
Transfer structures and tables.
3. Layout
Render windows, text and tables.
4. Output
Preview, spool, print or PDF.

2. What is SAP Smart Forms?

Smart Forms is an SAP form technology used to create print and output layouts without manually maintaining SAPscript control logic. A form contains a form interface, global definitions, pages, windows and nodes such as text, table, template, loop, condition, command, graphic and program lines. Activation generates a function module.

Interview question: Why should the generated function module name not be hard-coded?

The generated name can differ between systems after transport. Resolve it at runtime with SSF_FUNCTION_MODULE_NAME, then call the returned function module.

DATA: lv_fm_name TYPE rs38l_fnam,
      ls_control TYPE ssfctrlop,
      ls_output  TYPE ssfcompop.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname = 'ZSF_INVOICE'
  IMPORTING
    fm_name  = lv_fm_name
  EXCEPTIONS
    no_form  = 1
    no_function_module = 2
    OTHERS   = 3.

IF sy-subrc = 0.
  ls_control-no_dialog = abap_true.
  ls_control-preview   = abap_true.

  CALL FUNCTION lv_fm_name
    EXPORTING
      control_parameters = ls_control
      output_options     = ls_output
      user_settings      = space
      is_header          = ls_header
    TABLES
      it_items           = lt_items.
ENDIF.

Common Smart Forms questions

  • Form interface vs global definitions: the interface receives data from the driver; global definitions hold form-wide types, data and initialization logic.
  • Main window: supports flowing content and page breaks. Secondary windows have fixed positions and do not automatically flow like the main window.
  • Table vs template: a table is suited to dynamic rows; a template is a fixed cell layout.
  • Page protection: keeps related nodes together where possible, but oversized content still requires thoughtful design.
  • Styles: Smart Styles centralize paragraph and character formats for consistent output.
  • Output control: use control parameters, output options and user settings deliberately; do not rely on an interactive print dialog in background processing.

3. Converting Smart Form output to PDF

A common pattern is to request OTF output, obtain it from the job output information and convert it with CONVERT_OTF. Check the form output and exceptions before sending or archiving the PDF.

ls_control-getotf    = abap_true.
ls_control-no_dialog = abap_true.
ls_control-preview   = abap_false.

CALL FUNCTION lv_fm_name
  EXPORTING
    control_parameters = ls_control
    user_settings      = space
  IMPORTING
    job_output_info    = ls_job_info
  TABLES
    it_items           = lt_items.

CALL FUNCTION 'CONVERT_OTF'
  EXPORTING
    format = 'PDF'
  IMPORTING
    bin_filesize = lv_pdf_size
  TABLES
    otf      = ls_job_info-otfdata
    lines    = lt_pdf_lines.

4. How do you debug a Smart Form?

  1. Verify data in the driver program before the form call.
  2. Open transaction SMARTFORMS, activate the form and inspect the generated function module.
  3. Set a breakpoint in the generated function module or relevant program lines.
  4. Check conditions, window overflow, styles, language, device type and spool parameters.
  5. Use form trace facilities such as SFTRACE where available and inspect spool/output errors.

5. What are SAP Interactive Forms by Adobe?

Adobe Forms use a form interface, context and layout designed in transaction SFP. The ABAP application opens a print job, resolves the generated form function module, calls it with application data and closes the job. Rendering depends on Adobe Document Services (ADS) in supported landscapes.

DATA: lv_fm_name TYPE rs38l_fnam,
      ls_output  TYPE sfpoutputparams,
      ls_doc     TYPE sfpdocparams.

ls_output-nodialog = abap_true.
ls_output-preview  = abap_true.

CALL FUNCTION 'FP_JOB_OPEN'
  CHANGING
    ie_outputparams = ls_output.

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
  EXPORTING
    i_name     = 'ZAF_INVOICE'
  IMPORTING
    e_funcname = lv_fm_name.

CALL FUNCTION lv_fm_name
  EXPORTING
    /1bcdwb/docparams = ls_doc
    is_header         = ls_header
    it_items          = lt_items.

CALL FUNCTION 'FP_JOB_CLOSE'.

6. Smart Forms vs Adobe Forms

AreaSmart FormsAdobe Forms
Design toolSMARTFORMSSFP / Adobe layout designer
Typical strengthClassic print outputPDF-centric, interactive or complex layouts
Runtime callSSF_FUNCTION_MODULE_NAMEFP_JOB_OPEN + FP_FUNCTION_MODULE_NAME + FP_JOB_CLOSE
Rendering dependencyABAP form runtime and spoolADS in supported setups

7. Real project scenario

Scenario: A multilingual invoice must run online and in background, support email PDF and handle thousands of items.

Strong answer: separate data retrieval from layout; select only required fields; determine language and address formatting explicitly; test large tables and page breaks; suppress dialogs in background; capture form exceptions; generate PDF through supported output APIs; log spool, recipient and application key for support. Avoid database selects inside repeated form nodes.

8. Common mistakes

  • Hard-coding a generated form function module.
  • Mixing heavy business logic and repeated SELECT statements into the layout.
  • Ignoring sy-subrc, form exceptions or returned BAPI-style messages.
  • Using preview or print dialogs in a background job.
  • Assuming fonts, graphics, device types and ADS configuration are identical across systems.
  • Skipping authorization, spool retention and personal-data controls.

9. Practice exercise

Create a driver program for an invoice header and item table. Add a dynamic item table, subtotal, page number and company logo. Then produce a no-dialog PDF path and document how you would debug: missing logo, blank PDF, truncated text and unexpected page breaks.

10. Rapid revision questions

  1. Why is SSF_FUNCTION_MODULE_NAME necessary?
  2. What is the difference between a main window and a secondary window?
  3. When would you use a table instead of a template?
  4. How is Smart Form OTF converted to PDF?
  5. What is the purpose of FP_JOB_OPEN and FP_JOB_CLOSE?
  6. What role does ADS play for Adobe Forms?
  7. How would you make a form safe for background processing?

Official SAP references

← Part 6: Enhancements, BAdIs and User ExitsPart 8: IDoc, RFC and BAPI →

Examples are educational. Validate APIs, authorizations and output behavior in your SAP release before production use.

 

Post a Comment

0 Comments