Skip to Content
0
Jun 01, 2017 at 06:27 AM

No Component exist with the name EBELN

2956 Views

I am creating a Interactive Report with the get cursor but the error occurs 'no compenent exists with 'ebeln', I have declared the internal table also.

I think some silly mistake is there in select query using outer join.

TYPES: BEGIN OF wat,
LIFNR TYPE LFA1-LIFNR,
NAME1 TYPE LFA1-NAME1,
EBELN TYPE EKKO-EBELN,
END OF wat.


DATA: itab TYPE SORTED TABLE OF wat
WITH NON-UNIQUE KEY LIFNR,
wa_wat type wat.


DATA : IT_EKKO TYPE TABLE OF EKKO,
WA_EKKO TYPE EKKO,
IT_EKPO TYPE TABLE OF EKPO,
WA_EKPO TYPE EKPO,
IT_LFA1 TYPE TABLE OF LFA1,
WA_LFA1 TYPE LFA1.
DATA : FNAM(30), FVAL(50).

SELECT-OPTIONS : S_EBELN FOR WA_EKKO-EBELN.

INITIALIZATION.

AT SELECTION-SCREEN.
PERFORM VALIDATE_INPUT.

START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM DISPLAY_DATA.

TOP-OF-PAGE.
PERFORM DISPLAY_TOPOFPAGE.

AT LINE-SELECTION.
PERFORM DISPLAY_SECONDARYLIST.

TOP-OF-PAGE DURING LINE-SELECTION.
PERFORM LINE_TOPOFPAGE.
FORM VALIDATE_INPUT .

IF S_EBELN IS INITIAL.
MESSAGE 'Enter Purchasing Document Number' TYPE 'E'.
ENDIF.
ENDFORM. " VALIDATE_INPUT

FORM GET_DATA .
SELECT s~LIFNR s~NAME1 p~EBELN
INTO CORRESPONDING FIELDS OF TABLE itab
FROM LFA1 AS s
LEFT OUTER JOIN EKKO AS p ON s~EBELN = p~EBELN.
ENDFORM. " GET_DATA

FORM DISPLAY_DATA .
LOOP AT itab INTO WA_wat.
WRITE:/ WA_LFA1-LIFNR, WA_LFA1-NAME1, WA_EKKO-EBELN.
ENDLOOP.
ENDFORM. " DISPLAY_DATA

FORM DISPLAY_SECONDARYLIST .
GET CURSOR FIELD FNAM VALUE FVAL.
CONDENSE FNAM.
CONDENSE FVAL.
IF FNAM = 'WA_LFA1-lifnr'.
SELECT SINGLE * FROM LFA1 INTO WA_LFA1 WHERE LIFNR = FVAL .
WRITE:/ WA_LFA1-lifnr, WA_LFA1-NAME1, WA_LFA1-ORT01, WA_LFA1-STRAS, WA_LFA1-ERNAM, WA_LFA1-KUNNR, WA_LFA1-SPRAS.

ELSEIF FNAM = 'WA_EKKO-EBELN'.
SELECT * FROM EKKO INTO TABLE IT_EKKO UP TO 50 ROWS WHERE EBELN = FVAL.
LOOP AT IT_EKKO INTO WA_EKKO.
WRITE:/ WA_EKKO-EBELN, WA_EKKO-BUKRS, WA_EKKO-BSART , WA_EKKO-ERNAM , WA_EKKO-LIFNR.
ENDLOOP.
ENDIF.


ENDFORM. " DISPLAY_SECONDARYLIST
FORM DISPLAY_TOPOFPAGE .
WRITE:/ 'Vendor Details' COLOR 3.
ENDFORM. " DISPLAY_TOPOFPAGE
FORM LINE_TOPOFPAGE .
IF FNAM = 'WA_LFA1-LIFNR'.
WRITE:/ 'Vndor details ', WA_LFA1-LIFNR COLOR 5.
ELSEIF FNAM = 'WA_EKKO-EBELN'.
WRITE:/ 'Purchasing Document Details ', WA_EKKO-EBELN COLOR 5.
ENDIF.
ENDFORM. " LINE_TOPOFPAGE