cancel
Showing results for 
Search instead for 
Did you mean: 

Optimizing End Routine Logic

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member185132
Active Contributor
0 Kudos

Hi,

You need to write the SELECT statement outside the loop. Just cut the SELECT statement and plce it before the loop. The rest of the code seems fine.

Regards,

Suhas

Answers (0)