Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Call function - New task

former_member190178
Participant
0 Likes
994

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.

1 ACCEPTED SOLUTION
Read only

former_member190178
Participant
0 Likes
855

Please help.

4 REPLIES 4
Read only

former_member190178
Participant
0 Likes
856

Please help.

Read only

0 Likes
855

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.

Read only

Former Member
0 Likes
855

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

Read only

Former Member
0 Likes
855

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