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

CL_BCS is a commit work required for output?

former_member195355
Participant
0 Likes
5,796

Hiya,

I'm using CL_BCS in document output.

Basically after the smartform is created I have code which sends an email and then the smartform output program finishes

i.e. my code is after the Smartform function module that creates the form.

My question is that I'm not using a commit work after using CL_BCS and it seems to be working fine - sending emails, attachments etc.

However whenever I read things on SCN they say there must be an explicit commit work when using CL_BCS?

Am I missing something as it is working fine for me?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,803

Hi Robert,

In my case, (CL_BCS for Email funcitonality) COMMIT WORK was required while the Program being run in foreground.

If it is running in background, it works fine without COMMIT WORK. It throws a dump if we use commit work for a batch program.

-Sowmya

Hi Robert,

After the LUW, there will anyway be an implicit commit work. This would trigger the mail even if you have not explicitly specified it.

11 REPLIES 11
Read only

Abhijit74
Active Contributor
0 Likes
3,803

This message was moderated.

Read only

Former Member
0 Likes
3,803

It is possible that your process is somewhere issuing the explicit commit work.

A runtime trace can confirm that.

Read only

Former Member
0 Likes
3,803

Hi Robert,

As mentioned by Manish, the process itself is issuing the explicit commit work.

I assume you trigger the output immediately hence the commit work occurs.

Try sending it using applications own transaction option.

Regards,

Ankur Parab

Read only

0 Likes
3,803

Hi Ankur,

Thank you for the reply.

Could you please explain why sending it 'using applications own transaction option' is a useful thing to test?

Thanks!

Read only

0 Likes
3,803

Hi Robert,

When output immediately is selected, the driver program is started in an update task.

When you trigger the output using applications own transaction, you need a separate transaction for example like VT70 in case of shipment, to trigger the output.

Regards,

Ankur Parab

Read only

Former Member
0 Likes
3,803

Hi Robert,

After the LUW, there will anyway be an implicit commit work. This would trigger the mail even if you have not explicitly specified it.

Read only

0 Likes
3,803

Implicit commit is not enough. Documentation says explicit commit is required because of persistence layer. Perhaps this is why all the BCS_EXAMPLE_* reports have commit work statement.

Read only

former_member195355
Participant
0 Likes
3,803

Hello everyone,

Thank you for your helpful replies.

The smartform output program, with the email at the end of it is working so perhaps there is an explicit commit somewhere...

Manish,

could you just let me know how I could do a trace on an output program?

Would I go into RSNAST00, start ST05/SE30 and then run the output?

I think I'll have a lot of code to search through...

Would there be a line that said COMMIT WORK or would I be looking for something else?

Thanks!

Read only

0 Likes
3,803

I wrote commit work statement in an empty program and ran it through SAT transaction.

In Trace results, commit work statement can be seen in Hit list.

Since your trace would have lot of data, hit list can be filtered to show data related to Data Accesses Internal.

As a test, you can compare trace of a BCS_EXAMPLE_* and its copy without commit work to see the difference.

/.

Read only

Former Member
0 Likes
3,804

Hi Robert,

In my case, (CL_BCS for Email funcitonality) COMMIT WORK was required while the Program being run in foreground.

If it is running in background, it works fine without COMMIT WORK. It throws a dump if we use commit work for a batch program.

-Sowmya

Read only

0 Likes
3,803

Hi Sowmya,

Thanks for the reply and that sounds like he scenario we're having - If I explicitly state the commit work it dumps. Otherwise whenever I process the smartform output it works fine without the commit work.

So I think it is safe to leave it out - unless anyone disagrees.