Skip to Content
0
Former Member
Dec 20, 2011 at 04:46 PM

Optimizing End Routine Logic

37 Views

Can anyone tell me whether they can see a way of optimising the following end

routine logic that I have written.

The lookup DSO has a suitable index on it. The load performance is too slow with

this logic in place

Thanks

types: begin of TY_ST ,

BILL_NUM type /BI0/OIBILL_NUM,

COMP_CODE type /BI0/OICOMP_CODE,

PAYER type /BI0/OIPAYER,

CLEAR_DATE type /BI0/OICLEAR_DATE,

PSTNG_DATE type /BI0/OIPSTNG_DATE,

DEB_CRE_LC type /BI0/OIDEB_CRE_LC,

end of TY_ST.

data: T_ST type standard table of TY_ST,

WA_ST type TY_ST.

refresh T_ST.

loop at RESULT_PACKAGE assigning <RESULT_FIELDS>.

select AC_DOC_NO COMP_CODE DEBITOR CLEAR_DATE PSTNG_DATE

DEB_CRE_LC

from /BIC/AZARO0100 into table T_ST

for all entries in RESULT_PACKAGE

where AC_DOC_NO eq RESULT_PACKAGE-BILL_NUM and

COMP_CODE eq RESULT_PACKAGE-COMP_CODE and

DEBITOR eq RESULT_PACKAGE-PAYER.

clear WA_ST.

read table T_ST into WA_ST with key

BILL_NUM = <RESULT_FIELDS>-BILL_NUM

COMP_CODE = <RESULT_FIELDS>-COMP_CODE

PAYER = <RESULT_FIELDS>-PAYER.

if SY-SUBRC = 0.

<RESULT_FIELDS>-CLEAR_DATE = WA_ST-CLEAR_DATE.

<RESULT_FIELDS>-PSTNG_DATE = WA_ST-PSTNG_DATE.

<RESULT_FIELDS>-DEB_CRE_LC = WA_ST-DEB_CRE_LC.

endif.

endloop.