Go on link..

link us with ...

Monday, December 13, 2010

Report is use ful to left joined two table

*&---------------------------------------------------------------------*
*& Report ZTR_DEMO_REPORT5 *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*

REPORT ZTR_DEMO_REPORT5 .



tables : yemp , ysal .


TYPES : BEGIN OF ST_JOIN ,

EMP_NO LIKE YEMP-EMP_NO ,
EMP_NAME LIKE YEMP-EMP_NAME,
SALARY LIKE YSAL-SALARY,
SALARY_UNIT LIKE YSAL-SALARY_UNIT,

END OF ST_JOIN .



DATA : WA_JOIN TYPE ST_JOIN .

DATA : IT_JOIN LIKE STANDARD TABLE OF WA_JOIN .




select e~EMP_NO
E~EMP_NAME
S~SALARY
S~SALARY_UNIT
FROM YEMP AS E INNER JOIN YSAL AS S
ON E~EMP_NO EQ S~EMP_NO
INTO TABLE IT_JOIN .


write :/5 'Inner JOIN' color 5 .

skip 3 .

LOOP AT IT_JOIN INTO WA_JOIN .

WRITE :/5 WA_JOIN-EMP_NO ,
20 WA_JOIN-EMP_NAME,
45 WA_JOIN-SALARY,
60 WA_JOIN-SALARY_UNIT.

ENDLOOP.

FREE : IT_JOIN .


skip 5 .


select e~EMP_NO
E~EMP_NAME
S~SALARY
S~SALARY_UNIT
FROM YEMP AS E LEFT OUTER JOIN YSAL AS S
ON E~EMP_NO EQ S~EMP_NO
INTO TABLE IT_JOIN .


BREAK-POINT.


write :/5 'Left OUTER JOIN' INVERSE color 5.

skip 2 .
LOOP AT IT_JOIN INTO WA_JOIN .

WRITE :/5 WA_JOIN-EMP_NO ,
20 WA_JOIN-EMP_NAME,
45 WA_JOIN-SALARY,
60 WA_JOIN-SALARY_UNIT.

ENDLOOP.

No comments:

link us...

For Visitors

if you want to publish or Add something on ERP, SAP , SAP FUNCTIONAL, SAP ABAP then mail us along with your email-id. contain must be yours

email-id :- avinashkr_raj@yahoo.com(any email)

email-id :- avinaskr_raj.abap@blogger.com ( use only gmail)