‎2010 May 17 10:41 AM
Hello All,
I need to make changes to any existing query. The existing one fetches data only from a single table, but now I need to add 3 more fields in the output. These three fields are from a different table.
Can yo let me know, how can i achieve this.
Looking forward for your replies.
Thanks and Regards,
Santhosh Guptha N.
‎2010 May 17 10:43 AM
hi,
If you find similar key fields or foreign keys in other table then you can use join, otherwise use 'FOR ALL ENTRIES' to get the records from second table based on first.
‎2010 May 17 10:54 AM
Hello Hari,
Thanks for your reply.
I need to make changes in a SAP QUERY(created through SQ01) and not in any of the reports.
Thanks and Regards,
Santhosh Guptha N.
‎2010 May 17 11:10 AM
‎2010 May 17 10:55 AM
hi,
Even in queries also you can use join, just add the new table, and select the required fields for output.
‎2010 May 17 11:04 AM
Hi..
Can you give me any pointers as to how do i do it?
Should i make the changes in the infoset and then make the same in the query, or can i do it directly in SQ01.
Thanks and Regards,
Santhosh Guptha N.
‎2010 May 17 10:59 AM
Hi Santosh,
Please refer the below join statement where the value is selected from 2 different tables. hope it helps.
Select A~Vbeln
A~vbtyp
B~posnr
B~erdat
into table I_VBAP
from vbak as A innner Join VBAP as B
on a~vbeln = b~vbeln
where a~vbeln IN lr_vbeln AND
b~posnr IN lr_posnr AND
b~aedat IN lr_aedat AND
( a~vbtyp EQ 'A' OR
a~vbtyp EQ 'B' OR
a~vbtyp EQ 'G' ).
Regards,
Jithin
‎2010 May 17 11:09 AM
hi,
You can add the second table in infoset using join option ,in query select the required field for output. Please check the key fields combination for join.
‎2010 May 18 7:19 AM
Hello Hari,
The join option is disabled in the query, which i am working on.
Can you please let me know, as to why is this, and how i can change the same.
Thanks and Regards,
Santhosh Guptha N