Application Development and Automation Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Jigang_Zhang张吉刚
Active Contributor
0 Kudos
975
Need to send an email with a PDF attachment during Production order saving processing, I'm using CL_BCS for email and cl_document_bcs for attachment preparation. Because the email processing involves standard DB update processing, I didn't use commit work after the call method send_request->send.


I thought the email processing would be committed automatically when DB commits its work. But actually, it'll not happen. Instead, I get the email status with SO672 (Still no entry in the queue). It has been discussed many times like this one, hope this article will not hurt anyone facing the same issue. Some useful notes:



717265 - Sending in PERFORM-ON-COMMIT as of Release 6.10



Solution


We recommend that you do not call the send interface at the time of the PERFORM-ON-COMMIT but during the update.
If this is not possible, enclose the call of the send interface in a function module that is called with RFC. The 'NONE' destination is sufficient. A COMMIT WORK must be executed in the function module after the send interface was called.
Instead of calling its own function module with RFC, the application can also call the SO_DOCUMENT_SEND_API1 function module which is part of the send interface. In this case, you must set the COMMIT_WORK import parameter to 'X'.

1895298 - SO672 - Still no entry in queue


It's mandatory to each application explicitly call COMMIT WORK, after the sending application has been called.

Do not execute COMMIT WORK command during an update process. Additional instructions will be found under SAP Note 717265:

"If this is not possible, enclose the call of the send interface in a function module that is called with RFC. The 'NONE' destination is sufficient"

Also, there are some circumstances when a COMMIT WORK is suppressed in the coding.

COMMIT during:

  • CALL DIALOG/SUBMIT

  • Perform On Commit

  • Update task

  • End Transaction event


Check if "sy-oncom" is on one of the above states when it reaches COMMIT WORK. If yes, then include a new COMMIT WORK outside of the process. For example, if code is within a 'Call Dialog', initiate a new COMMIT WORK when it leaves the "Call Dialog".

In my case which sends an email during update processing, the key is:

Enclose the call of the send interface in a function module that is called with RFC. The 'NONE' destination is sufficient".

  1. Put BCS email logic inside one FM with RFC suppported.

  2. Tick the checkbox of pass value for input parameters cause RFC doesn't support reference ones.

  3. Call the RFC with DESTINATION 'NONE':



 

 
Labels in this area