‎2007 Mar 09 1:27 PM
hi..experts ...how can we avoid select statement in loop and endloop...answer will be rewarded
‎2007 Mar 09 1:28 PM
Hi,
use for all entries in select statement.
select <field1> <field2> FROM <table> INTO TABLE <itab1>
FOR ALL ENTRIES IN <itab1>
WHERE <field1> EQ <value>.
check this link for sample program.
http://web.mit.edu/ist/org/admincomputing/dev/no_all_entries_in.htm
Regards,
Sruthi
‎2007 Mar 09 1:28 PM
Hi,
use for all entries in select statement.
select <field1> <field2> FROM <table> INTO TABLE <itab1>
FOR ALL ENTRIES IN <itab1>
WHERE <field1> EQ <value>.
check this link for sample program.
http://web.mit.edu/ist/org/admincomputing/dev/no_all_entries_in.htm
Regards,
Sruthi
‎2007 Mar 09 1:28 PM
‎2007 Mar 09 1:29 PM
Hi,
Using "for all entries" is one way.
Using a "read" within a loop at internal table.
Can also do selects separately, and by looping
at one internal table, read the other.
Regards,
Saumya
‎2007 Mar 09 1:30 PM
hi
use for all entries in the select clause.
ex:
SELECT VBELN INTO TABLE T_VBAK
FROM VBAK
FOR ALL ENTRIES IN ITAB
WHERE VBELN = ITAB-VGBEL.
regards,
madhu
‎2007 Mar 09 1:30 PM
HI ,
Use FOR ALL ENTRIES statement ..
IF NOT IT_DO_TR[] IS INITIAL.
* Get OIU_DO_DP table data
SELECT MP_NO
BUKRS
VNAME
DOI_NO
MAJPD_CD
KOSTL
EFF_TO_DT
FROM OIU_DO_DP
INTO TABLE IT_DO_DP2
FOR ALL ENTRIES IN IT_DO_TR
WHERE BUKRS = IT_DO_TR-BUKRS AND
VNAME = IT_DO_TR-VNAME AND
DOI_NO = IT_DO_TR-DOI_NO.
IF SY-SUBRC = 0.
COMMIT WORK.
SORT IT_DO_DP2 BY BUKRS VNAME DOI_NO MAJPD_CD.
ENDIF.
ENDIF.
‎2007 Mar 09 1:31 PM
use this example,
SELECT CARRID CONNID CITYFROM CITYTO
INTO CORRESPONDING FIELDS OF LINE
FROM SPFLI
FOR ALL ENTRIES IN ITAB
WHERE CITYFROM = ITAB-CITYFROM AND CITYTO = ITAB-CITYTO.
Regards,
Pavan P