Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

code working in ecc 6.0 but not on 4.6c

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

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question