Hello Experts,
My select query takes a long time to give its output when I select and order type say PM15.
It gives me the return message but takes a long time.
Is there any other possibility to get output much faster.
SELECT a~aufnr a~auart a~objnr a~werks b~stat INTO CORRESPONDING FIELDS OF TABLE itab1 FROM aufk AS A JOIN jest AS B ON a~objnr EQ b~objnr WHERE a~aufnr IN s_aufnr AND a~auart in s_auart AND A~werks IN S_IWERK AND b~inact EQ ' '. "can set incat = space(Active) OR incat = 'X'(Not Active) SELECT a~aufnr a~auart a~objnr a~werks b~stat INTO CORRESPONDING FIELDS OF TABLE itab FROM aufk AS A JOIN jest AS B ON a~objnr EQ b~objnr WHERE a~aufnr IN s_aufnr AND a~auart in s_auart AND A~werks IN S_IWERK AND b~stat IN ('I0002','I0340'). READ TABLE ITAB INDEX 1. refresh: T_METH. clear: T_METH. clear :wa_meth. sort itab. DELETE ADJACENT DUPLICATES FROM ITAB COMPARING AUFNR. LOOP AT ITAB. wa_meth-refnumber = 1. wa_meth-objecttype = 'HEADER'. wa_meth-method = 'ATPCHECK'. wa_meth-objectkey(12) = ITAB-AUFNR. * wa_meth-objectkey(12) = ITAB-OBJNR. append wa_meth to t_meth. clear wa_meth. wa_meth-refnumber = 1. wa_meth-method = 'SAVE'. wa_meth-objectkey(12) = ITAB-AUFNR. * wa_meth-objectkey(12) = ITAB-OBJNR. append wa_meth to t_meth. call function 'BAPI_ALM_ORDER_MAINTAIN' tables it_methods = T_METH return = T_RET. call function 'BAPI_TRANSACTION_COMMIT'. LOOP AT T_RET. write:/ T_RET-MESSAGE. EXIT. ENDLOOP. ENDLOOP.
Thanks and Regrds,
Nikhil.