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: 

SAP Query join statements

Former Member
0 Kudos

Hello,

I am working on SAP Query in infoset I want to link the MVKE-MATNR to DRAD-OBJKY,

but the length of the two fields are different. So the Query is not allowing the join. Hw can I over come the issue.

Note. One material will have multiple docments.

Thanks,

Ravi.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can change join condition when automatic join is proposed.

6 REPLIES 6

Former Member
0 Kudos

You can change join condition when automatic join is proposed.

0 Kudos

Hello,

No automatic join is proposed i am manually joining hte 2 tables MVKE-MATNR to DRAD-OBJKY

Thanks,

Ravi

Former Member
0 Kudos

I am not sure how you are using, generally in this case we will have one more field with the equal length of target table field and we will move the values of the source table field to the additional field in source table. Then we will compare the source table additional field with target field.

Former Member
0 Kudos

Hi Ravi,

There is alternative method.You can use this.

1.First you can fetch the data into a internal table suppose it1 based on the MATNR in MVKE .

2.Then, fetch the data into a internal table it2 based on OBJKY in DRAD.

3. Then fill the fill the data in a final internal table suppose it_final from it1 and it2 using READ TABLE WITH KEY (the key field is the link between two tables MVKE and DRAD) looping in it1 and move the line item into it_final that matches the condition.

Hope it will solve your problem.

With Best Regards,

Pulak.

0 Kudos

I am using SAP Query how can I collect the data into final internal table.

Thanks,

Ravi

0 Kudos

Hi,

Define the final internal table with the fileds of the both internal table it1 and it2.

the programming logic is like as following.

Loop at it1 with every line item.

move line item of it1(work area) into it_final.

read table it2 with key wa_key (the same primary key field in any table it1 and it2).

move line item of it2(work area) into it_final.

endloop.

try this to fill the it_final like this.

regards,

Pulak.