cancel
Showing results for 
Search instead for 
Did you mean: 

Getting error "Access via null" when running the web dynpro application

Former Member
0 Kudos

Hi experts,

I am getting the below error while executing my web dynpro application

500 SAP Internal Server Error

ERROR: Access via 'NULL' object reference not possible. (termination: RABAX_STATE)

I am getting the error only when I am calling a method create manufacturer from my web dynpro program. If i comment this code my application works fine

CALL METHOD wd_this->mo_ch_instance->create_manufacturer

EXPORTING

gi_manufacturer = ls_manufacturer

IMPORTING

lv_message = lv_status

.

i have created a attribute mo_ch_instance of type YSRM70CL_CH_SW_MD where YSRM70CL_CH_SW_MD is the class which has the create_manufacturer method that i am using in my code.

Kindly let me know whats the issue.

Regards,

Vinod

Accepted Solutions (1)

Accepted Solutions (1)

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

The object is not instantiated so you are getting that error.

use the below code.

data:mo_ch_instance type ref to YSRM70CL_CH_SW_MD .

create object mo_ch_instance.

CALL METHOD wd_this->mo_ch_instance->create_manufacturer

EXPORTING

gi_manufacturer = ls_manufacturer

IMPORTING

lv_message = lv_status

Regards,

Priya

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

The object is not instantiated so you are getting that error.

use the below code.

data:mo_ch_instance type ref to YSRM70CL_CH_SW_MD .

create object mo_ch_instance.

CALL METHOD mo_ch_instance->create_manufacturer

EXPORTING

gi_manufacturer = ls_manufacturer

IMPORTING

lv_message = lv_status

Regards,

Priya

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi All,

Issue solved. Thanks for the help

Regards,

VInod

Former Member
0 Kudos

hi ,

do it like classname->mrthod name , specifically in ur case


CALL METHOD YSRM70CL_CH_SW_MD->create_manufacturer

regards,

amit

Former Member
0 Kudos

Hi,

Replace the code with the below mentioned code.

CALL METHOD mo_ch_instance->create_manufacturer

EXPORTING

gi_manufacturer = ls_manufacturer

IMPORTING

lv_message = lv_status

.

Hope it works.

Regards

Shruti