‎2008 Apr 10 8:44 AM
Hi Guys,
Having my sample code below, is it just possible to use as a parameter of the where clause the value taken from internal table i_tc21?? If this is the a wrong logic, please tell how am i going to do it? Thanks a lot always...
IF sy-subrc eq 0 AND i_crhd[] is NOT INITIAL.
SELECT vgwts
par01
par02
par03
par04
par05
par06
FROM tc21 INTO CORRESPONDING FIELDS OF TABLE i_tc21
FOR ALL ENTRIES IN i_crhd
WHERE vgwts = i_crhd-vgwts.
IF sy-subrc eq 0 AND i_tc21[] is NOT INITIAL.
SELECT SINGLE txt
FROM tc20t INTO v_txt1
FOR ALL ENTRIES IN i_tc21
WHERE parid = i_tc21-par01
AND spras = c_en.
ENDIF.
ENDIF.
‎2008 Apr 10 8:50 AM
‎2008 Apr 10 8:52 AM
Thanks Rengith...
If there are multiple entries in table i_tc21, will it read everything in that internal internal table before ending the Select statement??
Thanks a lot!
‎2008 Apr 10 9:07 AM
Hi,
FOR ALL ENTRIES doesn't work with select single.
Regards,
Sipra
‎2008 Apr 10 9:25 AM
Thanks...
Is there any way to shorten the code below??
What if the i_tc21 has multiple values,,, how am i going to pass every entry of the internal table to the select statement??
Thanks a lot!
Thanks a lot!
IF sy-subrc eq 0 AND i_tc21[] is NOT INITIAL.
SELECT txt
FROM tc20t INTO v_txt1
FOR ALL ENTRIES IN i_tc21
WHERE parid = i_tc21-par01
AND spras = c_en.
IF sy-subrc eq 0.
do nothing
ENDIF.
SELECT txt
FROM tc20t INTO v_txt2
FOR ALL ENTRIES IN i_tc21
WHERE parid = i_tc21-par02
AND spras = c_en.
IF sy-subrc eq 0.
do nothing
ENDIF.
SELECT txt
FROM tc20t INTO v_txt3
FOR ALL ENTRIES IN i_tc21
WHERE parid = i_tc21-par03
AND spras = c_en.
IF sy-subrc eq 0.
do nothing
ENDIF.
SELECT txt
FROM tc20t INTO v_txt4
FOR ALL ENTRIES IN i_tc21
WHERE parid = i_tc21-par04
AND spras = c_en.
IF sy-subrc eq 0.
do nothing
ENDIF.
SELECT txt
FROM tc20t INTO v_txt5
FOR ALL ENTRIES IN i_tc21
WHERE parid = i_tc21-par05
AND spras = c_en.
IF sy-subrc eq 0.
do nothing
ENDIF.
SELECT txt
FROM tc20t INTO v_txt6
FOR ALL ENTRIES IN i_tc21
WHERE parid = i_tc21-par06
AND spras = c_en.
IF sy-subrc eq 0.
do nothing
ENDIF.
ENDIF.