Application Development 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: 

Performance Droop because of WAIT UPTO 1 Seconds before 'FI_ITEMS_MASS_CHANGE'

sanjay_deshpande4
Participant
0 Kudos

Hi All,

I am having below code in Prod. The code is getting slower because of wait up to 1 seconds as highlighted below.(Means 1 extra second per record)

The WAIT statement has been used so that the update happens properly using func. module 'FI_ITEMS_MASS_CHANGE'. Can anybody kindly suggest what can be done so that update will happen successfully without waiting for 1 second.

loop at gt_file into gs_file.
w_bseg-zuonr = gs_file-zuonr.
read table gt_buztab into gs_buztab with key
belnr = gs_file-belnr
bukrs = gs_file-bukrs
gjahr = gs_file-gjahr
buzei = '01' binary search.
if sy-subrc = 0.
append gs_buztab to gt_buztab_1.
endif.
* Below "wait" statement is used to let the database updation happen
*smoothly, without this, it is not working efficiently.

wait up to 1 seconds.
call function 'FI_ITEMS_MASS_CHANGE'

exporting
s_bseg = w_bseg
importing
errtab = gt_errtab[]
tables
it_buztab = gt_buztab_1
it_fldtab = gt_fldtab
exceptions
bdc_errors = 1
others = 2.

if sy-subrc = 0.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
clear: gt_buztab_1.
else.
* WRITE : 'Line Item',gs_file-buzei, "#EC NOTEXT
* 'Not updated properly,Please check'. "#EC NOTEXT
skip.
endif.
endloop.

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos

If you look at all the other answers in the forum, they say that the function module FI_ITEMS_MASS_CHANGE is using Batch Input which is a very slow technology. It's not related to WAIT UP TO 1 SECONDS (which slows even more, but it's less than Batch Input). It also means that BAPI_TRANSACTION_COMMIT makes no sense, it's not related to Batch Input at all. The code behind the Batch Input probably does the commit work itself.

If you want to force the Batch Input to wait for the end of updates, you have to look for the CALL TRANSACTION ... USING ... that the function module FI_ITEMS_MASS_CHANGE is calling (directly or indirectly) to run the Batch Input, and adapt it so that it runs with the option OPTIONS FROM ctu_param, where ctu_param-updmode = 'S' or 'L', so that to respectively wait for the updates to finish or run the updates synchronously.

0 Kudos

Hi Sandra,

Thanks for kind reply.

After checking various threads have found BAPI_ACC_DOCUMENT_POST(which is sadly not updating ZUONR) and FI_ITEMS_MASS_CHANGE which is slow.

DO you have any other solution for updating ZUONR?

Kindly help.

0 Kudos

No idea. Good idea to post a new question about it!

raymond_giuseppi
Active Contributor
0 Kudos

For one field only, you could build yourself a small BDC on FB09 (or FB02) and call the transaction in Synchronous mode.

CALL TRANSACTION 'FB09' USING bdc_tab UPDATE 'S'.

Also as sandra.rossi wrote, the COMMIT WORK in your code is not relevant, the called FM call the transaction with optiion: update 'A'.