on 03-20-2009 2:20 AM
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.
&----
*& 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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shankar,
https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/printing+invoices
Regards,
Sravanthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.....
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.