Starting new task task .. performing subroutine .... error
HI.
i used a Perform to call a Function module.
Perform <form name which contains the Function module>.
I am calling the FM as -
Form
data: done type c value 'X',
functioncall1(1).
call function <FM name>
starting new task <Taskname>
destination in group default
performing <subroutine> on end of task
Exporting
wait until functioncall1 = done.
Endform
Later -
Form <subroutine> using taskname.
receive results from Function "FM name'
importing
functioncall1 = done.
endform.
i do not get the importing data.. the passing Importing parameter are not recognized in the subroutine form..
can any one check and inform me the problem.
thanks in advance.
Regards,
AJ.
Hi,
You need to define the internal table globally.
Regards,
Nandha
Similar Messages
-
Just installed Firefox 3.6. Firefox will not start and Firefox safemode does not start either. Using Task manager I do not see if started either. If I create a new profile and start from that window, Firefox starts up. I see no error windows/messages. I do have it listed in my Firewall as an exception program with Permit All. What is happening?
== This happened ==
Every time Firefox opened
== After removing Firefox and Reinstalling it. ==
== User Agent ==
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6.4; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; MS-RTC LM 8)If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)
See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
See also [[Basic Troubleshooting|#Make_a_new_profile|Basic Troubleshooting: Make a new profile]] -
Hello,
I created a test report for parallel processing and this works perfectly fine but when I try to build this into a class I somehow cannot create the receiving form inside the method of the class...
method test.
CALL FUNCTION 'ZZCR_PARALLEL' STARTING NEW TASK lv_index DESTINATION IN GROUP DEFAULT
PERFORMING transfo_result ON END OF TASK
EXPORTING
input_xstring = lx_clause_text.
endmethod.
I tried to place the form before the endmethod but this doesn't work and afterwards is also not an option.
Is ABP OO not supporting parallel processing?
Thanks and regards,
ChristophHello Christo ,
I am also trying to use the same in OO context . Just in he early stages of collecting information.If you could just tell what you found out in the document it could be opf immense help.
Comradely,
K.Sibi -
When i start new task from adf 12.1.3, i receive error.
Hi,
When i start new task from adf 12.1.3, i receive error.
".... Caused by: java.lang.IllegalStateException: Invalid SCAEntityId "-1". ..."
How to fix it?
Thanks.When call create instance, receive error
String task = ims.createProcessInstance(ibpmContext, pms.getCompositeDN()+"/"+pms.getProcessName());
------error------------------------
BPM-70204
Exception
exception.70204.type: error
exception.70204.severity: 2
exception.70204.name: Error creating process instance.
exception.70204.description: Error creating instance for target process default/HelloWorldProject!1.0*soa_39bf35b3-5d40-4af1-b3cc-54e170a8be1f/HelloWorldProcess.
exception.70204.fix: Verify server log to find the problem cause.
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:258)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:474)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:285)
at oracle.bpm.services.instancemanagement.ejb.InstanceManagementServiceBean_sqa2w0_IInstanceManagementServiceRemoteImpl_12130_WLStub.createProcessInstance(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:84)
at com.sun.proxy.$Proxy520.createProcessInstance(Unknown Source)
at view.beans.BPMTaskManagement.initiateBpmTask(BPMTaskManagement.java:75)
at view.beans.AssignedTasksHelper.startNewProcess(AssignedTasksHelper.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.el.parser.AstValue.invoke(AstValue.java:254)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:302)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcast(UIXComponentBase.java:1113)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:179)
at org.apache.myfaces.trinidad.component.UIXComponent.broadcastInContext(UIXComponent.java:364)
at oracle.adf.view.rich.event.ProxyEvent.broadcastWrappedEvent(ProxyEvent.java:72)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:124)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:1074)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:402)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:225)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:192)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:105)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:502)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:502)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:327)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:229)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:202)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:137)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:120)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:217)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:81)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:220)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3436)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
Caused by: java.lang.IllegalStateException: Invalid SCAEntityId "-1".
at oracle.bpm.bpmn.engine.ejb.impl.BPMNInstanceManagerBean.createComponentInstance(BPMNInstanceManagerBean.java:242)
at oracle.bpm.bpmn.engine.ejb.impl.BPMNInstanceManagerBean_j9rppc_IBPMNCubeInstanceManagerLocalBeanImpl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:33)
at oracle.bpm.bpmn.engine.ejb.impl.BPMNInstanceManagerBean_j9rppc_IBPMNCubeInstanceManagerLocalBeanImpl.createComponentInstance(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
at com.sun.proxy.$Proxy333.createComponentInstance(Unknown Source)
at oracle.bpm.services.instancemanagement.impl.InstanceManagementService.createProcessInstance(InstanceManagementService.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at oracle.bpel.services.workflow.common.WorkflowServiceCacheEventAdvice.invoke(WorkflowServiceCacheEventAdvice.java:114)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy343.createProcessInstance(Unknown Source)
at oracle.bpm.services.instancemanagement.ejb.InstanceManagementServiceBean.createProcessInstance(InstanceManagementServiceBean.java:103)
at oracle.bpm.services.instancemanagement.ejb.InstanceManagementServiceBean_sqa2w0_IInstanceManagementServiceRemoteImpl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:34)
at oracle.bpm.services.instancemanagement.ejb.InstanceManagementServiceBean_sqa2w0_IInstanceManagementServiceRemoteImpl.createProcessInstance(Unknown Source)
at oracle.bpm.services.instancemanagement.ejb.InstanceManagementServiceBean_sqa2w0_IInstanceManagementServiceRemoteImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:226) -
Call Function'BAPI_USER_CHANGE' starting new task 'TEST'
Hi All,
I have problem with starting new task statement, I am using one FM after that am using starting new task 'TEST'
statement but its not working in one system its working fine in other systems, Please help me who this works.
Thanks in Advance.
Eg: Call Function'BAPI_USER_CHANGE' starting new task 'TEST'
RegarThanks Lqueiroz ,
Now again i am getting a DUMP by saying ,
"An error occurred when executing a REMOTE FUNCTION CALL.
It was logged under the name "At least one entry could not be "
on the called page."
so what can be the reason for this
call function 'ZRFC_PER_DIEM' starting new task lc_taskid performing subr on end of task
exporting
h_guid = it_header_guid_n
request_obj = lt_requested_objects_n.
wait up to '1' seconds.
read table gt_scl into ls_scl index 1.
p_transaction_per_diem = ls_scl-value.
read table gt_scl into ls_scl index 2.
transaction_currency_code = ls_scl-value.
form subr using task_id type clike.
data: p_transaction_per_diem type char13,
transaction_currency_code type char3.
receive results from function 'ZRFC_PER_DIEM'
tables
value = gt_scl.
So basically i am getting dumo when receive statenment is running , by giving above dump.
Regards
PG -
ABAP Dump when calling Function Module Starting New Task
Hi all. I have a tricky situation now, I am doing a POC on parallel processing.
I am getting an ABAP dump on the following Call Function line which is in class lcl_steer_114numc (See below for full program):
METHOD start.
CALL FUNCTION 'Z_ZZCLS_STEER_114NUMC'
STARTING NEW TASK me->id
CALLING me->finish ON END OF TASK.
ENDMETHOD. "start
However I get the following ABAP dump:
Short text
Statement "CALL FUNCTION .. DESTINATION/STARTING NEW TASK/IN BACKGROUND TASK"
The function module only contains a wait statement to simulate parallel processing. It is strange that it dumps here, because when I change the FM call to another call that has been triggered successfully from other classes, it still produces the same ABAP dump.
The background of the Proof Of Concept is to see if I can get an event to trigger the next process that depends on the outcome of the previous process. Parallel processes are run in the start methods by calling RFC.
<Garbled code removed>
Moderator Message: Please post relevant portions of the code only.
Edited by: Suhas Saha on Jul 17, 2011 1:17 PMWell, the thing is I did manage to run 3 other Function Modules asynchronously succeesfully prior to that function call, with the same exact function call syntax. Further more, I have tried editing it with your suggestion but I get the exact same dump.
The complete function group can be downloaded here (slinkee file):
https://docs.google.com/leaf?id=0B3sua1Bw4XK4ZmFhNzcwMTgtYzQ0Mi00NzQ4LTg5YTMtNDNlNWUxYTM2NTg3&hl=en_US
The complete program can be downloaded here (slinkee file):
https://docs.google.com/leaf?id=0B3sua1Bw4XK4YWJmNjU3ODYtODRmMy00Nzg2LThkNTUtZjNkNDRhZGQ3MTUw&hl=en_US
The complete ST22 dump can be found here:
https://docs.google.com/leaf?id=0B3sua1Bw4XK4ZDU1YmFkZDAtOTU5MS00ZTgwLWFlZTktNWZhMDUxMzJlZWNl&hl=en_US
Basically I ST22 gives me the following:
Runtime Errors RPERF_ILLEGAL_STATEMENT
Date and Time 17.07.2011 05:29:54
|Short text |
| Statement "CALL FUNCTION .. DESTINATION/STARTING NEW TASK/IN BACKGROUND TASK" |
|What happened? |
| Error in the ABAP Application Program |
| |
| The current ABAP program "Z_ZZB1_CLOSE_PERIOD_TEST2" had to be terminated |
| because it has |
| come across a statement that unfortunately cannot be executed. |
And it explains it here (but is not helpful / relevant at all) as I ran the program from SE38.
|Error analysis |
| There is probably an error in the program |
| "Z_ZZB1_CLOSE_PERIOD_TEST2". |
| The program was probably called in a conversion exit |
| or in a field exit. These are implemented by |
| function modules called CONVERSION_EXIT_xxxxx_INPUT/OUTPUT or |
| USER_EXIT_xxxxx_INPUT. |
| Conversion exits are triggered during screen field transports or |
| WRITE statements, field exits during field transports from the |
| screen to the ABAP/4 program. |
| In this connection, the following ABAP/4 statements are not allowed: |
| |
I hope you try to download the slinkee files and you will notice the call function I performed was no different than the other call function RFC calls that really are working. -
Question on parallel processing using the STARTING NEW TASK keyword
I have the following code in a program on my development system:
call function 'FUNCTION_NAME'
starting new task ld_taskname
performing collect_output on end of task
exporting
pd_param1 = ld_param1
tables
pt_packet = lt_packet.
You'll notice in the code above I left out the following part of the function call:
DESTINATION IN GROUP group
In my one-server development system the topmost code executes fine, but I'm getting a 'REMOTE FUNCTION CALL ERROR' when I execute this in a multi-server Q&A system.
My question: Is the missing 'DESTINATION' keyword required in order for this technique to work in a multi-server environment or is it optional keyword? I made the assumption that since it worked in my development environment that without the 'DESTINATION' addition the system simply used the current logged on system to start the new processes.
Any input appreciated.
Thanks,
LeeHi Lee,
Just take F1 help on CALL FUNCTION key word and go to the variant
CALL FUNCTION func STARTING NEW TASK task
[DESTINATION {dest|{IN GROUP {group|DEFAULT}}}]
parameter_list
[{PERFORMING subr}|{CALLING meth} ON END OF TASK].
This gives you very clear information about this Key word.
No one would give you better information better than this, i hope
Cheers
Ram -
can ny 1 give me a simple example as to WHY call function STARTING NEW TASK is used ???
i need a very very simple example to demonstrate the concepthi there...
Syntax
CALL FUNCTION func STARTING NEW TASK task
DESTINATION {dest
parameter list
{PERFORMING subr}.
Additions:
1. ...DESTINATION IN GROUP { group |DEFAULT}
2. ...{PERFORMING subr}|{CALLING meth} ON END OF TASK
Effect
Asynchronous call of a remote-capable function module specified in func using the RFC interface. You can use the addition DESTINATION to specify a single destination in dest, or to specify a group of application servers by using IN GROUP. The latter supports parallel processing of multiple function modules. The calling program is continued using the statement CALL FUNCTION, as soon as the remotely called function has been started in the target system, without having to wait for its processing to be finished. You can use PERFORMING and CALLINGto specify callback routines for copying results when the remotely called function is finished. Character-type data objects are expected for func and dest.
If the destination has not been specified, the destination NONE is used implicitly. When the destination NONE is used, a new main session is opened for the current user session. The asynchronous RFC does not support communication with external systems or programs written in other programming languages.
A character-type data object must be specified for task, one which contains for the remotely called function module a freely definable task ID that has a maximum eight digits. This task ID must be unique for each call, and is handed to the callback routines for identifying the function. Each task ID defines a separate RFC connection with its own context, meaning that, in the case of repeated function module calls of the same task ID, the global data of the relevant function group can be accessed, if the connection still exists.
In dialog processing, note that the maximum number of six main sessions cannot be exceeded, else an error message is displayed.
Addition 1
... DESTINATION IN GROUP {group|DEFAULT}
Effect
Specifying IN GROUP as a destination allows you to execute multiple function modules in parallel on a predefined group of application servers in the current SAP system.
For group, you must specify a data object of the type RZLLI_APCL from the ABAP Dictionary, one that is either initial, or one that includes the name of an RFC server group created in transaction RZ12. When specifying DEFAULT, or if group is initial, all application servers that are currently available in the current SAP system are used as a group. Only one RFC server group may be used within a program. During the first asynchronous RFC using the addition IN GROUP, the specified RFC server group is initialized. For each asynchronous RFC where the group is specified, the most suitable application server is determined automatically, and the called function module is executed on this.
If the function module cannot be executed on any application server, due to not enough resources being currently available, this leads to the predefined exception RESOURCE_FAILURE, to which a return value can be assigned, in addition to the remaining RFC exceptions. For this exception, the addition MESSAGE is not permitted.
· The parallel processing of function modules using the addition IN GROUP makes optimum use of the resources available, and is preferred to self-programmed parallel processing with destinations that are specified explicitly.
· An application server that is used as part of an RFC server group for parallel processing must have at least three dialog work processes, of which one is currently free. Other resources such as requests in the queue, number of system logons and so on, are also taken into account, and are not allowed to exceed certain limit values.
· To ensure that only those application servers that have enough resources are accessed, we recommend that you work with explicitly defined RFC server groups instead of working with the addition DEFAULT.
· The function modules of the function group SPBT provide service functions for parallel processing, for example, initialization of RFC server groups, determining the used destination, or temporarily removing an application server from an RFC server group.
Addition 2
... {PERFORMING subr}|{CALLING meth} ON END OF TASK
Effect
You can use this addition to specify either a subprogram subr or, as of Release 6.20, a method meth as a callback routine, which is executed after the asynchronously called function module has finished. For subr, you have to directly specify a subprogram of the same program. For meth, you can enter the same details as for the general method call.
The specified subprogram subr can have exactly one SING parameter of type clike only. The method meth must be public, and can have only one non-optional input parameter p_task of type clike. When the RFC interface is called, this parameter is supplied with the task ID of the remotely called function that was specified in the call in task. The results of the remote function can be received in the subprogram subr or method meth using the statement RECEIVE. In the callback routine, no statements can be executed that cause the program run to terminate or end an SAP LUW. Statements for list output are not executed.
Prerequisite for executing a callback routine is that, after the remote function has ended, the calling program is still internally available. It is then executed the next time the work process is changed. If the program has ended, or if it is part of a call sequence in the stack, then the callback routine is not executed. The statement WAIT can be used to stop the program execution until certain or all callback routines have been executed.
CALL FUNCTION - STARTING NEW TASK parameter_list
Syntax
[EXCEPTIONS exc1 = n1 exc2 = n2 ...
Effect
These additions are used to assign actual parameters to the formal parameters of the function module, and return values to exceptions that are not class-based. These additions have the same meaning as for the synchronous RFC. The only exception is that no values can be copied with IMPORTING and CHANGING.
do reward if helpful -
COMMUNICATION_FAILURE in CALL FUNCTION STARTING NEW TASK/Background task
Hi friends,
I am trying to use a FM in a Print Program (when user prints a document), using
CALL FUNCTION STARTING NEW TASK 'TASK' DESTINATION 'NONE'.
The program is triggered from VL02N tcode.
But it's giving an exception - COMMUNICATION_FAILURE. Message is Error when opening an RFC connection
I also tried
CALL FUNCTION IN BACKGROUND TASK as Separate Unit
then error message pops up - Database error when recording transactional RFC
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.
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.
Appreciate your help.
Regards,
Ronjan.Hi Ronjan,
COMMUNICATION_FAILURE. Message is Error when opening an RFC connection
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.
http://help.sap.com/saphelp_nw70ehp2/helpdata/en/23/e9aa61638e404d81575e939b5cd847/frameset.htm
Now, the possible solutions i can think of are,
1) Call the FM in update task delayed start and try.
2) Or create a report program and use SUBMIT (look at the job options as well).
@Mainak
3. Write a statement COMMIT WORK AND WAIT. This will actually invoke the FM
Mainak, this will lead to a Update termination, as the program is running in an update task.
Regards,
Chen -
CALL FUNCTION func STARTING NEW TASK task
hi,
i developed rfc to extract data and send to xi
as my interface is Async
as per soem documents it was mentioned the syntax
CALL FUNCTION func STARTING NEW TASK task
wat is the task ? in the syntax
and how do i use it
jeffHi suresh,
this is the code of RFC. if i execute without RFCDESTINATION it executes successfully. when i use RFC DESTINATION it shows error
call to messaging system failed: com.sap.aii.af.ra.ms.api.DeliveryException
i created RFC destination using TCP/IP and registered program. same parameters i am mentioning in XI.
FUNCTION z_bank_reconciliation.
""Local interface:
*" IMPORTING
*" VALUE(COMP_CODE) TYPE BUKRS
*" VALUE(HOUSE_BANK) TYPE HBKID
*" VALUE(ACCOUNT_ID) TYPE HKTID
*" TABLES
*" CHQDETAILS STRUCTURE ZPAYR
DATA: itab LIKE payr OCCURS 0 WITH HEADER LINE.
DATA: jtab LIKE payr OCCURS 0 WITH HEADER LINE.
DATA: it_bank LIKE zbankrecon OCCURS 0 WITH HEADER LINE.
DATA: it_bank1 LIKE zpayr OCCURS 0 WITH HEADER LINE.
TYPES : BEGIN OF ty_bseg ,
bukrs LIKE bseg-bukrs,
hbkid LIKE bseg-hbkid,
belnr LIKE bseg-belnr,
zlsch LIKE bseg-zlsch,
kostl LIKE bseg-kostl,
hkont LIKE bseg-hkont,
bzdat LIKE bseg-bzdat,
END OF ty_bseg.
TYPES : BEGIN OF ty_t012 ,
bukrs LIKE t012-bukrs,
bankl LIKE t012-bankl,
bankn LIKE t012k-bankn,
END OF ty_t012.
TABLES : payr, t012, t012k, bseg.
DATA : itpayr LIKE zpayr OCCURS 0 WITH HEADER LINE,
itt012 TYPE STANDARD TABLE OF ty_t012,
itbseg TYPE STANDARD TABLE OF ty_bseg,
wa_itt012 TYPE ty_t012,
wa_itbseg TYPE ty_bseg,
total TYPE n.
SELECT * FROM zbankrecon INTO TABLE it_bank
FOR ALL ENTRIES IN itab
WHERE chequeno EQ itab-chect.
SELECT abukrs abankl b~bankn
INTO CORRESPONDING FIELDS OF TABLE
itt012 FROM t012 AS a
INNER JOIN t012k AS b ON bbukrs = abukrs AND b~hbkid =
house_bank AND b~hktid = account_id
WHERE abukrs = comp_code AND ahbkid = house_bank.
DELETE ADJACENT DUPLICATES FROM itt012.
SELECT zbukr hbkid hktid vblnr gjahr zaldt checf chect znme1 rwbtr
waers zaldt zbnkl FROM payr INTO CORRESPONDING FIELDS OF TABLE itpayr
WHERE ( zbukr = comp_code AND hbkid = house_bank ) AND hktid =
account_id.
SELECT bukrs hbkid belnr zlsch kostl hkont bzdat FROM bseg INTO TABLE
itbseg
WHERE bukrs = comp_code AND hbkid = house_bank.
SORT itt012 BY bankl.
SORT itbseg BY belnr.
READ TABLE itt012 INTO wa_itt012 INDEX 1.
LOOP AT itpayr.
read table itbseg into wa_itbseg with key bukrs = itpayr-zbukr
hbkid = itpayr-hbkid.
if sy-subrc = 0.
itpayr-kostl = wa_itbseg-kostl.
itpayr-hkont = wa_itbseg-hkont.
itpayr-bldat = wa_itbseg-bzdat.
itpayr-zlsch = wa_itbseg-zlsch.
endif.
itpayr-zbnkl = wa_itt012-bankl.
itpayr-zbnkn = wa_itt012-bankn.
MODIFY itpayr.
APPEND itpayr TO chqdetails.
ENDLOOP.
LOOP AT chqdetails.
READ TABLE it_bank WITH KEY chequeno = chqdetails-chect.
IF sy-subrc NE 0.
MOVE chqdetails TO it_bank1.
APPEND it_bank1.
CLEAR it_bank1.
ENDIF.
ENDLOOP.
REFRESH chqdetails.
chqdetails[] = it_bank1[].
LOOP AT it_bank1.
MOVE : it_bank1-chect TO zbankrecon-chequeno,
sy-datum TO zbankrecon-check_date,
sy-uzeit TO zbankrecon-check_time.
INSERT zbankrecon.
CLEAR zbankrecon.
ENDLOOP.
ENDFUNCTION. -
CALL FUNCTION WITH STARTING NEW TASK
Hi All,
i'm call a function module through
CALL FUNCTION 'Y_WIN' DESTINATION 'rfc_destination' then it's give right result but when i want to call with starting new task then
CALL FUNCTION 'Y_WIN' STARTING NEW TASK 'INFO' DESTINATION 'rfc_destination'
it does nt provide me any data. i have check in debugger call fm is wkging fine so pls clear me why i'm nt geeting result.
pls give ur suggestions,
AnujDid you use the PERFORMING <form> ON END OF TASK to get the results back; like in the following sample
CALL FUNCTION 'SAPWL_STATREC_READ_FILE'
STARTING NEW TASK taskname
DESTINATION list-name
PERFORMING read_outtab ON END OF TASK
EXPORTING
read_start_date = s_date
read_start_time = '000000'
read_end_date = s_date
read_end_time = '235959'
EXCEPTIONS " failure when calling RFC
communication_failure = 1 MESSAGE msg_text
system_failure = 2 MESSAGE msg_text
RESOURCE_FAILURE = 3.
and
FORM read_outtab USING taskname.
* Receive results back
RECEIVE RESULTS FROM FUNCTION 'SAPWL_STATREC_READ_FILE'
TABLES
v2_normal_records = outtab
EXCEPTIONS " from the called FM
nodata = 1.
Regards -
Use of CALL FUNCTION - STARTING NEW TASK parameter_list.
SELECT strt_code
city_code
commu_code
regiogroup
INTO TABLE gt_adrstreet1
FROM adrstreet
FOR ALL ENTRIES IN gt_street_district
WHERE strt_code EQ gt_street_district-strt_code.
To optimize the performance of teh above query I am planning to use call function CALL FUNCTION - STARTING NEW TASK .....
by spliting the above internal table gt_street_district into two internal tables and use the value of each internal table into two different queries and these queries will be put in call function - start new task ....so that these queries are run in different workprocess and thus improve the performance of the program.
Can you please let me know if this would be a good option and also how to implement the same.
Thanks.....>To optimize the performance of teh above query I am planning to use call function CALL FUNCTION - STARTING NEW TASK .....
nonsense! You should not try parallel processing for a non-optimized SELECT statement.
Better add the first key field of the WHERE condition as said above and check
+ whether the driver table is empfty
+ and whether there are duplicated entries
... And it is also a good idea to really use the SINGLE RECORD BUFFER, therefore you must write
field-symbol: <fs> type ...
LOOP AT gt_street_district ASSIGNING <fs>
SELECT *
INTO TABLE gt_adrstreet1
FROM adrstreet
WHERE counrty =
AND strt_code = <fs>-strt_code.
ENDLOOP.
Then it will be extremely fast! -
Call function starting new task:
I am trying to create a program in which few database update are mentioned.
after database updates , I am calling a function module using starting new task
in which I want to commit database updates inside in function module.
Problem is I want to commit only database updates if function module , not of main program. For that I tried using COMMIT WORK in function module and rollback statement after calling FM. But it is not working.COMMIT statement in FM also commiting database updates of main program also that is not required.
Can anybody help me in solving this problem.
Thanks
RuchikaI think this may be caused by an implicit database commit performed by the system at the moment of calling a fm with "starting new task".
Try the following test:
- Put "rollback work" statement inside your fm which you call "starting new task" (instead of "commit") and check if the updates performed by the code executed before the call to this fm are stored in db - inspite of the rollback. If they are (as I suppose) this means that the commit effect you observe is not due to the "commit work" statement executed inside your fm but due to an implicit commit issued automatically at the time of calling the fm. If this is the case the solution could be placing the code which you now execute before "call function...starting new task" into a seperate fm called "in update task" - then the final commit or rollback statement in your main program should have the expected effect.
regards -
Behaviour of CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE'
As per ABAP help documentation, the statement CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE' should create a new main session in same user session.The behaviour is wrong as per documentation.
But current behaviour:
The statement CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE' is creating a new user session.
Any reason?Hi Prakash,
I'd agree with Suhas, that you're reading the documentation wrong. Here's your quote:
As per ABAP help documentation, the statement CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE' should create a new main session in current user session.
If you look at the help, you can see that it says:
When the destination NONE is used, a new main session is opened for the current user session.
Do you see the difference? Also, note that in this context main session basically means that we're talking about a new external session:
Each task ID defines a separate RFC connection with its own context, meaning that, in the case of repeated function module calls of the same task ID, the global data of the relevant function group can be accessed, if the connection still exists.
In dialog processing, note that the maximum number of six main sessions cannot be exceeded, else an error message is displayed.
If you're still in doubt, check out the online ABAP documentation for [CALL FUNCTION - STARTING NEW TASK|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_STARTING.htm]. So I'd say the documentation is in line with the actual behavior.
Cheers, harald -
Return Code value using 'starting new task' and 'wait until'
I'm having a minor issue with some return code values in my ABAP.
This is what part of it used to look like before I modified it:
With Code in version 1, the sy-subrc was not always zero, sometimes it would be 4.
That was fine, and my abap would do something based on the non-zero RC.
had a need to implement an RFC timeout, the only way I could see to do it was to use 'starting new task' etc as seen in Version 2.
However, with my changes, sy-subrc is always zero.
The ABAP runs fine but I know that sy-subrc should sometimes be 4, even when it returns within the allotted 60 seconds.
Maybe I've coded it incorrectly.
Can someone point me in the right direction?
#>> Start of VERSION 1
call function 'MY_FUNCTION_MODULE'
destination RFCDEST
tables
orders_list = t_orders_packet
apo_orders_list = t_apo_orders
apo_resources = t_apo_resources
exceptions
COMMUNICATION_FAILURE = 1 MESSAGE MSG_TEXT
SYSTEM_FAILURE = 2 MESSAGE MSG_TEXT
NO_ORDERS_SUPPLIED = 3
NO_PEGGED_ORDERS_FOUND = 4
ORDERID_CONVERSION_ERROR = 5
OTHERS = 6.
if sy-subrc is initial.
* do some stuff as RC was 0
else.
* log non-zero return code etc
endif.
* << End of Version 1And now Version 2.
I didn't put this into the 1st post as the formatting goes bonkers.
#>> Start of VERSION 2
call function 'MY_FUNCTION_MODULE'
destination RFCDEST
starting new task 'taskname'
performing receive_result on end of task
tables
orders_list = t_orders_packet
apo_orders_list = t_apo_orders
apo_resources = t_apo_resources
exceptions
COMMUNICATION_FAILURE = 1 MESSAGE MSG_TEXT
SYSTEM_FAILURE = 2 MESSAGE MSG_TEXT
NO_ORDERS_SUPPLIED = 3
NO_PEGGED_ORDERS_FOUND = 4
ORDERID_CONVERSION_ERROR = 5
OTHERS = 6.
WAIT UNTIL results_received = 'X' UP TO 60 SECONDS.
if sy-subrc is initial. << Now this is always ZERO
* do some stuff as RC was 0
else.
* log non-zero return code etc
endif.
FORM receive_result USING iv_taskname.
RECEIVE RESULTS FROM FUNCTION 'MY_FUNCTION_MODULE'
tables
orders_list = t_orders_packet
apo_orders_list = t_apo_orders
apo_resources = t_apo_resources
exceptions
COMMUNICATION_FAILURE = 1 MESSAGE MSG_TEXT
SYSTEM_FAILURE = 2 MESSAGE MSG_TEXT
NO_ORDERS_SUPPLIED = 3
NO_PEGGED_ORDERS_FOUND = 4
ORDERID_CONVERSION_ERROR = 5
OTHERS = 6.
results_received = 'X'.
endform. "receive_result
* < End of Version 2
Maybe you are looking for
-
Hello all, I have a question on AppleTV. I have a bunch of DVDs. I would like to rip them onto my Macmini, and use this Macmini as a dedicated media-server to house my movies. I would like to know if I can purchase THREE AppleTVs and place each in
-
Hi, Scenario is, once the event is raised, some information needs to be passed to workflow. Being a standard events raised by std. applications, we can not add parameters to these events. So wanted to know that whether we can pass data to Workflow co
-
Hi, Our data loads are going very slow and we wanted to buffer the number ranges. Our system was set to modifiable in both SCC4 and SE03. I am using SNRO to modify an object, say BID0003809. I get the following message when I try to edit despite our
-
Premier Pro CS4: working with an Adobe Photoshop file
I'm trying to work with an Adobe Photoshop file, it has many layers and I imported it as one and switched it to RGB. However, the rendering time for the file is flabbergasting: it's a 5 second opening with light effects and it takes about 30 minutes
-
can i dowload a copy protected dvd to itunes so i can watch it on my ipod, instead of having to buy the dvd on itunes aswell as in the shops?