Application Development 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: 

URGENT

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

8 REPLIES 8

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanks for the inputs, will check the same tommorow & get back with the results, till then will keep this thread open.

Regards,

Vivek

Former Member
0 Kudos

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

0 Kudos

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

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

what is this infoset?

0 Kudos

Hi Shahid,

I did not understand what you want to know by your posting.

Vivek