Skip to Content
0
Former Member
May 12, 2009 at 12:55 PM

Timeout in select mseg

124 Views

Hi,

i try this short report and get allways a runtime-error. Has anyone an idea where i can

in MSEG faster?

REPORT ZTEST MESSAGE-ID ZZ.
*
TABLES: LFA1,   "Lieferantenstamm (allgemeiner Teil)
        LFM1,   "Lieferantenstamm Einkaufssicht
        MSEG.
*
PARAMETERS:       P_MJAHR LIKE MKPF-MJAHR.
SELECT-OPTIONS:   S_MBLNR FOR MSEG-LIFNR.
SELECT-OPTIONS:   S_LIFNR FOR LFA1-LIFNR.
*
DATA: DMBTR     LIKE          MSEG-DMBTR.
DATA: DMBTR_SUM LIKE          MSEG-DMBTR.
*
START-OF-SELECTION.
*
  SELECT * FROM LFA1 WHERE LIFNR IN S_LIFNR.
*
    SELECT SINGLE * FROM LFM1 WHERE LIFNR = LFA1-LIFNR
                                AND EKORG = '1000'.
*
    CLEAR: DMBTR_SUM.
    IF SY-SUBRC = 0.
* Nur wenn auch Einkaufssicht vorhanden
      SELECT DMBTR FROM MSEG INTO DMBTR
                         WHERE MBLNR IN S_MBLNR
                           AND MJAHR = P_MJAHR
                           AND LIFNR = LFA1-LIFNR
                           AND BWART = '101' "Wareneingang
                           AND KZBEW = 'B'.  "Bestellung.
*
        ADD DMBTR TO DMBTR_SUM.
*
      ENDSELECT.
*
    ENDIF.
*
    WRITE: LFA1-LIFNR, DMBTR_SUM.
*
  ENDSELECT.
*
END-OF-SELECTION.
************************************************************************

Thanks.

regards, Dieter

Moderator message - Moved to the correct forum

Edited by: Rob Burbank on May 12, 2009 9:30 AM