cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a driver program for a smartform

radhushankar
Participant
0 Kudos

Hi All,

I have a requirement like i need to create a smartform as well as driver program for invoice output.

I have created the smartform and made only one interface field which is accounitng document number.

Can any one give me some idea how to create a driver program and how to make it called when the output option is selected.

Can any one please share a sample code.

Thanks in advance.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

&----


*& Report ZPPR_BOM1

*&

&----


*& Created By : MTABAP

*& Requested By : MPPIBM

*& Date : 07.11.2008

*& TCode : ZPP_003

*& Description : Report To Display BOM.

&----


REPORT ZPPR_BOM1.

&----


  • TABLES

&----


TABLES : MAST. " Material to BOM Link

&----


*& Internal tables Begin with it_

&----


DATA : IT_MAST TYPE MAST OCCURS 0 WITH HEADER LINE.

DATA: fm_name TYPE rs38l_fnam.

CLEAR : IT_MAST.

REFRESH : IT_MAST.

&----


*& Parameters Begin with pr_

*& Select-options Begin with so_

&----


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: PR_MATNR LIKE MAST-MATNR OBLIGATORY,

PR_WERKS LIKE MAST-WERKS OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b1.

SELECT * FROM MAST INTO TABLE IT_MAST " Get BOM number

WHERE MATNR = PR_MATNR

AND WERKS = PR_WERKS.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZPPS_BOM1' here give ur smartform name

IMPORTING

fm_name = fm_name.

CALL FUNCTION fm_name "'/1BCDWB/SF00000079'

  • 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_MAST = it_mast here pass ur internal table and call itin ur smartform

  • 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.

please close the thread if problem resolved

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

Go through the below link

[]

Regards,

Vijaya Lakshmi.T

0 Kudos

See the below sample..

You need to adjust the program based on your Smart form import fields.

REPORT ZEXAMPLE1 .

tables mara.

DATA : V_FORM TYPE TDSFNAME."rs38l_fnam

DATA: IT_MARA TYPE TABLE OF MARA,

WA LIKE LINE OF IT_MARA.

select-options s_matnr for mara-matnr.

START-OF-SELECTION.

SELECT * FROM MARA INTO TABLE IT_MARA

where matnr in s_matnr.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZEXAMPLE2'

IMPORTING

FM_NAME = V_FORM

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 V_FORM

TABLES

itab = IT_MARA

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.

Thanks

Sudheer

radhushankar
Participant
0 Kudos

Hi All,

I have a similar format like this.. is there is any routine do i need to write in order to call the smartform once the oouput option is selected??

Thanks In advance.

radhushankar
Participant
0 Kudos

Hi All,

The above requirement what i am referring is to attach a smartform to a standard FI transaction.

In the configuration screen there are three parameters required as input parameters 1) driver program 2) routine 3) form name.

Thanks in advance.

Former Member
0 Kudos

Hello Ravi,

Please be clear with your requirement.

What exactly do you need?

As far as the driver program is concerned

Go to Wiki Code Gallery by clicking on the below link

https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/home

Just give a search with the keyword Driver Program, you would get examples

Hope that would be helpful.....

Former Member
0 Kudos

What transaction did you use to get to the configuration or did you use SPRO and if so what it the tree path. I'm trying to configure an SF to my driver program for an AP check run (F110), but can not figure out how to get to the configuration.