Skip to Content
0
Oct 24, 2019 at 05:55 AM

Can I use BAPI BAPI_GOODSMVT_CREATE with Parallel Processing?

701 Views

Currently, I'm wondering I can improve current program with Parallel Processing -

I have to make 70,000 GI/GR Documents with BAPI, and it takes a lot of time.. So I want to split into smaller packages AND do some Parallel Processing to split WP.

So I make test-run program, which makes 50 Document, which splits to 10 WP Like this :

DO 50 TIMES.

WAIT UNTIL g_progs LE pa_wpnum.

CALL FUNCTION 'Z_PARA_TEST'
STARTING NEW TASK g_task DESTINATION IN GROUP ' 390'
PERFORMING return_z_para_test ON END OF TASK
exceptions
resource_failure = 3.

CASE sy-subrc.
WHEN 3.
WAIT UNTIL g_progs < 3 UP TO '20' SECONDS.
ENDCASE.

ADD 1 TO g_task.
ADD 1 TO g_progs.
ADD 1 TO g_sprog.

ENDDO.

FORM return_z_pp_para_test USING taskname.

SUBTRACT 1 FROM g_progs.

ADD 1 TO g_eprog.

gt_chk_message-message = 10.
APPEND gt_chk_message.

ENDFORM.

* Z_PARA_TEST has BAPI_GOODSMVT_CREATE -> BAPI_TRANSACTION COMMIT functions.

It turns out, I looped 50 times(it shows 50 lines of '10' writings). But Only makes 1 documents!

So..My question is :

1. Do BAPI_GOODSMVT_CREATE works with Parallel Processing? Or am I doing Wrong?

2. I think Document Number will be same, If each WP is working too fast. It could be a problem?