‎2008 Oct 14 7:43 AM
Hi Everyone,
I would like to use the Call Function - New task for one of my requirments. Please suggest if I am not doing right.
My programs looping structure is:
LOOP at zwewa_x.
PERFORM bapi_matphysinv_changecount.
ENDLOOP.
FORM bapi_matphysinv_changecount .
call function 'BAPI_MATPHYSINV_CHANGECOUNT'
exporting
physinventory = zwewa_y-iblnr
fiscalyear = zwewa_y-gjahr
PERCENTAGE_VARIANCE =
tables
items = itab
return = it_return.
ENDFORM. " BAPI_MATPHYSINV_CHANGECOUNT
Why am I thinking to use NEW TAEK is; when normally I call the BAPI its creates so many locks on the different different tables resulting LOCK table memory issue. So I thought to use the NEW TASK addition which would run a new session and while coming back to the calling program, would release all the locks. But I am not understanding how to use the NEW TASK perfectly and how to get the values (IT_RETURN) back from the new session to the calling program.
Can anybody send me the sample code where NEW TASK statement is being used and later from the new session values or Internal tables are coming back to the calling program.
This would be a great help.
‎2008 Oct 15 1:11 PM
‎2008 Oct 15 1:11 PM
‎2008 Oct 15 1:40 PM
Hi,
Try this:
CALL FUNCTION func STARTING NEW TASK task
[DESTINATION {dest|{IN GROUP {group|DEFAULT}}}]
parameter list
[{PERFORMING subr}|{CALLING meth} ON END OF TASK].
Regards,
Neenu Jose.
‎2008 Oct 15 2:08 PM
may be you can try with Parallel processing.
check this Documentation on parallel processing.
http://help.sap.com/saphelp_nw04/helpdata/en/22/0425c6488911d189490000e829fbbd/content.htm
‎2008 Oct 15 2:55 PM
Hi,
there is no need to start new tasks - just unlock after each BAPI call using FM DEQUEUE_ALL or - more precisely - BAPI_TRANSACTION_COMMIT.
kind regards,
HP