Skip to Content
0
Former Member
Aug 02, 2012 at 07:18 AM

left outer join for lips and vbap tables

257 Views

Dear all;

I want to generate a report that shows me the whole content for the fileds:

LIPS-LFIMG

LIPS-KDAUF

VBAP-KWMENG

This is how my code looks like:

==================================================================================================================

REPORT ZDEMO_SELECT_LEFT_OUTER_JOIN2.

DATA: BEGIN OF wa,

LFIMG TYPE LIPS-LFIMG,

KDAUF TYPE LIPS-KDAUF,

KWMENG TYPE VBAP-kwmeng,

END OF wa,

itab LIKE SORTED TABLE OF wa WITH NON-UNIQUE KEY LFIMG KDAUF KWMENG.

SELECT p-LFIMG p-KDAUF f-kwmeng INTO CORRESPONDING FIELDS OF TABLE ITAB FROM LIPS AS q left OUTER JOIN VBAP AS f

ON q-vbeln = f-vbeln.

LOOP AT itab INTO wa.

WRITE: / wa-LFIMG, wa-KDAUF, wa-KWMENG.

ENDLOOP.

==================================================================================================================

when I check it, it gives me the following error:

files q-vbeln unknown

can you tell me please what is wrong with my code, and how can get the data from these two tables generated in a report.

I guess the connection condition between the two tables has be corrected

Best Regards

~Amal Aloun