Skip to Content
0
Former Member
Feb 10, 2009 at 06:47 AM

Commit Work

168 Views

Hello Experts,

I have created a smartform object, inwhich if I press print, It should save it as pdf file and if I press preview button, it should get print preview. I execute it through VF31. If I press preview preview comes, but when I come back and press print, pdf save as window doesn't come. The reason is the previous job(preview) is not getting committed and If I go in debug and if I delay the execution, it works properly.

For that after preview I wrote 'commit work' statement which gives proper result. But I should not use commit work, as it may update some other data while executing in background and all. Can u sujjest any other solution for this. Should the process commitment be indicated in any of the printing form function module parameter.

my FM call is

CALL FUNCTION lf_fm_name

EXPORTING

ARCHIVE_INDEX = toa_dara

ARCHIVE_INDEX_TAB =

ARCHIVE_PARAMETERS = arc_params

control_parameters = l_ctrl

MAIL_APPL_OBJ =

MAIL_RECIPIENT = ls_recipient

MAIL_SENDER = ls_sender

output_options = l_device

user_settings = space

is_bil_invoice = ls_bil_invoice

IS_NAST = nast

is_repeat = repeat

w_total1 = l_total

IMPORTING

document_output_info = l_document_output_info

job_output_info = l_job_output_info

job_output_options = l_job_output_options

TABLES

t_rebate = t_rebate

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.

error handling

cf_retcode = sy-subrc.

PERFORM protocol_update.

get SmartForm protocoll and store it in the NAST protocoll

PERFORM add_smfrm_prot.

ENDIF.

Should I change any exporting parameter in this smartform call and can I get it?

Regards,

Venkat