2006 Feb 10 5:25 AM
Hi Friends,
How to find print program of a smartform if it does not have a output type.I know we can get the print pgm in table TNAPR if it has output type..
Thanks in Advance
2006 Feb 10 5:34 AM
hi
The smart form can be printed using the printing program.
the smart from generates a Fucntional module when you activate it. you have to cal the functional module in your print program to display and print.
here is the code
REPORT ZSMART_130503.
tables: vbak.
data: i_vbak like vbak occurs 0.
DATA: FM_NAME TYPE RS38L_FNAM.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
start-of-selection.
SELECT * INTO TABLE I_VBAK FROM VBAK WHERE VBELN IN S_VBELN.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME' <b>----
> TO GET THE FUNCTIONAL MODULE NAME</b>
exporting
formname = 'ZSMARTKISH'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
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
ITAB1 = I_VBAK
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.
Sorry i misunderstood the program. There is way to find the program the samrtfrom generates a FM as i said . go to the FM and <b>use Where used to find the print program</b>
REGARDS
KISHORE
REWARD IF HELPFUL
Message was edited by: Harikishore Sreenivasulu
2006 Feb 10 5:34 AM
hi
The smart form can be printed using the printing program.
the smart from generates a Fucntional module when you activate it. you have to cal the functional module in your print program to display and print.
here is the code
REPORT ZSMART_130503.
tables: vbak.
data: i_vbak like vbak occurs 0.
DATA: FM_NAME TYPE RS38L_FNAM.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
start-of-selection.
SELECT * INTO TABLE I_VBAK FROM VBAK WHERE VBELN IN S_VBELN.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME' <b>----
> TO GET THE FUNCTIONAL MODULE NAME</b>
exporting
formname = 'ZSMARTKISH'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
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
ITAB1 = I_VBAK
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.
Sorry i misunderstood the program. There is way to find the program the samrtfrom generates a FM as i said . go to the FM and <b>use Where used to find the print program</b>
REGARDS
KISHORE
REWARD IF HELPFUL
Message was edited by: Harikishore Sreenivasulu
2006 Feb 10 5:38 AM
Hi,
- In smartforms, we do not get where used-list.
- If output type is not define for that smartforms then it is very difficult to find the program related to it.
Regards,
Digesh Panchal
2006 Feb 10 5:40 AM
hi,
since you have the smartform with you, if you activate the smartform it will give you the FM, or run the smart from it will give you the FM, check where used list of that FM, and you will be able to see the print programs related to smartform.
regards
vijay
2006 Feb 10 6:09 AM
While developing a driver program for smartforms, We will not Hard-code the Fm name in driver program. So even u use wher-used list on the dynamic FM generated by SF it will not give you the result.
So , You SCAN the report programs wioth Smartform Name.Hope this will be useful to you.
2006 Feb 10 6:46 AM
Hi Jaikumar,
Have a look at FM,
SWF_FORMS_OF_PROGRAM_DISPLAY
SWF_FORMS_OF_PROGRAM_GET
Thanks
Lakshman