<div>Hi,</div>
<div> </div>
<div>Have you tried to debug the background method. you can do it as follows:</div>
<div> </div>
<div>put an infinite loop in your method</div>
<div>eg:</div>
<div> </div>
<div>data : l_flag type char1 value &#39;X&#39;.</div>
<div>do.</div>
<div>if l_flag ne &#39;X&#39;.</div>
<div>exit.</div>
<div>endif.<br>enddo.</div>
<div> </div>
<div>then goto sm50  </div>
<div>select your program </div>
<div>goto program/session--&gt;Program--&gt;debugging.</div>
<div> </div>
<div>this way you can debug your method in background. </div>
<div> </div>
<div><br> </div>
<div class="gmail_quote">On Tue, Mar 16, 2010 at 12:02 AM, Ali Husain <span dir="ltr">&lt;<a href="mailto:mr_mago40@hotmail.com">mr_mago40@hotmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div><br>Hey Guys,<br><br>Sorry if i&#39;m asking too many questions but I have a deadline in 2 days which i&#39;m trying to beat so I guess i&#39;ll turn to you for help :)<br><br>I&#39;m facing a weird problem in which i&#39;m calling a method in a background task and this method is calling a program via SUBMIT. The program calls a smartform and collect the data needed to be sent as an e-mail with the smartform as PDF attachment. <br>
The reason why it&#39;s weird is because:<br>- When i run the method directly via the business object it executes fine and sends the email with no problem<br>- If i execute the method in foreground it also works fine with no problem<br>
- If I attach the method to a previous task to be executed after the work item is executed it also works fine. However, with this option i had a problem which is for that task i have the confirm completion of the task dialog enabled. So whenever i cancel of the dialog to keep the work item in my inbox, the method gets executed again which i don&#39;t want. I want it to be executed only if the user confirms the completion of the dialog.<br>
<br>So i decided to use a background task but when it gets executed, it is stuck in process and never completes the workflow. The method is not even executed and the mail is not sent in this case. It worked with all the previous mentioned cases except when i put it as a background which tells me something wrong with the bg job maybe. Other BG jobs are working fine and i checked the SWU3 with no problem. I also tried it in a different client in the same system and same problem happens.<br>
<br>The method uses SUBMIT AND RETURN and i&#39;m not binding anything except for the whole business object (tried both dialog is not enabled for the method and also enabled and task in BG). In the program that i&#39;m calling i&#39;m using the following FMs:<br>
<span><span>&#39;SSF_FUNCTION_MODULE_NAME&#39;</span></span> <br><span>v_form_name</span> (smartform)<br><span><span>&#39;CONVERT_OTF&#39;</span><br></span><span><span>&#39;SO_NEW_DOCUMENT_ATT_SEND_API1&#39;</span><br></span><br>
Nothing wrong with the program as it executes fine on its own and also when i execute the method directly via the business object. So What is causing the background job to be stuck?<br><br>Thanks a lot for the help.<br><font color="#888888">Ali<br>
</font>
<div class="hm"><br>
<hr>
Hotmail: Trusted email with Microsoft’s powerful SPAM protection. <a href="http://clk.atdmt.com/GBL/go/210850552/direct/01/" target="_blank">Sign up now.</a></div></div><br>_______________________________________________<br>
SAP-WUG mailing list<br><a href="mailto:SAP-WUG@mit.edu">SAP-WUG@mit.edu</a><br><a href="http://mailman.mit.edu/mailman/listinfo/sap-wug" target="_blank">http://mailman.mit.edu/mailman/listinfo/sap-wug</a><br><br></blockquote>
</div><br>