Skip to Content
0
Former Member
Aug 31, 2007 at 09:56 AM

better SELECT ? INNER JOIN?

256 Views

Hi,

Can I get this code to be faster/better?


* get addres
      SELECT SINGLE haus
             INTO   lv_evbs-haus
             FROM   evbs
             WHERE  vstelle = lv_eanl-vstelle.
      IF sy-subrc = 0.
        SELECT SINGLE haus
               INTO   lv_ehauisu-haus
               FROM   ehauisu
               WHERE  haus = lv_evbs-haus.
        IF sy-subrc = 0.
          SELECT SINGLE tplnr
                 INTO   lv_iflot-tplnr
                 FROM   iflot
                 WHERE  tplnr = lv_ehauisu-haus.
          IF sy-subrc = 0.
            SELECT SINGLE adrnr
                   INTO   lv_iloa-adrnr
                   FROM   iloa
                   WHERE  tplnr = lv_iflot-tplnr.
            IF sy-subrc = 0.
              SELECT SINGLE *
                     FROM   adrc
                     WHERE  addrnumber EQ lv_iloa-adrnr.

              IF sy-subrc EQ 0.

                wa_billit-adrc_street      = adrc-street.
                wa_billit-adrc_house_num1  = adrc-house_num1.
                wa_billit-adrc_house_num2  = adrc-house_num2.
                wa_billit-adrc_post_code1  = adrc-post_code1.
                wa_billit-adrc_city1       = adrc-city1.
                wa_billit-evbs_lgzusatz    = evbs-lgzusatz.

              ENDIF."adrc
            ENDIF."iola
          ENDIF."iflot
        ENDIF."ehauisu
      ENDIF."evbs