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)
Similar Messages
-
Assign account from Service Request when creating a New Task
When creating a new task from within a Service Request the SR # is defaulted we would also like to default the account associated with the SR on to the Task. How can you do this?
This is not working in WF.
Refer this thread
Re: Contact record not pupulated when Task created using Workflow. -
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. -
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 -
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 -
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 -
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 -
Hi,
I have FM 'update_table' with asynchrounous call(FM which use starting new task). This FM updates the table and commits the work.But when I try to read the datas from table I don't get the updated datas.This happens only in in real scenario.
When I try to debug the program it works fine and I get the updated data.
Let me know how to resolve the issue?
thanks
SuganyaHi,
As you want to update table in the function module, are you calling this fm in UPDATE TASK?
Here are more details about the command.
CALL FUNCTION func IN UPDATE TASK.
Extras:
... EXPORTING p1 = f1 ... pn = fn
... TABLES p1 = itab1 ... pn = itabn
Effect
Flags the function module func for execution in the update task. It is not executed at once, but the data passed with EXPORTING or TABLES is placed in a database table and a subsequent COMMIT WORK then causes the function module to be executed by the update task. Update function modules must be flagged as such in the Function Builder
The return value is not set.
Addition 1
... EXPORTING p1 = f1 ... pn = fn
Effect
Values of fields and field strings specified under EXPORTING are passed from the calling program to the function module. In the function module, the formal parameters are defined as import parameters. In the interface definition, default values must be assigned to all import parameters of the update function module.
Addition 2
... TABLES p1 = itab1 ... pn = itabn
Effect
TABLES passes references to internal tables. All table parameters of the function module must have values.
Note
With update function modules, both import parameters and exceptions are ignored when the call is made.
1. During updating processes of function modules, you may not make any calls using the language statements SUBMIT, CALL DIALOG, CALL SCREEN, CALL TRANSACTION, COMMIT WORK or ROLLBACK WORK . All other language elements that trigger a database Commit (for example, a screen change using the MESSAGE statement) also lead to a runtime error during updating.
ashish -
Facing problem in call function starting new task taskname
Hi all,
when i call a function module using starting new task, it is failing with sy-subrc 3. can anyone guide me in this.
see the code :
DATA lv_taskname(7) TYPE c VALUE 'PEM_EXE'.
CALL FUNCTION 'PEM_SCHEDULE' STARTING NEW TASK lv_taskname
EXPORTING
iv_packid = gv_packid
iv_pebid = ls_alv_out-peb_id
EXCEPTIONS
invalid_state_request = 1
database_error = 2
OTHERS = 3.
Thanks in advance.
Best Regards,
Prashantwhen i change the function module from normal to remote, it gives me a error that the "generic types are not allowed in RFC", but i have not given any generic type in the parameters.
see the signature of the function module.
*" IMPORTING
*" VALUE(IV_PACKID) TYPE CNVMBTPACK-PACKID
*" VALUE(IV_PEBID) TYPE CNVMBTPEB-PEB_ID
*" EXPORTING
*" VALUE(EV_ERROR_DETECTED) TYPE C
*" VALUE(EV_STOP) TYPE C
*" EXCEPTIONS
*" INVALID_STATE_REQUEST
*" DATABASE_ERROR
*" FORIEGN_LOCK
Can u please check it and find out the problem
Thanks,
Prasanth -
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 -
Hi all,
Do I have to create the task 'latepy' here at somewhere?
CALL FUNCTION 'ZHR_SENDMAIL STARTING NEW TASK 'latepy'
exporting ...
importing ...
exceptions ...
When I have removed the " starting new task 'latepy' "
mails are sent but if not, mails are not sent and assigned their properties as 'No entry in queue yet'.
As last remedy, I can remove the 'latepy' to handle the problem but I wonder this task matter.
Thanks.
Deniz.no..you don't have to create the task anywhere else...the task is just meant for executing the FM in a separate session in asynchronous mode..
you can check the results of this task using the RECEIVE RESULTS FROM FUNCTION to see if your function has executed successfully
RECEIVE RESULTS FROM FUNCTION 'ZHR_SENDMAIL'
<parameter list> -
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 -
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 - Issue with memory variables
Hi All,
From our OIL application we have a call to the core delivery update FM WS_DELIVERY_UPDATE starting new task.Before the call we are exporting a variable to memory and deep inside the FM we have an oil routine which checks the value of this variable to decide on further flow. But since the FM is called in new task the variable is not available here.
We cannot use the SET GET parameter also as this value can be different for each session.
Can anyone suggest how to set and get the parameter value in this flow.
With regards,
UshaHi again,
To check whether the FM is running in new task or not - This is what I have tried (this may not be the best way), but it works fine.
1. The variable to check inside the called FM is SY-CPROG.
2. This variable will have value.
RS_TESTFRAME_CALL - If being checked from se37
Z / Y program - if called from the original z / y program (WITHOUT new task).
SAPMSSY1 - if being called using NEW TASK (and no debugging)
hope this helps.
Regards,
Amit Mittal.
Maybe you are looking for
-
MOVED: Z68A-GD65-G3 SLI black screen lock ups
This topic has been moved to Overclockers & Undervolting & Modding Corner. https://forum-en.msi.com/index.php?topic=155410.0
-
I designed my social media buttons. How do I add the link to each one. For example: How do I add my Facebook link to my facebook button on my muse site?
-
How do you create subfolder in IDVD?
I want to create a folder in iDVD so when I click over on a folder other subfolders can be seen. Ex. Folder "Months" click over this and now below appears: months Jan Feb power mac G4 Mac OS X (10.3.2)
-
To get a new search bar to come up I have to go to File, open a new window. If I select open a new tab, only a tab comes up, no search bar. I tried downloading current Firefox then reverted back to old ones trying to fix my problem.
-
Hello everyone, I've a doubt regarding events. In our 11gr2 PSU2 env we faced ORA-1031 errors. Contacting support, we came to know that was a bug which wasn't yet filed. Later, we were asked to set 1031 event. Whenever we set the events we received m