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: 

SQ01-query - how to join MARA and DRAD

Former Member
0 Kudos

Hi all,

my problem is that I have to create a sq01 query in which I combine data from the MARA

with data from DRAD. But I can't join the OBJKY (DRAD) with the MATRN (MARA).

Hoping for help,

Barbara

1 ACCEPTED SOLUTION

Former Member
0 Kudos

you cannot. the field object-key contains the id of whatever object is linked to a document, this is not necessarily a material number ... that's why the infoset will reject your join.

tell me what you want to accomplish, perhaps we'll find another way.

4 REPLIES 4

Former Member
0 Kudos

you cannot. the field object-key contains the id of whatever object is linked to a document, this is not necessarily a material number ... that's why the infoset will reject your join.

tell me what you want to accomplish, perhaps we'll find another way.

0 Kudos

Hello,

isn't there another table which includes object key and material number?

As I already mentioned I need to combine the material number of MARA,

another Z-field of MARA with the document number of DRAD.

Any idea how I can solve this?

Kind regards,

Barbara

0 Kudos

Hi Barbara,

As mentioned in the previous post, you cannot join the OBJKY field with MATNR field of MARA.

But if you want to just read the contents in OBJKY from DRAD, then have a look at the below code:

Note: In the initial step of creating your infoset, just select direct read from table & select on MARA here.

SELECT SINGLE DOKNR INTO T_DOKNR

FROM DRAD

WHERE OBJKY EQ MARA-MATNR

AND DOKOB EQ 'MARA'

AND DOKAR EQ (Specify the type of document for this).

Now you can combine the fields MATNR, T_DONR & the Z field into the field which you want using the CONCATENATE statement.

\[removed by moderator\]

Regards,

Vivek

Edited by: Jan Stallkamp on Sep 3, 2008 3:51 PM

Former Member
0 Kudos

Hi,

I am facinfg the same problem.

Did you find a solution for this problem.

In SQ00 or just in an ABAP-Program?

Thanx