Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP Code

Former Member
0 Likes
584

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
540

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.

4 REPLIES 4
Read only

Former Member
0 Likes
541

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.

Read only

0 Likes
540

Thanks Everyone.

Read only

Former Member
0 Likes
540

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.

Read only

former_member194669
Active Contributor
0 Likes
540

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