on 05-07-2009 9:51 AM
Hi Guys,
I am calling a smartform from a report.
But I am not getting any output.
Here is the code.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = y_formname " ZSD_ORDER_CONFIRM
IMPORTING
fm_name = y_fmname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc EQ 0.
ENDIF.
Set control parameters to get OTF output
wa_ctrlop-getotf = 'X'.
wa_ctrlop-no_dialog = 'X'.
No print preview
wa_compop-tdnoprev = 'X'.
READ TABLE it_data INDEX 1.
SELECT SINGLE * FROM vbak INTO wa_vbak.
CALL FUNCTION y_fmname
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_compop
user_settings = 'X'
iv_bukrs = wa_vbak-bukrs_vf
iv_kunnr = wa_vbak-kunnr
iv_ord_date = wa_vbak-erdat
iv_ord_time = wa_vbak-erzet
IMPORTING
job_output_info = wa_return
TABLES
it_data = it_out
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc EQ 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Do you find any thing wrong with my code.
Thanks
Hi,
Delete the tables addition in your function module calling.
CALL FUNCTION y_fmname
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_compop
user_settings = 'X'
iv_bukrs = wa_vbak-bukrs_vf
iv_kunnr = wa_vbak-kunnr
iv_ord_date = wa_vbak-erdat
iv_ord_time = wa_vbak-erzet
IMPORTING
job_output_info = wa_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc EQ 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Try like this way.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
wa_ctrlop-getotf = 'X'.
Comment above code line and try... u ill get the output..
Rgds,
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
if we make 'wa_ctrlop-getotf = 'X'', it won't print the output, instead it will generate the OTF data in an internal table.
what exactly is ur req? do u wnt to print the output or convert OTF data to some other format.
if u want to see the output u should pass getotf to control parameters..
Rgds,
Pavan
Hi,
Do you get any dump or error. What is the message u get while running the report?
These fields needs to be passed in Form Interface of the Smartform - iv_bukrs, iv_kunnr, iv_ord_date, iv_ord_time. Hope u did that.
Thanks,
Nitesh.
Edited by: Nitesh Babu on May 7, 2009 11:00 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
please check this code below,
DATA :
FM_NAME TYPE RS38L_FNAM. " Name of the Function Module
PARAMETERS: P_NO LIKE BKPF-BELNR,
FYSCAL LIKE BKPF-GJAHR.
FM_NAME = '/1BCDWB/SF00000028'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZFI_SALES_INVOICE'
IMPORTING
FM_NAME = FM_NAME
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 '/1BCDWB/SF00000028'
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
INVOICE_NO = P_NO
FISCAL_YEAR = FYSCAL
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
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.
Regards,
lakshman.annamaneni
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
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.