Skip to Content
-1
G N

EVEN AFTER DECLARING WORK AREA GETTING ERROR :Type "TY_EKPO" is unknown

DEAR EXPERTS,
COULD YOU PLEASE SUGGEST ME HOW TO FIX BELOW ERROR.

REPORT ZSP_7AM_ALV4.
TYPE-POOLS SLIS.
TABLES EKPO.
SELECT-OPTIONS S_EBEIN FOR EKPO-EBELN.
*DECLARE THE INDTERNAL TABLE
DATA : BEGIN OF TY_EKPO,
       EBELN TYPE EKPO-EBELN,
       EBELP TYPE EKPO-EBELP,
       MENGE TYPE EKPO-MENGE,
       MEINS TYPE EKPO-MEINS,
       NETPR TYPE EKPO-NETPR,
       XYZ(4)  TYPE C,
  END OF TY_EKPO.

  DATA: WA_EKPO TYPE TY_EKPO,
  IT_EKPO TYPE TABLE OF TY_EKPO.
Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on Nov 03, 2019 at 10:41 AM

    you have to use TYPES to declare TY_EKPO rather than DATA. That should fix your issue.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 03, 2019 at 10:56 AM

    You need to understand the difference between a TYPE (data type) and a VARIABLE (in ABAP, a variable is part of "data objects"):

    • a VARIABLE is a place in memory that you may change and read in your program -used to increment counters, etc.-. It is declared with DATA.
    • a TYPE declares the role of a variable, whether it's a number, a text, a structure, a table and so on. It is declared with TYPES. There are also predefined types (I, STRING, etc.) Types may also be defined externally in the ABAP Dictionary ("DDIC"), outside the program (EKPO, EKPO-EBELN, etc.)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 03, 2019 at 10:18 AM

    hi kumar kumar,

    Try this below code.

    REPORT ZSP_7AM_ALV4.
    TYPE-POOLS SLIS.
    TABLES EKPO.
    SELECT-OPTIONS S_EBEIN FOR EKPO-EBELN.
    *DECLARE THE INDTERNAL TABLE
    TYPES : BEGIN OF TY_EKPO,
           EBELN TYPE EKPO-EBELN,
           EBELP TYPE EKPO-EBELP,
           MENGE TYPE EKPO-MENGE,
           MEINS TYPE EKPO-MEINS,
           NETPR TYPE EKPO-NETPR,
           XYZ(4)  TYPE C,
      END OF TY_EKPO.
    
      DATA: WA_EKPO TYPE TY_EKPO,
      IT_EKPO TYPE TABLE OF TY_EKPO.

    Cheers,

    Prasanna CD

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 03, 2019 at 10:35 AM
    -2

    Hi Prasanna,

    i dint find any difference between your code and my code but i tried your code also but getting same error.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.