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

Problem with OO ABAP

Former Member
0 Likes
649

Hi there. I've got a CONTAINER object in the screen and a piece of code


report ZWOP_TEST2 .

TYPE-POOLS: GFW .

DATA: retval type symsgno .

CLASS cl_gui_cfw DEFINITION LOAD .
CLASS cl_gfw_mux DEFINITION LOAD .
CLASS cl_gfw DEFINITION LOAD .

**** activate mux (handling of external graphics and synchronizations)
CALL METHOD cl_gfw_mux=>activate IMPORTING retval = retval .
IF retval <> cl_gfw=>ok .
  CALL METHOD cl_gfw=>show_msg EXPORTING msgno = retval .
ENDIF .

CALL SCREEN '1000' .

* data container
INCLUDE gfw_dc_pres.


*&---------------------------------------------------------------------*
*&      Module  STATUS_1000  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE STATUS_1000 OUTPUT.
   SET PF-STATUS '1000'.
*  SET TITLEBAR 'xxx'.
ENDMODULE.                 " STATUS_1000  OUTPUT


*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_1000  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_1000 INPUT.
  CASE sy-ucomm .
    WHEN 'EXIT' .
      LEAVE TO SCREEN 0 .
  ENDCASE .
ENDMODULE.                 " USER_COMMAND_1000  INPUT

Warnings

1) INCLUDE GFW_DC_PRES

In the constructor method, you can only access instance attributes after the constructor of the superclass (SUPER->CONSTRUCTOR) has been called.

2) INCLUDE GFW_DC_PRES

The CONSTRUCTOR of the super class must be called even if it does not yet exists

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
407

Hello Pjotr

I assume you are working on SAP release < ECC 6.0 because there you will find the following implementation of the CONSTRUCTOR method (class lcl_dc_pres):


*---------------------------------------------------------------------*
*       CLASS lcl_dc_pres IMPLEMENTATION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
class lcl_dc_pres implementation.

******
* **** CONSTRUCTOR
******
  method constructor.
    data: offset        type i,
          single_offset type ty_offset.

    call method super->constructor.

    clear data.
* set my version
...

The two warnings are related to each other. I guess that the method call super->constructor does not exist in the implementation of the CONSTRUCTOR method on your system.

Neither extended syntax check nor the code inspector give any of the mentioned warnings on ECC 6.0.

Regards

Uwe

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
408

Hello Pjotr

I assume you are working on SAP release < ECC 6.0 because there you will find the following implementation of the CONSTRUCTOR method (class lcl_dc_pres):


*---------------------------------------------------------------------*
*       CLASS lcl_dc_pres IMPLEMENTATION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
class lcl_dc_pres implementation.

******
* **** CONSTRUCTOR
******
  method constructor.
    data: offset        type i,
          single_offset type ty_offset.

    call method super->constructor.

    clear data.
* set my version
...

The two warnings are related to each other. I guess that the method call super->constructor does not exist in the implementation of the CONSTRUCTOR method on your system.

Neither extended syntax check nor the code inspector give any of the mentioned warnings on ECC 6.0.

Regards

Uwe

Read only

Former Member
0 Likes
407

i think problem is with version below ECC5.0, inversion 5.00 is does not showing any warning message.

The given program activated with out any warning or error messages.

Check system version.