Skip to Content
0
Former Member
Jul 11, 2007 at 06:44 AM

regarding joins

119 Views

hi experts,

i am sending you the code.i have used the following join conditions.but it is not fetching any data.plz check it once.make the corrections if required or suggest me what else i can do...

PARAMETER CMP_CD LIKE BKPF-BUKRS.

SELECT-OPTIONS VENDOR FOR BSIK-LIFNR.

SELECT-OPTIONS P_DATE FOR BKPF-BUDAT.

DATA: BEGIN OF STRUCT,

BELNR LIKE VBRK-BELNR,

LIFNR LIKE BSIK-LIFNR,

BUDAT LIKE BKPF-BUDAT,

VBELN LIKE VBRK-VBELN,

ORT01 LIKE LFA1-ORT01,

ORT02 LIKE LFA1-ORT02,

PSTLZ LIKE LFA1-PSTLZ,

STRAS LIKE LFA1-STRAS,

END OF STRUCT.

DATA ITAB LIKE STRUCT OCCURS 0 WITH HEADER LINE.

AT SELECTION-SCREEN.

CASE SY-UCOMM.

WHEN ' '.

SELECT AVBELN BLIFNR ABELNR CBUDAT DORT01 DORT02 DPSTLZ DSTRAS

INTO CORRESPONDING FIELDS OF TABLE ITAB

FROM BKPF AS C INNER JOIN VBRK AS A ON ( CBUKRS = ABUKRS ) AND (

CBELNR = ABELNR ) INNER JOIN BSIK AS B ON ( ABUKRS = BBUKRS ) AND (

ABELNR = BBELNR ) INNER JOIN LFA1 AS D ON ( BLIFNR = DLIFNR )

WHERE CBUDAT IN P_DATE AND BLIFNR IN VENDOR AND C~BUKRS = CMP_CD.

regards,

raman