2022 Sep 18 11:06 AM
Hi Guys!
I Need a help
I have table1 and table 2
Table1
Field name - abc
Values ak,be,ce,de
Table2
Field name - def
Value - aec, def
I want to fetch all the value of TABLE2 (DEF) based on the values of TABLE1(ABC)
2022 Sep 18 11:07 AM
Welcome to the SAP Community. Thank you for visiting us to get answers to your questions.
Since you're asking a question here for the first time, I'd like to offer some friendly advice on how to get the most out of your community membership and experience.
First, please see https://community.sap.com/resources/questions-and-answers, as this resource page provides tips for preparing questions that draw responses from our members. Second, feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html, as that will help you when submitting questions to the community.
I also recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.
Now for some specific suggestions on how you might improve your question:
* Make sure you've applied the appropriate tags -- because if you don't apply the correct tags, the right experts won't see your question to answer it.
* Use the "insert code" feature when sharing your code, so members have an easier time reading.
Should you wish, you can revise your question by selecting Actions, then Edit.
The more details you provide (in questions tagged correctly), the more likely it is that members will be able to respond. As it stands, I don't know if there is enough information here for members to understand your issue. So please consider revising your question because I'd really like to see you get a solution to your problem!
I hope you find this advice useful, and we're happy to have you as part of SAP Community!
Regards,
Dedi
2022 Sep 18 12:43 PM
I don't understand the question. Given that you provide the input data, you could indicate the result that you expect.
2022 Sep 18 11:45 PM
Hi Dylan.
you can try something like this:
refresh it_table2.
select * into table it_table2
from table2
for all entries in table1
where abc = table1-def
2022 Sep 19 9:13 AM
SELECT table2~def
FROM table1 INNER JOIN table2 ON table1~abc = table2~def
INTO TABLE @DATA(t_result).
But is the above foreign key relation correct?
2022 Sep 20 1:59 PM
SELECT DISTINCT table2~def
FROM table1 INNER JOIN table2 ON table1~abc = table2~abc
" WHERE <some criteria>
INTO TABLE @DATA(outtab).
If not, please describe the rule that links the fields in both tables.