2007 Jul 11 7:10 AM
Hi All,
Scenario: A network is created for all missing parts for a machine using PS. This network contains certain materials & for these materials I would like to know what views have been maintained.
I am trying to join the tables RSEB & MARA. From table RSEB, i want to use the field AUFNR (for the network number), MATNR & WERKS as selection & display fields. From the MARA table i want to use VPSTA & PSTAT to display the material views stored.
I created a infoset & associated this infoset with the query i created. But when i run the query the VPSTA & PSTAT field is shown blank, but all other data is being displayed. Is there any code which i need to write to ensure that this data is displayed? But when i enter a production order number in the AUFNR field, am able to get the output in VPSTA & PSTAT.
I know am doing something wrong, but being a non-ABAPer not able to understand what is it that am doing wrong. so if someone can kindly help me on this, would be highly appreciated.
Vivek
2007 Jul 12 7:04 AM
HI,
Here is the sample code to Join the 3 tables
SELECT stpo~stlnr stpo~idnrk mast~matnr mara~mtart stpo~menge
INTO CORRESPONDING FIELDS OF TABLE zmat1 FROM mast
JOIN stpo ON stpo~stlnr = mast~stlnr
JOIN mara ON mara~matnr = mast~matnr
WHERE stpo~stlty = 'M' "AND stpo~idnrk IN s_matnr
AND mast~werks = 1000.
Look at the below link also
http://www.sap-img.com/abap/inner-joins.htm
Regards
Sudheer
2007 Jul 11 7:15 AM
Hi
Check the JOIN condition between <b>RESB and MARA</b> tables (not RSEB)
Have you joined MATNR field in both tables
if join is correct it will fetch the right data
and also check in MARA table whether data for these fields exist or not.
<b>Reward points for useful Answers</b>
Regards
Anji
2007 Jul 12 6:57 AM
Hi,
I am now able to join the 2 tables RESB & MARA, & read the data correctly. The error was with the join as pointed by you. Now am trying to join another table (VAPMA) with MARA to read the sales organization (VKORG) & distribution channel (VTWEG) associated with those materials, but this is causing problems. I am sure i am doing some join errors on this one as well. Any suggestions for this?
Vivek
2007 Jul 11 7:44 AM
Hi Vivek
Check all your join conditions???
If you are unable to connect correctly then follow this
Goto tcode SQ01
Give ur<b> QuickView</b> name then click on Create
Give <b>Title</b> comments or not mandatory
<b>Data source</b>--> Table join(select)
Select radio button Layout Mode
Press enter
Press shift+F1 or Insert Table then insert the tables u want for joining
It will automatically navigates what are the possible join conditions for both the tables
Press F3 or go back
On the left side you can see an column with all your tables selected Click on each table and select the fields which u want to display out or what are the fields required for you. Press F8 and then it will displays some warnings if there are and then press enter. Click on the Radio button ABAP list Press F8 or execute and then give your no of lines you want to display. Here is ur required output. You can create this Query in quality also directly
Reward all helpfull answers
Regards
Pavan
2007 Jul 11 12:14 PM
Thanks for the inputs, will check the same tommorow & get back with the results, till then will keep this thread open.
Regards,
Vivek
2007 Jul 12 7:04 AM
HI,
Here is the sample code to Join the 3 tables
SELECT stpo~stlnr stpo~idnrk mast~matnr mara~mtart stpo~menge
INTO CORRESPONDING FIELDS OF TABLE zmat1 FROM mast
JOIN stpo ON stpo~stlnr = mast~stlnr
JOIN mara ON mara~matnr = mast~matnr
WHERE stpo~stlty = 'M' "AND stpo~idnrk IN s_matnr
AND mast~werks = 1000.
Look at the below link also
http://www.sap-img.com/abap/inner-joins.htm
Regards
Sudheer
2007 Jul 12 9:18 AM
Hi Sudheer,
Thanks for the code, i wish to inform you, that i have just joined 3 tables i.e. MARA with RESB & MVKE. I havent written any code. The join seems to be working fine, as i am getting the output i want. I am not not an ABAPer so dont know much about the coding. I have used SQ01 to build the query. This is my first try & hope it works fine.
Thanks once again
Vivek
2007 Jul 12 9:20 AM
2007 Jul 12 10:48 AM
Hi Shahid,
I did not understand what you want to know by your posting.
Vivek