‎2006 Nov 22 3:47 AM
Hello All,
I have the following code:
DATA: Begin of structure,
fld1,
fld2,
fld3,
end of structure.
DATA: tab1 like structure occurs 0 with header line,
tab2 like structure occurs 0 with header line.
DATA: struc1 like structure,
struc2 like structure.
Class cls DEFINITION.
PUBLIC section.
METHODS.
---
---
---
ENDCLASS.
class implementation.
method.
loop at tab1 into struc1
.......
endloop.
endmethod.
The code is syntactically correct and has been activated. IN the above, when I double click on tab1 it is not going to its definition, but instead throws an error message saying that the object struc1 is not found.
This is the case when I double click the tab1 inside method-endmethod.
Outside the method-endmethod, it goes directly to its definition in DATA declaration.
Any suggestions to avoid this?
Thanks
M A
‎2006 Nov 22 4:34 AM
Please try this.
*---------------------------------------------------------------------*
* CLASS cls DEFINITION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
class cls definition.
public section.
types: begin of structure.
include type zstruc. "<----
types: upd_ind(1) type c, "<----
cellio_tab type lvc_t_styl,
linecolor(4) type c,
end of structure.
endclass.
*---------------------------------------------------------------------*
* CLASS implementation DEFINITION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
class cls implementation.
endclass.
Regards,
Rich Heilman
‎2006 Nov 22 3:50 AM
Hi,
Declare the tab1 in the class definition..
Probably you cannot use global internal tables inside the class...
Thanks,
Naren
‎2006 Nov 22 3:53 AM
Try putting the DATA statements inside you class definition under the PUBLIC SECTION. You will need to define like so.
Types: Begin of structure,
fld1,
fld2,
fld3,
end of structure.
DATA: tab1 type table of structure,
tab2 type table of structure,
DATA: struc1 like line of tab1,
struc2 like line of tab2.
Regards,.
Rich Heilman
‎2006 Nov 22 4:28 AM
Thanks for your solution.
The structure definition which iam using is as follows:
DATA: BEGIN OF structure.
INCLUDE STRUCTURE zstruc.
DATA: upd_ind TYPE c,
cellio_tab TYPE lvc_t_styl,
linecolor(4) TYPE c,
END OF structure.
Now, when this is placed inside PUBLIC SECTION, we need to use TYPES.
I have taken like this:
TYPES: BEGIN OF structure.
INCLUDE STRUCTURE zstruc.
TYPES: upd_ind TYPE c,
cellio_tab TYPE lvc_t_styl,
linecolor(4) TYPE c,
END OF structure.
But still I am getting errors. Hope the second TYPES declared above is wrong.
Please suggest.
Thanks
M A
‎2006 Nov 22 4:34 AM
Please try this.
*---------------------------------------------------------------------*
* CLASS cls DEFINITION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
class cls definition.
public section.
types: begin of structure.
include type zstruc. "<----
types: upd_ind(1) type c, "<----
cellio_tab type lvc_t_styl,
linecolor(4) type c,
end of structure.
endclass.
*---------------------------------------------------------------------*
* CLASS implementation DEFINITION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
class cls implementation.
endclass.
Regards,
Rich Heilman
‎2006 Nov 22 4:36 AM
Hi,
Try this..
TYPES: BEGIN OF structure,
ztable type <b>zstruc</b>,
upd_ind type char1,
cellio_tab TYPE lvc_t_styl,
linecolor(4) TYPE c,
END OF structure.
Thanks,
Naren
‎2006 Nov 22 4:50 AM
Thanks Narendran and Rich.
I have already put the code which u both have sent. But still I am getting errors like:
"Explicit length specifications are necessary with types C, P, X, N undW in the OO context".
What modifications are to be done here. PLease suggest.
Thanks
M A
‎2006 Nov 22 4:54 AM
Yeah
I have got it.
I have specified the length of upd_id. And now its taking.
Anyways, Thanks a lot to all of you.
MA
‎2006 Nov 22 6:49 AM
HI,
i suggest used in this way
TYPES BEGIN OF structure.
include structure zstruc.
types: upd_ind type char1.
tcellio_tab TYPE lvc_t_styl,
linecolor(4) TYPE c,
END OF structure.
now structure is a flat one.