Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Call function - New task

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.

Tags:
Former Member
replied

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.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question