‎2009 Aug 31 1:28 PM
Hi all,
I am having one ZTABLE
Which contains 50 fields.....
I want ztable data into one internal table with only 2 conditions..I am worring of performance issue any one help me please!!
Requiremetn....
ztable -> data will be pulled into internal table itab on one condition where feild1 = '100'.
now my itab is having 10 records imagine..
where all 10 records with field1 = '100'.
Now i need to check what is the value of Field2 in itab.
the field2 is imagine is as follows 1000 , 2000, 3000 , 4000...
Now check the field2 value in the internal table where the field2 is having only ''100' or any other number if it has any other number then pull that also .....so imagine if field2 '1000' is having 100 & 200 both should be in ITAB.
so how to write the logic with good perfromance ...
Regards
sas
Issu
Moderator message - Moved to the correct forum
Edited by: Rob Burbank on Aug 31, 2009 10:31 AM
‎2009 Aug 31 1:43 PM
Hi,
Use this query hope this will resolve your issue....
SELECT * FROM ztable INTO TABLE itab
WHERE field2 IN ( SELECT field2 FROM ztable WHERE field1 = '100' ).Regards,
Siddarth
‎2009 Aug 31 1:32 PM
>
> Now check the field2 value in the internal table where the field2 is having only ''100' or any other number if it has any other number then pull that also .....so imagine if field2 '1000' is having 100 & 200 both should be in ITAB.
>
This part is not clear. Can you elaborate on this?
Regards,
Vikranth
‎2009 Aug 31 1:43 PM
Hi,
Use this query hope this will resolve your issue....
SELECT * FROM ztable INTO TABLE itab
WHERE field2 IN ( SELECT field2 FROM ztable WHERE field1 = '100' ).Regards,
Siddarth
‎2009 Aug 31 3:33 PM
If I understand your question correctly, it's pretty basic - just create an index on field2 (non-unique).
Rob
‎2009 Aug 31 4:11 PM
Actually this belongs to source of infocubes !! so i am just confused !!I hope we cant create Index's as they are not unique !!
i thought of code !! as follows
any way chandra has given the rite answer ...
Regards
sas