Skip to Content
0
Former Member
May 21, 2008 at 02:41 AM

For all entries vs Loop

465 Views

hi experts I wonder why this two selection gives me a different result . I want to use the FOR ALL ENTRIES IN because it is much faster but it won't give me the exact result unlike LOOP or there something i don't know about FOR ALL ENTRIES.

  • FOR ALL ENRIES SELECTION

SELECT

BUKRS

GJAHR

HKONT

BELNR

DMBTR

SHKZG

ZUONR

INTO CORRESPONDING FIELDS OF TABLE it_data1 FROM

BSEG

FOR ALL ENTRIES IN it_select

WHERE bukrs IN S_BUKRS AND

GJAHR IN S_GJAHR AND

BELNR EQ it_select-BELNR AND

ZUMSK EQ SPACE.

*LOOP

LOOP AT it_select INTO wa_select.

SELECT

BSEG~BUKRS

BSEG~GJAHR

BSEG~HKONT

BSEG~BELNR

BSEG~DMBTR

BSEG~SHKZG

BSEG~ZUONR

APPENDING CORRESPONDING FIELDS OF TABLE it_data1 FROM

BSEG

WHERE BSEG~bukrs EQ wa_select-BUKRS AND

BSEG~GJAHR EQ wa_select-GJAHR AND

BSEG~BELNR EQ wa_select-BELNR

AND

BSEG~ZUMSK EQ SPACE.

ENDLOOP.

Please guys guide me.