Application Development 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: 

code working in ecc 6.0 but not on 4.6c

Former Member
0 Kudos

Hi all

I have written a small sample code in 4.6c and ecc 6.0

CLASS c1 DEFINITION.

PUBLIC SECTION.

METHODS: constructor IMPORTING num TYPE i

EXCEPTIONS e,

a.

CLASS-METHODS: b.

ENDCLASS.

CLASS c1 IMPLEMENTATION.

METHOD constructor.

WRITE :num.

RAISE e.

ENDMETHOD.

METHOD a.

WRITE:/ ' instance method :a '.

ENDMETHOD.

METHOD b.

WRITE:/ ' static method: b '.

ENDMETHOD.

ENDCLASS.

START-OF-SELECTION.

PARAMETERS: p_par TYPE i.

WRITE: / ' Hi '.

DATA: obj TYPE REF TO c1.

CREATE OBJECT obj EXPORTING num = p_par

EXCEPTIONS e = 5.

CALL METHOD obj->a.

this code is running fine in ecc 6.0 but not in 4.6c, in 4.6c it is giving a dump when the statement is executed saying null reference.

could any one explain me this behaviour

Thanks & Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Technically, ECC 6.0 is 2 "technology" versions higher. Following is the terminology/version information for the last 3 ERP product versions:

SAP R/3 Enterprise (4.7x)

SAP BASIS 6.20

SAP ERP 2004

SAP NetWeaver 2004 (BASIS 6.40)

ECC 5.0

SAP ERP 2005

SAP NetWeaver 2004s (BASIS 7.00)

ECC 6.0

The main technology feature delivered with NetWeaver is the integrated J2EE engine (Web Application Server Java).

ECC stands for ERP Central Component / Enterprise Central Component, new version level of SAP R/3 ERP, the latest one as of June 2007 is ECC 6.0. They are also dubbed as SAP V5 and V6 or just SAP 5.0 or SAP 6.0. I think version transition time from ECC5 to ECC6 was too short, It seems like they just consolidated many component versioning in ECC6 with additional patches/support packages. I am sure it will be longer for (probably) ECC7 to come. I found at least 3 differences related to previous non-ECC version.

7 REPLIES 7

Former Member
0 Kudos

Technically, ECC 6.0 is 2 "technology" versions higher. Following is the terminology/version information for the last 3 ERP product versions:

SAP R/3 Enterprise (4.7x)

SAP BASIS 6.20

SAP ERP 2004

SAP NetWeaver 2004 (BASIS 6.40)

ECC 5.0

SAP ERP 2005

SAP NetWeaver 2004s (BASIS 7.00)

ECC 6.0

The main technology feature delivered with NetWeaver is the integrated J2EE engine (Web Application Server Java).

ECC stands for ERP Central Component / Enterprise Central Component, new version level of SAP R/3 ERP, the latest one as of June 2007 is ECC 6.0. They are also dubbed as SAP V5 and V6 or just SAP 5.0 or SAP 6.0. I think version transition time from ECC5 to ECC6 was too short, It seems like they just consolidated many component versioning in ECC6 with additional patches/support packages. I am sure it will be longer for (probably) ECC7 to come. I found at least 3 differences related to previous non-ECC version.

0 Kudos

hi

thanks for your reply

if we check the sap standard code in 4.6c we can observe these type of codes used frequently.these were working pretty fine

0 Kudos

Hi

I'm listing out a few differences.

1. Audit Information Support-Offers new roles that support two different business audit approaches

2. Collections Management-It is now possible to create and monitor promises to pay, to create dispute cases, and to display a detailed invoice history.

3. Credit Management: Credit Decision Support-evaluations for analyzing the credit history for a customer, and for analyzing payment or purchase behavior.

Visit this link: http://solutionbrowser.erp.sap.fmpmedia.com/

Visit this thread:

uwe_schieferstein
Active Contributor
0 Kudos

Hello Kumar

I think ECC 6.0 allows us certain statements in ABAP-OO which are not (yet) possible in 4.6c. Try to make the following change:

CREATE OBJECT obj 
  EXPORTING 
    num = p_par
  EXCEPTIONS e = 5.

CALL METHOD obj->a( ).  " add brackets !!!

Regards

Uwe

<b>PS</b>: The button "Code" above the textedit field (for entering your SDN posts) can be used to beautify coding.

0 Kudos

thanks for your response

adding brackets can be helpful if it is a protected and private method

0 Kudos

Hello Kumar

This is not correct. If it were a protected or private method you could not call at all the method outside the instance like in your coding.

Regards

Uwe

0 Kudos

Hello Uwe,

maybe the reason would be also, because:

in this example, class C1 contains an instance constructor with IMPORTING and EXCEPTIONS parameters.


  Field names    Field components
  obj            40<C1>

The constructor is terminated by an exception and object reference (points to nothing).


  Field names    Field components
  obj            0<>

The object is deleted and the referencevariable initialized.

An object reference must point to an object (an instance of a class),

before we can use it to access components (variable: "OBJ").


*---------------------------------------------------------------------*
*       CLASS c1 DEFINITION
*---------------------------------------------------------------------*
CLASS c1 DEFINITION.
  PUBLIC SECTION.
    METHODS: constructor IMPORTING num TYPE i
                         EXCEPTIONS e,
             a.
    CLASS-METHODS: b.
ENDCLASS.                    "c1 DEFINITION
*---------------------------------------------------------------------*
*       CLASS c1 IMPLEMENTATION
*---------------------------------------------------------------------*
CLASS c1 IMPLEMENTATION.

  METHOD constructor.
    WRITE : num.
    IF num > 8.         " <- new
      RAISE e.
    ENDIF.              " <- new
  ENDMETHOD. "constructor

  METHOD a.
    WRITE:/ ' instance method : a '.
  ENDMETHOD.                    "a

  METHOD b.
    WRITE:/ ' static method: b '.
  ENDMETHOD.                    "b

ENDCLASS. "c1 IMPLEMENTATION

START-OF-SELECTION.

  DATA: obj TYPE REF TO c1.

  PARAMETERS: p_par TYPE i DEFAULT 7.
  WRITE: / ' Hi '.

  CREATE OBJECT obj
    EXPORTING
      num = p_par
    EXCEPTIONS
      e = 5.

  IF sy-subrc = 5.      " <- new
    WRITE / 'Exception in constructor'.
  ELSE.
    CALL METHOD obj->a.
  ENDIF.                " <- new

Regards,
Peter