Skip to Content
1
Former Member
Jul 02, 2007 at 07:39 AM

performance

16 Views

Hi,

i am fetching changenr from cdpos based on the requirement.

Then giving changenr for that material as input i am getting username and date.

I am getting desired result but cdpos is a cluster table so performance issue is there. so pls tell me is there any method or function module.

I am writing querries as follows:-

FORM extract_data_cdhdr.

*

itab_mara1[] = itab_mara[].

SELECT objectclas objectid changenr tabkey

INTO TABLE itab_cdpos

from cdpos

WHERE objectid IN S_MATNR " itab_mara1-objectid

AND TABNAME = 'MARC'

AND FNAME = 'STAWN'.

SORT itab_cdpos BY OBJECTCLAS OBJECTID CHANGENR.

Delete itab_cdpos where NOT tabkey+21(4) IN s_werks.

IF NOT itab_cdpos[] IS INITIAL.

SELECT changenr username udate OBJECTID

INTO TABLE itab_cdhdr

FROM cdhdr

FOR ALL ENTRIES IN itab_cdpos

WHERE OBJECTCLAS = itab_cdpos-objectclas

AND objectid = itab_cdpos-objectid

AND changenr = itab_cdpos-changenr.

if sy-subrc eq 0.

sort itab_cdhdr descending by udate.

SORT itab_cdhdr BY objectid.

endif.

Thanks,

Sandeep Garg