Friday, 14 September 2012

Passing Parameter to SAP Smartforms Part II

After we created a smartforms in Part I. Now we will going to create a Z driver program for our smartforms

 1. Goto SE38 - ABAP Editor and create a Z program

2. Paste the sample code below

* Program Title      : Demo Driver Program for Smart form
* Program Description: Demo Driver Program for smart form to print the PR Number.
*                      we will call here the smartform and pass a parameter
* SAP R/3 Module     : Material Management (MM)
* SAP R/3 version    : SAP R/3 Enterprise / Basis Release : 700

*** ------------------------------------------------------------------------------- ***

DATA FM_NAME TYPE RS38L_FNAM" Name of the Function Module

*-------------- START OF SELECTION SCREEN Design----------------------------*

*-------------- END OF SELECTION SCREEN Design------------------------------*


      FORMNAME           'ZPASS_PARAMETER' " Pass the smartform Name
      FM_NAME            FM_NAME " Name of Function Module
      NO_FORM            1
      OTHERS             3.
  IF SY-SUBRC <> 0.
* ----------------------------- FORMS ------------------
*Take Note: In the exporting, the PR_Number here is the parameter we defined in smartform
*           Global settings then in the form Interface
*           and PR_No is the parameter here in driver program that will going to pass in PR_Number
      PR_NUMBER        PR_NO
      SEND_ERROR       3
      USER_CANCELED    4
      OTHERS           5.
  IF SY-SUBRC <> 0.

3. Save and Activate your program
4.Click Direct processing
5. Enter parameter
6. Execute


1 comment: