‎2006 Sep 13 9:00 PM
I have a class I defined with some public class attributes. I have an internal table defined. When I go to test the class I get an error
"Syntax Error in test"
"Display Generated test environment?"
When I say yes it presents an ABAP program
"%_JJ_TESTFRAME_CLASS" that syntax checks with some error on code that is using my table name.
The Class activates fine and as soon as I take out the reference to the table I can test again with no problems.
Anyone know why an internal table defined in a public class would cause such an error?
The type of "OBJECT-FAILED_STEPS" cannot be converted to the type of
"ZCLDW_ALERTS2=>FAILED_STEPS".
CLASS ZCLDW_ALERTS2 DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
*"* public components of class ZCLDW_ALERTS2
*"* do not include other source files here!!!
PUBLIC SECTION.
CLASS-DATA STARTING_TIMESTAMP TYPE RSTIMESTMPL .
CLASS-DATA FAILED_STEPS TYPE STANDARD TABLE OF ZBILOG .
CLASS-METHODS GET_LAST_TIME_STAMP
IMPORTING
VALUE(BEG_DATE) TYPE SYDATUM
VALUE(BEG_TIME) TYPE SYUZEIT
EXPORTING
!STARTING_TIMESTAMP TYPE RSTIMESTMPL .
‎2006 Sep 13 9:13 PM
Hello Kenneth
If you want to define your own types (including itab's) you have to use the TYPES section of the class (push button "TYPES").
These types are, of course, private. Thus, you cannot use your private types with public class attributes.
I would recommend to define a table type having line structure ZBILOG.
Regards
Uwe
‎2006 Sep 13 9:13 PM
Hello Kenneth
If you want to define your own types (including itab's) you have to use the TYPES section of the class (push button "TYPES").
These types are, of course, private. Thus, you cannot use your private types with public class attributes.
I would recommend to define a table type having line structure ZBILOG.
Regards
Uwe
‎2006 Sep 13 9:31 PM
> I would recommend to define a table type having line
> structure ZBILOG.
>
> Regards
> Uwe
That's just wrong! But it works...
Thanks!