0% found this document useful (0 votes)
9 views3 pages

Smart Forms

The document outlines a driver program for generating smart forms in SAP. It includes parameters for selecting data from the VBAP table based on a sales document number and calls functions to retrieve and execute the specified smart form. Error handling is included to manage exceptions during the form generation process.

Uploaded by

me.thirumalai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

Smart Forms

The document outlines a driver program for generating smart forms in SAP. It includes parameters for selecting data from the VBAP table based on a sales document number and calls functions to retrieve and execute the specified smart form. Error handling is included to manage exceptions during the form generation process.

Uploaded by

me.thirumalai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

********************************SMARTFORMS***************************************

Driver Program:-
*&---------------------------------------------------------------------*
*& Report z_sf_driver
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT z_sf_driver.

parameters p_vbeln type vbap-vbeln.


data : GV_Formname type TDSFNAME,
LV_Formname type RS38l_FNAM.
GV_Formname = 'ZSF_DRIVER_DEMO'.
select matwa,vbeln,posnr,matnr,arktx from vbap into table @DATA(it_vbap1) where vbeln =
@p_vbeln.

call function 'SSF_FUNCTION_MODULE_NAME'


EXPORTING
formname = GV_Formname
* variant = space
* direct_call = space
IMPORTING
fm_name = LV_Formname
EXCEPTIONS
no_form =1
no_function_module = 2
others =3
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
call function LV_Formname
* 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
it_vbap = it_vbap1
* 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.

You might also like