Application Development and Automation 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: 
Read only

SQVI : JoinTable ::::::

Former Member
0 Likes
756

Hello Experts ,

I want to create a report with MBLNR as input BUDAT

Using tables MKPF & MSEG i want to out put

1.MKPF-MBLNR

2.USNAM-MBLNR

3.BWART-MSEG

4LGORT-MSEG

The key to lik the two tables would be MBLNR

Can u pls tell me step by step procedure to do this ??

Regards

Anis

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
732

Hello,

In SQVI->Click 'Create Query' button with Query Name. Input data source as 'Table Join'. In the Data source editor, add tables MKPF and MSEG. The links for MBLNR and MJAHR will be created automatically. Press Back arrow and go to 'List field selection' and 'Selection Fields' tabs and pick the fields. Then save the Query and now you are ready to execute Query.

Thanks,

Venu

Hello Experts ,

I want to create a report with MBLNR as input BUDAT

Using tables MKPF & MSEG i want to out put

1.MKPF-MBLNR

2.USNAM-MBLNR

3.BWART-MSEG

4LGORT-MSEG

The key to lik the two tables would be MBLNR

Can u pls tell me step by step procedure to do this ??

Regards

Anis

3 REPLIES 3
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
732

Hello Anis,

Type INNER JOIN in your SE38 editor & do an F1, you will get an SAP help documentation for INNER JOIN.

There is an example. Easy, isnt it !!

BR,

Suhas

Read only

Former Member
0 Likes
733

Hello,

In SQVI->Click 'Create Query' button with Query Name. Input data source as 'Table Join'. In the Data source editor, add tables MKPF and MSEG. The links for MBLNR and MJAHR will be created automatically. Press Back arrow and go to 'List field selection' and 'Selection Fields' tabs and pick the fields. Then save the Query and now you are ready to execute Query.

Thanks,

Venu

Read only

Former Member
0 Likes
732

Hi Anis,

Try it this way:

select mblnr usnam                  
    from mkpf
    into table t_mkpf
   where budat in s_date.               " Compare Posting Date with Date

  if t_mkpf is not initial.

    select mblnr                  " Number of Material Document
             bwart
             lgort
      into table t_mseg
       for all entries in t_mkpf       " For all Material Document
     where mblnr eq t_mkpf-mblnr.

    if sy-subrc ne 0.
      message: i007.
    endif.                           
  endif.