Skip to Content
0
Former Member
Nov 30, 2005 at 05:08 AM

Processing PERFORM in background

16 Views

Hi All,

Can anybody tell me wether we can sumbit PERFORM (Code) in background. The purpose is actually i will call below code in my program as <b>PERFORM f_bapi_material_save_data.</b> per every 1000 records so i will execute following code 10 times if 10000 rec's are there.

Beacuse i am having BAPI call in the below code it is taking lot's of time so can anybody tell me can i process following piece of code in background so that performence of my code increases if i run in background.

FORM f_bapi_material_save_data .

DATA itab_index LIKE sy-tabix.

DATA: l_plantdata LIKE bapi_marc,

l_headdata LIKE bapimathead,

l_plantdatax LIKE bapi_marcx,

l_tabix LIKE sy-tabix.

CONSTANTS: c_s TYPE c VALUE 'S'.

DATA i_temp_bapi_return LIKE bapi_matreturn2

OCCURS 0 WITH HEADER LINE.

LOOP AT i_temp_zppe0091_wa WHERE upd = c_x.

l_tabix = sy-tabix.

l_headdata-material = i_temp_zppe0091_wa-matnr.

l_plantdata-plant = i_temp_zppe0091_wa-werks.

l_plantdata-replentime = i_temp_zppe0091_wa-wzeit.

l_plantdatax-replentime = c_x.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = l_headdata

plantdata = l_plantdata

plantdatax = l_plantdatax

TABLES

returnmessages = i_temp_bapi_return.

IF NOT i_temp_bapi_return[] IS INITIAL.

READ TABLE i_temp_bapi_return WITH KEY type = c_s.

IF sy-subrc EQ 0.

i_marc_rpt-matnr = i_temp_zppe0091_wa-matnr.

i_marc_rpt-werks = i_temp_zppe0091_wa-werks.

APPEND i_marc_rpt. CLEAR i_marc_rpt.

ELSE.

i_temp_zppe0091_01-upd = space.

MODIFY i_temp_zppe0091_01 INDEX l_tabix TRANSPORTING upd.

ENDIF.

ENDIF.

ENDLOOP.

ENDFORM. " f_bapi_material_save_data

Can anybody give me the solution for the above problem.

Thanks in advance.

Thanks & Regards,

Rayeez.