cancel
Showing results for 
Search instead for 
Did you mean: 

Fetch data and call SF in Print Programme

Former Member
0 Kudos

Data is being fetched. But SF is not being called from the Print Programme.

I am sending the code, please help me in calling the SF from the print prog.

data: printf(14).

DATA :JOB_OUTPUT_INFO TYPE SSFCRESCL.

AT SELECTION-SCREEN.

PERFORM sub_valid_vbeln.

START-OF-SELECTION.

perform vbrk_get.

perform vbrp_get.

perform get_konv.

perform ysd_fmad_chrctcs_get.

Perform lips_get.

Perform cawn_get.

perform Chapter_get.

Perform Final_data.

END-OF-SELECTION.

perform smart_form.

form smart_form .

if sy-tcode = 'ZCPTR2'.

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZCAPTIVE_INV2_SMFORM'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

importing

fm_name = fm_name1

exceptions

no_form = 1

no_function_module = 2

others = 3.

if sy-subrc <> 0.

  • error handling

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

exit.

endif.

endif.

***For no print preview

*OUTPUT_OPTIONS-TDNOPREV = 'X'.

output_options-tdcopies = '1'.

output_options-tdnewid = 'X'.

output_options-tdimmed = 'X'.

call function fm_name1

exporting

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

output_options = output_options

  • is_bil_invoice = is_bil_invoice

  • USER_SETTINGS = 'X'

vatinv = vatinv

PRINTF = PRINTF

premcount = premcount importing

  • DOCUMENT_OUTPUT_INFO =

job_output_info = job_output_info

  • JOB_OUTPUT_OPTIONS =

tables

item_final = Item_final

head1 = head1

  • item3 = item3

  • item4 = item4

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

***

***start of change by roy on 03042004 10:15 pm

***for pdf conversion

Endform.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Put a Break point on this statement and check whether it is going or not

if sy-tcode = 'ZCPTR2'.

if it is going into it check the smartform name given below and check whether the smartform is active or not.

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZCAPTIVE_INV2_SMFORM'

Thanks,

NN.

Answers (2)

Answers (2)

Former Member
0 Kudos

Thnx buddy

Former Member
0 Kudos

Hi,

LF_FORMNAME = 'ZBCS_FAX_COVER'. " Form Name

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = LF_FORMNAME

IMPORTING

FM_NAME = LF_FM_NAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

COMMIT WORK AND WAIT.

CALL FUNCTION LF_FM_NAME

EXPORTING

ARCHIVE_INDEX = TOA_DARA

ARCHIVE_PARAMETERS = ARC_PARAMS

CONTROL_PARAMETERS = LS_CONTROL_PARAM

MAIL_RECIPIENT = LS_RECIPIENT

MAIL_SENDER = LS_SENDER

OUTPUT_OPTIONS = LS_COMPOSER_PARAM

USER_SETTINGS = ' '

COVER_DATA = COVER_DATA

IT_SEND = IT_SEND

MON_NAME = MON_NAME

MON_NAME1 = MON_NAME1

MON_NAME2 = MON_NAME2

MON_NAME3 = MON_NAME3

LIFNR = LIFNR

FAX_NUM = FAX_NUM

MATNR = MATNR

MRPCON = MRPCON

MCS_NAME = MCS_NAME

FIRST = FIRST

LAST = LAST

FLAG = FLAG

TABLES

IT_SEND_TAB = IT_SEND_TAB

IT_FILTER = IT_FILTER

EXCEPTIONS

FAX_SENT = 0

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

COMMIT WORK AND WAIT.

This works for me. Just add commit work after the function module.