Skip to Content
0
Former Member
Feb 13, 2007 at 08:33 PM

Using for all entries

65 Views

Is this okay to use?

I have the following code and could do it either way but I don't know what is the best

SELECT BELNR KOKRS BUZEI GJAHR EBELN EBELP

INTO TABLE T_COEP

FROM COEP

FOR ALL ENTRIES IN T_ICORDCSTA1

WHERE BELNR = T_ICORDCSTA1-BELNR

AND KOKRS = T_ICORDCSTA1-KOKRS

AND BUZEI = T_ICORDCSTA1-BUZEI

AND GJAHR = T_ICORDCSTA1-FISCPER+0(4).

OR

DATA wa_icordcsta1 type icordcsta1.

*

LOOP AT t_icordcsta1 INTO wa_icordcsta1.

*

SELECT belnr kokrs buzei gjahr ebeln ebelp

APPENDING TABLE t_coep

FROM coep

WHERE belnr = wa_icordcsta1-belnr

AND kokrs = wa_icordcsta1-kokrs

AND buzei = wa_icordcsta1-buzei

AND gjahr = wa_icordcsta1-fiscper+0(4).

ENDLOOP.