cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a smartform.

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Answers (4)

Answers (4)

Former Member
0 Kudos

solved

Former Member
0 Kudos

Hi,

wa_ctrlop-getotf = 'X'.

Comment above code line and try... u ill get the output..

Rgds,

Pavan

Former Member
0 Kudos

Hi,

I am filling the parameter, because I need the otf data of smartform, for further use.

wa_ctrlop-getotf = 'X'.

I plan to run the report in background, even though I am testing it now in foreground.

Thanks

Former Member
0 Kudos

Best way is debugging, See what happens and check out if you missed any thing by checking all vairables.

Other thing is try to execute the smartform itself and see whether output is coming or not. if you get error messages fix them and execute your driver program.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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