Hello Everyone,
I have got an issue with BAPI performance.
it is taking almost 15 min to Execute.
Please suggest.
_______________________________________________________________________________________________
form get_date using i_basicweld like zbapi_i_basicweld.
select week1 date5
from zccal
into table it_zccal
where week1 = i_basicweld-zweek1
and year1 = i_basicweld-fisc_year
and day1 = i_basicweld-zday1.
* and dept = p_dept.
if sy-subrc ne 0.
* MESSAGE i000 WITH 'Calendar not generated for year' p_year.
* STOP.
endif.
select week1 year1 date1 date2
from zccal
into table it_zccal1
where week1 = i_basicweld-zweek1
and year1 = i_basicweld-fisc_year.
loop at it_zccal1.
v_tabix = sy-tabix.
if v_tabix = '1'.
r_date1-low = it_zccal1-date1.
r_date1-sign = 'I'.
r_date1-option = 'BT'.
elseif v_tabix = '5'.
r_date1-high = it_zccal1-date1.
append r_date1.
clear r_date1.
endif.
endloop.
*Check whether the data is there in ZCCPO1 table..
perform get_zccpo1 using i_basicweld.
endform. " get_date
*&---------------------------------------------------------------------*
*& Form get_zccpo1
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form get_zccpo1 using i_basicweld like zbapi_i_basicweld.
if i_basicweld-department ne 330 and i_basicweld-department ne 355.
select zccpo1~mandt
zccpo1~zcpos
zccpo1~aufnr
zccpo1~matnr
zccpo1~zcqty
zccpo1~zconf
zccpo1~zparc
zccpo1~year1
zccpo1~week1
zccpo1~workc
zccpo1~date2
from zccpo1
into corresponding fields of table it_zccpo1
where week1 = i_basicweld-zweek1
and year1 = i_basicweld-fisc_year
and workc = i_basicweld-department.
elseif i_basicweld-department = 330 or i_basicweld-department = 355.
select *
from zcpaint
into table it_zpaint
where week1 = i_basicweld-zweek1
and year1 = i_basicweld-fisc_year.
* and workc = p_dept.
loop at it_zpaint into w_zpaint.
it_zccpo1-mandt = w_zpaint-mandt.
*call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
* exporting
* input = w_zpaint-bismt
* importing
* output = it_zccpo1-zcpos.
it_zccpo1-zcpos = w_zpaint-zcpos.
it_zccpo1-aufnr = w_zpaint-aufnr.
it_zccpo1-matnr = w_zpaint-bismt.
it_zccpo1-zcqty = w_zpaint-zcqty.
it_zccpo1-zconf = w_zpaint-zconf.
it_zccpo1-zparc = w_zpaint-zparc.
it_zccpo1-year1 = w_zpaint-year1.
it_zccpo1-week1 = w_zpaint-week1.
clear lv_plgrp.
select single plgrp from caufv into lv_plgrp
where aufnr = it_zccpo1-aufnr.
it_zccpo1-workc = lv_plgrp.
*it_zccpo1-workc = 330.
it_zccpo1-date2 = w_zpaint-edate.
append it_zccpo1.
clear it_zccpo1.
endloop.
delete it_zccpo1 where workc ne i_basicweld-department.
endif.
_____________________________________________________________________________________________