Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Performance in BSIS

Hi gurus,

Need your help. I have more than 10,000 entries in BSIS and it took me 5mins to retireve it. Here's my code...

  SELECT a~mandt
         a~belnr
         A~BUZEI
         a~mwskz
         a~budat
         A~SHKZG
         A~DMBTR
         b~lifnr
         B~NAME1
         b~ktokk
  APPENDING CORRESPONDING
  FIELDS OF TABLE lt_tab
  FROM bsak AS a
  INNER JOIN lfa1 AS b
  ON a~lifnr = b~lifnr
  WHERE a~bukrs EQ so_ccode
  AND A~GJAHR EQ LV_YEAR
  AND a~budat IN so_postp
  AND MWSKZ IN SO_TXCDE.

  SORT lt_tab1 BY lifnr belnr.
  DELETE LT_TAB WHERE KTOKK EQ 'UEMP'.

  if not lt_tab[] is initial.
    SELECT BELNR
           MWSKZ
           SHKZG
           DMBTR
           WAERS
           HKONT
    INTO CORRESPONDING FIELDS OF TABLE LT_TAB2_TEMP
    FROM BSIS
   for all entries in lt_tab
    WHERE BUKRS EQ SO_CCODE
    AND hkont ne c_hkont
    AND GJAHR EQ LV_YEAR
    AND belnr eq lt_tab-belnr
    AND MWSKZ IN SO_TXCDE
    AND BUDAT IN SO_POSTP.

  endif.

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question