‎2007 Aug 27 5:34 PM
Hello friends,
I am trying to write a select querry.
I have 2 internal table. T_PRPS and T_COSS.
T_PRPS already has data in it and based on the data in T_PRPS i need to extract data from coss into t_coss.
i need to extract data for only those records in t_prps where t_PRPS-XSTAT = 'X',
and t_PRPS-objnr = coss-objnr.
I am using this code but its wrong. I know it can be done by using anotther temporary table for t_PRPS where xstat = 'X' but was wondering any simpler way.
<u> SELECT * FROM COSS
INTO TABLE T_COSS_XSTAT
FOR ALL ENTRIES IN T_PRPS
WHERE T_PRPS_XSTAT = 'X'
AND OBJNR = T_PRPS-OBJNR.</u>
Any Suggestions.
Shejal.
‎2007 Aug 27 5:38 PM
Unfortunately using a temp table for PRPS entries where XSTAT = 'X' is the only option other than looping at all the records with the same condition.
‎2007 Aug 27 5:38 PM
Unfortunately using a temp table for PRPS entries where XSTAT = 'X' is the only option other than looping at all the records with the same condition.
‎2007 Aug 27 5:41 PM
‎2007 Aug 27 5:39 PM
you have to go with the temporary table.
i_temp_prps[] = i_prps[].
delete i_temp_prps where xstat ne 'X'.
SELECT * FROM COSS
INTO TABLE T_COSS_XSTAT
FOR ALL ENTRIES IN T_TEMP_PRPS
WHERE OBJNR = T_TEMP_PRPS-OBJNR.
‎2007 Aug 27 5:39 PM
Hi,
T_PRPS_T[] = T_PRPS[].
DELETE T_PRPS_T WHERE XSTAT NE 'X'.
IF NOT T_PRPS_T[] IS INITIAL.
SELECT * FROM COSS
INTO TABLE T_COSS_XSTAT
FOR ALL ENTRIES IN T_PRPS_T
WHERE OBJNR = T_PRPS_T-OBJNR.
ENDIF.
aRs