Skip to Content
0
Former Member
Jul 03, 2006 at 05:43 AM

Output of the program

22 Views

Hi,

I wrote a program to retrieve data from three different master data tables but not getting the desired output. The output comes all in zeroes.

Can anyone tell me where am I going wrong?

Here is the code-

REPORT ZREPORT1 .

Tables: PA0002, PA0008, PA0015.

data : begin of itab occurs 0,

CLIENTNO LIKE PA0002-MANDT,

ENAME TYPE PA0002-CNAME,

ESAL TYPE PA0008-ANSAL,

OT TYPE PA0015-BETRG,

ENO LIKE PA0002-PERNR,

END OF ITAB.

SELECT A~CNAME

A~PERNR

A~MANDT

B~ANSAL

B~PERNR

C~BETRG

C~PERNR

INTO CORRESPONDING FIELDS OF TABLE itab

FROM ( PA0002 AS A INNER JOIN PA0008 AS B

ON APERNR = BPERNR )

INNER JOIN PA0015 AS C

ON BPERNR = CPERNR

WHERE A~MANDT = 800.

LOOP AT itab.

WRITE: / ITAB-CLIENTNO, 25 ITAB-ESAL ,45 ITAB-OT.

ENDLOOP.