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

Logic to pull the data without performance issue

Former Member
0 Likes
582

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
557

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

4 REPLIES 4
Read only

Former Member
0 Likes
557

>

> 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

Read only

Former Member
0 Likes
558

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

Read only

Former Member
0 Likes
557

If I understand your question correctly, it's pretty basic - just create an index on field2 (non-unique).

Rob

Read only

0 Likes
557

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