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: 

How join ausp with mara

Former Member
0 Kudos

Hi expert,

I have a problem with the join between this two tables because not return nothing. Now the article have characteristic because en the transaction MM43 can be visualized. I want knwolegde if exit other object for the articles y how find. O if exist some function module and find el object that exist in the ausp table.

This is my code:

DATA : BEGIN OF T_CHAR OCCURS 0,

LVORM LIKE MARA-LVORM,

MATPOS_MARA LIKE MARA-MTPOS_MARA,

OBJEK LIKE AUSP-OBJEK,

ATINN LIKE AUSP-ATINN,

ATWRT LIKE AUSP-ATWRT,

CLASS LIKE KLAH-CLASS,

KLART LIKE KLAH-KLART,

ATNAM LIKE CABN-ATNAM,

CLINT LIKE KSSK-CLINT,

END OF T_CHAR.

DATA: P_MATNR LIKE AUSP-OBJEK.

PARAMETERS: S_MATNR LIKE MARA-MATNR.

START-OF-SELECTION.

SELECT SINGLE * FROM MARA WHERE MATNR = S_MATNR.

MOVE: MARA-MATNR TO P_MATNR.

SELECT AUSPOBJEK AUSPATINN AUSP~ATWRT INTO CORRESPONDING FIELDS OF TABLE T_CHAR

FROM MARA INNER JOIN AUSP ON AUSP~OBJEK = P_MATNR.

Thank...

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

try this......

SELECT AUSPOBJEK AUSPATINN AUSP~ATWRT INTO CORRESPONDING FIELDS OF TABLE T_CHAR

FROM MARA INNER JOIN AUSP ON AUSPOBJEK = MARAMATNR .

LOOP AT T_CHAR WHERE OBJEK IN P_MATNR.

do the necessary steps.....

ENDLOOP.

or

SELECT AUSPOBJEK AUSPATINN AUSP~ATWRT INTO CORRESPONDING FIELDS OF TABLE T_CHAR

FROM MARA INNER JOIN AUSP ON AUSPOBJEK = MARAMATNR AND MARA~MATNR in p_matrn.

hope this is helpful.....

regards,

karthik.

3 REPLIES 3

former_member186741
Active Contributor
0 Kudos

I think you need to say 'IN S_MATNR' rather than '= S_MATNR'.

also, I don't think you need a join at all...this should do:

SELECT AUSPOBJEK AUSPATINN AUSP~ATWRT INTO

CORRESPONDING FIELDS OF TABLE T_CHAR

FROM AUSP where AUSP~OBJEK = p_matnr.

Former Member
0 Kudos

hi,

try this......

SELECT AUSPOBJEK AUSPATINN AUSP~ATWRT INTO CORRESPONDING FIELDS OF TABLE T_CHAR

FROM MARA INNER JOIN AUSP ON AUSPOBJEK = MARAMATNR .

LOOP AT T_CHAR WHERE OBJEK IN P_MATNR.

do the necessary steps.....

ENDLOOP.

or

SELECT AUSPOBJEK AUSPATINN AUSP~ATWRT INTO CORRESPONDING FIELDS OF TABLE T_CHAR

FROM MARA INNER JOIN AUSP ON AUSPOBJEK = MARAMATNR AND MARA~MATNR in p_matrn.

hope this is helpful.....

regards,

karthik.

Former Member
0 Kudos

Thank for all,

I find that the field ausp-objek not is equal at mara-matnr. The objek is store in a internal objeck and is load in INOB table. I have find in first place the objeck in this table and after find the match in ausp table.

This is my code.

select single cuobj into cuobj from inob

where klart = '026'

and robtab = 'MARA'

and robjek = arti-matnr.

select single atinn into imerk from ausp

where objek = cuobj.

Thank and regards...