Call function - New task
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.
FORM bapi_matphysinv_changecount .
call function 'BAPI_MATPHYSINV_CHANGECOUNT'
physinventory = zwewa_y-iblnr
fiscalyear = zwewa_y-gjahr
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.