Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Commit Work

Former Member
0 Likes
583

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

2 REPLIES 2
Read only

viquar_iqbal
Active Contributor
0 Likes
414

Hi

you need to check if the previous job has commited or not before printing new one

check for options like savepoint timeout value

check this link

http://www.sapdb.org/7.4/htmhelp/79/f47a4b66e3004ea5049ecca129a813/frameset.htm

Read only

Former Member
0 Likes
414

I tried with "wait up to 0 seconds" and the database fot committed without using "commit work"