2013 Jan 25 9:49 AM
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
2013 Jan 25 10:01 AM
Can you post a screenshot of the code? It's difficult to understand in the format you have posted above.
2013 Jan 25 10:07 AM
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.
2013 Jan 25 10:10 AM
SE37 : here I have got the error
kindly solve the issue
regards,
Rihan
2013 Jan 25 10:13 AM
The screenshot of the FM you've shared does not show the entire code.
2013 Jan 25 10:19 AM
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,
2013 Jan 25 10:31 AM
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
2013 Jan 25 11:01 AM
Hi,
Does the implementation of the class exist?
If not just code it.
Regards
Dirk
2013 Jan 28 5:49 AM
Dear
How can I find that implementation class exists or not ,could you please tell
me the process for this .
Thanks
Rihan
2013 Jan 28 6:13 AM
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).
2013 Jan 28 6:20 AM
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
2013 Jan 28 6:26 AM
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.
2013 Jan 28 7:04 AM
Hye Mr
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
2013 Jan 28 7:20 AM
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??
2013 Jan 28 8:05 AM
Hi,
in the navigation treen in SE80 there should be an entry "Method Implementations" for every entry "Methods":
Regards,
Dirk
2013 Jan 28 8:14 AM
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
2013 Jan 28 8:23 AM
Sir
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
2013 Jan 28 8:39 AM
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
2013 Jan 28 8:56 AM
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.