<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: COMMUNICATION_FAILURE in CALL FUNCTION STARTING NEW TASK/Background task in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/communication-failure-in-call-function-starting-new-task-background-task/m-p/7962468#M1602954</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the FM you are calling is a custom one? If yes, then use the following steps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Make the FM as RFC enabled.&lt;/P&gt;&lt;P&gt;2. Call the FM like - call function FM as background task destination 'NONE'. &lt;/P&gt;&lt;P&gt;3. Write a statement COMMIT WORK AND WAIT. This will actually invoke the FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if that doesn't work. Also show me your code segment where you are calling the FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mainak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jun 2011 19:52:08 GMT</pubDate>
    <dc:creator>former_member224404</dc:creator>
    <dc:date>2011-06-22T19:52:08Z</dc:date>
    <item>
      <title>COMMUNICATION_FAILURE in CALL FUNCTION STARTING NEW TASK/Background task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/communication-failure-in-call-function-starting-new-task-background-task/m-p/7962467#M1602953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use a FM in a Print Program (when user prints a document), using&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION STARTING NEW TASK 'TASK' DESTINATION 'NONE'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The program is triggered from VL02N tcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it's giving an exception - COMMUNICATION_FAILURE. Message is &lt;STRONG&gt;Error when opening an RFC connection&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION IN BACKGROUND TASK as Separate Unit&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;, &lt;/P&gt;&lt;P&gt;then error message pops up - &lt;STRONG&gt;Database error when recording transactional RFC&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are attaching a PDF file of the print to content server within this function module and because the "attaching" takes a while, this part needs to be detached from the print program so that we can avoid performance issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't figure out the issue. i gues this is happening because print program is already running in Update task. I also tried with RFC enabled FM. Please help me resolve/understand the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ronjan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 17:50:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/communication-failure-in-call-function-starting-new-task-background-task/m-p/7962467#M1602953</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-22T17:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: COMMUNICATION_FAILURE in CALL FUNCTION STARTING NEW TASK/Background task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/communication-failure-in-call-function-starting-new-task-background-task/m-p/7962468#M1602954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the FM you are calling is a custom one? If yes, then use the following steps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Make the FM as RFC enabled.&lt;/P&gt;&lt;P&gt;2. Call the FM like - call function FM as background task destination 'NONE'. &lt;/P&gt;&lt;P&gt;3. Write a statement COMMIT WORK AND WAIT. This will actually invoke the FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if that doesn't work. Also show me your code segment where you are calling the FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mainak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 19:52:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/communication-failure-in-call-function-starting-new-task-background-task/m-p/7962468#M1602954</guid>
      <dc:creator>former_member224404</dc:creator>
      <dc:date>2011-06-22T19:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: COMMUNICATION_FAILURE in CALL FUNCTION STARTING NEW TASK/Background task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/communication-failure-in-call-function-starting-new-task-background-task/m-p/7962469#M1602955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ronjan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMMUNICATION_FAILURE. Message is Error when opening an RFC connection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess the reason for the above is that every RFC call synchronous/Asynchronous issues a DB COMMIT and we cannot have DB COMMITs in the V1/V2 updates, please go through the link below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70ehp2/helpdata/en/23/e9aa61638e404d81575e939b5cd847/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70ehp2/helpdata/en/23/e9aa61638e404d81575e939b5cd847/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, the possible solutions i can think of are, &lt;/P&gt;&lt;P&gt;1) Call the FM in update task delayed start and try.&lt;/P&gt;&lt;P&gt;2) Or create a report program and use SUBMIT (look at the job options as well).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Mainak&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Write a statement COMMIT WORK AND WAIT. This will actually invoke the FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainak, this will lead to a Update termination, as the program is running in an update task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 05:39:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/communication-failure-in-call-function-starting-new-task-background-task/m-p/7962469#M1602955</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-23T05:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: COMMUNICATION_FAILURE in CALL FUNCTION STARTING NEW TASK/Background task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/communication-failure-in-call-function-starting-new-task-background-task/m-p/7962470#M1602956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chen, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes. You are right. I didn't read the scenario properly. Now I have following questions in mind. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Why you think he print program is running in update task. Do you make a save in VL02N which triggers the print program. I guess no. Then I believe print program is running in the current LUW. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. If I can't put a commit work then I won't be able to call the FM in background task. Can you try with JOB_OPEN , SUBMIT Report and JOB_CLOSE. In that case You need to create a report and call the FM inside of that report. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mainak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 19:29:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/communication-failure-in-call-function-starting-new-task-background-task/m-p/7962470#M1602956</guid>
      <dc:creator>former_member224404</dc:creator>
      <dc:date>2011-06-23T19:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: COMMUNICATION_FAILURE in CALL FUNCTION STARTING NEW TASK/Background task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/communication-failure-in-call-function-starting-new-task-background-task/m-p/7962471#M1602957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mainak,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Why you think he print program is running in update task. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Well, that is what the OP said &lt;STRONG&gt;i gues this is happening because print program is already running in Update task.&lt;/STRONG&gt; and i guess that is how it should be done too, if you are running the print program in the same LUW then you are holding up the entire transaction and a DWP, in most of the scenarios Correspondence is a non-critical activity and hence is handled in V2 updates. This is normally done via output types, and this can be configured to trigger "on save", "process later with a background job" etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. If I can't put a commit work then I won't be able to call the FM in background task. Can you try with JOB_OPEN , SUBMIT Report and JOB_CLOSE. In that case You need to create a report and call the FM inside of that report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right, so the OP has two options like i suggested in my original post, one of which is submitting a report with JOB options as you say.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 09:22:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/communication-failure-in-call-function-starting-new-task-background-task/m-p/7962471#M1602957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-24T09:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: COMMUNICATION_FAILURE in CALL FUNCTION STARTING NEW TASK/Background task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/communication-failure-in-call-function-starting-new-task-background-task/m-p/7962472#M1602958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Chan and Mainak.&lt;/P&gt;&lt;P&gt;From your feeds, I could go in depth, could learn a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found out that the issue was with the interface paramters. I found a table structure in the IMPORT interface (my bad).&lt;/P&gt;&lt;P&gt;It worked fine with small table content only.&lt;/P&gt;&lt;P&gt;So I passed it as TABLES parameter. It's working fine now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 09:59:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/communication-failure-in-call-function-starting-new-task-background-task/m-p/7962472#M1602958</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-24T09:59:48Z</dc:date>
    </item>
  </channel>
</rss>

