on 2016 Aug 26 3:01 PM
Hi All,
We have scenario where we need to perform the lookup from a DSO to another DSO by using Multiple conditions for different fields from but from the same lookup DSO.
example
condition 1:
select /bic/YMAT_2 /bic/YMAT_D5 from /bic/AYDSO_900 into corresponding fields of table it_tab1 for all entries in result_package where
/bic/YMAT_2 = result_package-/bic/YMAT_2.
Condition 2
select /bic/YMAT_2 /bic/YMAT_D10 from /bic/AYDSO_900 into corresponding fields of table it_tab1 for all entries in result_package where
/bic/YMAT_2 = result_package-/bic/YMAT_2 and /bic/YMAT_5 = result_package-/bic/YMAT_5.
Kindly suggest the end routine code how can we achieve this with performance. As of now we are using 2 internal tables and WA to achieve this.
Request clarification before answering.
Hi Jagadeep,
In order to simplfy you only need to mantain the second read since in both selects you use YMAT_2 as a key.
****** select /bic/YMAT_2 /bic/YMAT_D10
from /bic/AYDSO_900
into corresponding fields of table it_tab1
for all entries in result_package
where /bic/YMAT_2 = result_package-/bic/YMAT_2
and /bic/YMAT_5 = result_package-/bic/YMAT_5. (maybe,delete this AND)
I would think you only need to change the first line:
****** select /bic/YMAT_2 /bic/YMAT_D5 /bic/YMAT_D10
If you need both conditions and they have different values, then DO just one read to the /bic/AYDSO_900
and read all chars you may need, save it in an internal table and then use your internal table to read both conditions.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fernandez,
Thank you for your reply.
So in this case the code would be some thing like below?
select /bic/YMAT_2 /bic/YMAT_D5 /bic/YMAT_D10 from /bic/AYDSO_900 into corresponding fields of table it_tab1.
1st condition.
read table it_tab1 into wa_tab1 with key
/bic/YMAT_2 = <result_fields>-/bic/YMAT_2 binary search.
clear WA_tab1.
2nd condition:
read table it_tab1 into wa_tab1 with key
/bic/YMAT_2 = <result_fields>-/bic/YMAT_2 and /bic/YMAT_5 = <result_fields>-/bic/YMAT_5.
Hi
You can use 1 internal table to fetch everything from Look up DSO and while populating the fields do multiple Reads depending on you condition for different fields.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
30 | |
10 | |
8 | |
8 | |
7 | |
6 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.