Skip to Content
author's profile photo Former Member
Former Member

URGENT

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 12, 2007 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 11:14 AM

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

    Regards,

    Vivek

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.