Application Development 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: 

Problem function module SO_NEW_DOCUMENT_ATT_SEND_API1 with commit work

Former Member
0 Kudos

hi

I upgrade Z programs of the SAP 4.6c and 6.0

I have a function with to send mail, I used a standar function SO_NEW_DOCUMENT_ATT_SEND_API1, in 4.6c, this function does not have the "commit_work" parameter

1. I have Z function (zhr_enviar_correo), the function execute in badi of the infotype 2001.([infotype view|http://img849.imageshack.us/img849/4189/infotype.jpg]) / ([Badi debugging wiew|http://img32.imageshack.us/img32/1740/badiinfo.jpg])

2. the zhr_enviar_correo called the standar function SO_NEW_DOCUMENT_ATT_SEND_API1 ([Breakpoint in zhr_enviar_correo|http://img151.imageshack.us/img151/1629/sendapi1.jpg]) with commit_work = 'X'

3. the following breakpoint is in call standar function SO_DOCUMENT_SEND_API1 ([breakpoint in SO_NEW_DOCUMENT_ATT_SEND_API1|http://img850.imageshack.us/img850/2695/api1s.jpg])

4. I have a breakpoint in the commit work (<a target=iq4 href=http://img98.imageshack.us/img98/6333/commitw.jpg>breakpoint SO_DOCUMENT_SEND_API1</a>)

5. The debugging (F5) in "commit work"(previous step) continued(or returned) in Modul Pool (PAI) (<a target=iq5 href=http://img815.imageshack.us/img815/4562/commitwinf.jpg>breakpoint in MP20000</a>)

6. I press F8 (finish the execute), after, I review the SCOT tcode(SMTP) without "wait mail" (<a target=iq6 href=http://img857.imageshack.us/img857/9089/scotinf.jpg>SCOT tcode view</a>)

7. But, I execute with SE37 tcode, I put the mandatory parameter in my function zhr_envio_correo (<a target=iq=7 href=http://img191.imageshack.us/img191/591/se37.jpg>SE37 view</a>)

8. I follow the previous steps 2,3,4 until breakpoint commint work in SO_DOCUMENT_SEND_API (step 4), but I press F5 and commit work continued in different program, It continue in class CL_SEND_REQUEST_BCS in method ON_SAVE_REQUEST. (<a target=iq8 href=http://img215.imageshack.us/img215/6035/commitse37.jpg>Breakpoint in CL_SEND_REQUEST_BCS</a>)

9. I review the SCOT tcode and I view the "wait mail" (<a target=iq9 href=http://img839.imageshack.us/img839/5748/scotse37.jpg>SCOT view (after SE37 run)</a>)

10. I try too with sending mail use CL_SEND_REQUEST class(other zprogram), but the result is the same, the commit work continue different depends the another program(in my case modul pool) or SE37 tcode.

I hope the post and answers,

Ivan

4 REPLIES 4

former_member184578
Active Contributor
0 Kudos

Hi.,

After Function Module Call., use this.,

if sy-subrc = 0.

submit rsconn01 with mode = 'INT' . " this is to push immediately the mails manually

endif.

hope this helps u.,

Thanks & Regards,

Kiran

0 Kudos

thanks Kiran

I included your code, but result is the same.

- I run function with SE37 tcode, I view in the SCOT tcode, the mail is not in "wait", it appears in "finished" (<a target=iq1 href=http://img695.imageshack.us/img695/5861/scotsubmit.jpg>SCOT tcode</a>).

- I run function with infotype 2001, I view in the SCOT tcode no change.

thanks for your post and answer, buy my problem is not solved.

Ivan

Clemenss
Active Contributor
0 Kudos

Hi Ivan,

I remember we had something similar once.

Keep in mind that a COMMIT WORK from within a user exit or BAdI is strictly forbidden because it may lead to database inconsistency.

You can wrap the mailing functionality (preferentially CL_BCS) in a function module including COMMIT WORK and call this function module STARTING NEW TASK or DESTINATION NONE so that it runs in its own LUW.

This helped for us.

Regards,

Clemens

Former Member
0 Kudos

hi Clemens

My problem is the same with your changes, but I founded sap note

      • SO_DOCUMENT_SEND_API1 error en commit desde modulpool. (460999/2011)

MOVE sy-oncom TO oncom.

sy-oncom = 'S'.

COMMIT WORK.

MOVE oncom TO sy-oncom.

I solved with code.

thanks for your posts and answer.

Ivan