Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP ABAP : getting syntax error

Former Member
0 Likes
3,973

Hi friends,

doing up gradation

there is one program in ECC 5.0, and it is working fine in ECC 5.0

But while upgrading to ECC 6.0 it is giving syntax error.

below I am sending the code.

BEGIN OF lty_s_ekab_key,                             "1001282

         konnr TYPE ekab-konnr,

         ktpnr TYPE ekab-ktpnr,

         ebeln TYPE ekab-ebeln,

         ebelp TYPE ekab-ebelp,

       END OF lty_s_ekab_key.

CLASS lcl_entity_ekab DEFINITION INHERITING

FROM lcl_entity_any.

PUBLIC SECTION.

    METHODS: constructor,

       if_any_table_mm~read_line  REDEFINITION,

       if_any_table_mm~read_lines REDEFINITION.

PRIVATE SECTION.

  METHODS prefetch

IMPORTING im_key               TYPE lty_s_ekab_key

RETURNING value(re_t_ekab)     TYPE lty_t_sorted_ekab.

ENDCLASS.

after  checking the systax error , i and getting error like lty_s_ekab_key is unknow.

Plz help me to solve in this issue.

Thanks and Regards

Rihan

18 REPLIES 18
Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,098

Can you post a screenshot of the code? It's difficult to understand in the format you have posted above.

Read only

Former Member
0 Likes
3,098

Hi Rihan,

you can use LIKE instead of TYPE. see the code below.

DATA:BEGIN OF lty_s_ekab_key,                             "1001282

         konnr TYPE ekab-konnr,

         ktpnr TYPE ekab-ktpnr,

         ebeln TYPE ekab-ebeln,

         ebelp TYPE ekab-ebelp,

       END OF lty_s_ekab_key.

CLASS lcl_entity_ekab DEFINITION INHERITING

FROM lcl_entity_any.

PUBLIC SECTION.

    METHODS: constructor,

       if_any_table_mm~read_line  REDEFINITION,

       if_any_table_mm~read_lines REDEFINITION.

PRIVATE SECTION.

  METHODS prefetch

IMPORTING im_key               LIKE lty_s_ekab_key

RETURNING value(re_t_ekab)     TYPE lty_t_sorted_ekab.

ENDCLASS.

Read only

Former Member
0 Likes
3,098

SE37 : here I have got the error

kindly solve the issue

regards,

Rihan

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
3,098

The screenshot of the FM you've shared does not show the entire code.

Read only

0 Likes
3,098

Hi Rihan,

Goto the function group of the FM and activate the entire function group.In case if the the top include or any include are not active it may not recognize the declared variables.Or may be the data type is not declared or not available.Please check.

With regards,

Read only

0 Likes
3,098

hye Naveen ,

As you said I tried to activate my Function group , but I am getting syntax error

then .

"CLASS LCL_DATABLADE_EXP_GR DEFINITION" does not have a "CLASS

LCL_DATABLADE_EXP_GR IMPLEMENTATION" statement.

How can I resolve this error.

Regards,

Rihan

Read only

0 Likes
3,098

Hi,

Does the implementation of the class exist?

If not just code it.

Regards

Dirk

Read only

0 Likes
3,098

Dear

,

How can I find that implementation class exists or not ,could you please tell

me the process for this .

Thanks

Rihan

Read only

0 Likes
3,098

Hi Rihan,

The answer to your question lies in your previous reply. That is where you are getting error.

"CLASS LCL_DATABLADE_EXP_GR DEFINITION" does not have a "CLASS

LCL_DATABLADE_EXP_GR IMPLEMENTATION" statement.

In OO ABAP, for every class which has a definition you need to have a class implementation.

You have to write the code for implementing the class(write the processing code you want in methods).

Read only

0 Likes
3,098

Dear Mr Aniket ,

here is the code ,

So where I have to implement the class , Please suggest.

CLASS lcl_datablade_exp_gr DEFINITION

                           INHERITING FROM lcl_datablade_general

                           FINAL.

  PUBLIC SECTION.

    CLASS-METHODS:

             class_constructor.

    METHODS: if_reader_mm~read_table   REDEFINITION,

             if_datablade_mm~get_label REDEFINITION,

             get_layout                REDEFINITION.

    CLASS-DATA: my_icon_red_light_1    TYPE merep_icon_status,

                my_icon_red_light_2    TYPE merep_icon_status.

ENDCLASS.  

Regards,

rihan

Read only

0 Likes
3,098

Hi Rihan,

Write the implementation just below the definition.

CLASS lcl_datablade_exp_gr DEFINITION

                           INHERITING FROM lcl_datablade_general

                           FINAL.

  PUBLIC SECTION.

    CLASS-METHODS:

             class_constructor.

    METHODS: if_reader_mm~read_table   REDEFINITION,

             if_datablade_mm~get_label REDEFINITION,

             get_layout                REDEFINITION.

    CLASS-DATA: my_icon_red_light_1    TYPE merep_icon_status,

                my_icon_red_light_2    TYPE merep_icon_status.

ENDCLASS.  

CLASS lcl_datablade_exp_gr IMPLEMENTATION.

.......write the processing logic for methods,constructors etc.

ENDCLASS.

Read only

0 Likes
3,098

Hye Mr

Aniket Zanzan,

I did the same , but now it is saying implementation is

used only once, and it is in another Include and that is not

the part of my Zfunction group .

So I suppose If i will add this include to my zfucntion group then

problem may solve , But I do not know the method how can I

add include to my Zfunction group .Please suggest .

Regards,

Rihan

Read only

0 Likes
3,098

Hi Rihan,

But I do not know the method how can I

add include to my Zfunction group .

Can you please explain what you meant by this??

Read only

0 Likes
3,098

Hi,

in the navigation treen in SE80 there should be an entry "Method Implementations" for every entry "Methods":

Regards,

Dirk

Read only

0 Likes
3,098

My Meaning is that, simple I have created my Zfunction group and there I have to

add the include which has the implementation part of the class , so How can I assign

my include to that function group , If i am going to se80 and give my Function group

and create to add include , so message occurs include already exists ,

So I have to add this include to my function group .

hope you got me .

regards,

Rihan

Read only

0 Likes
3,098

Sir

Dirk Wittenberg,

you are absolutely right , in navigation window se80 ,

there is no method implementation in my class .So how can I add method

implementation to my class so that it will appear in navigation window ,

Please suggest.

Regards,

Rihan

Read only

0 Likes
3,098

Hi,

if you want to add an existing include to a function group edit the main program of the function group and insert a line "include ...." with the name of the include.

Remark:

We really like to help here in SCN, but these questions you can answer yourself with a short look into the online help for ABAP or a bit of googling. So please do a little home work before posting these rudimentary questions here in the SCN.

Regards,

Dirk

Read only

0 Likes
3,098

Hi Rihan,

You can just write the statement in your function group.

INCLUDE <include name>.

And as Dirk said, try searching on google/SCN for these small queries like adding an include to an existing program/FG.