cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Instance method access error from program

former_member314998
Participant
0 Kudos
1,330

Hi Experts,

I am getting below error while accessing instance method get_crequest_step of class CL_USMD_WF_SERVICE.

Please find below my code and error.

DATA: g_cl TYPE REF TO cl_usmd_wf_service.

CREATE OBJECT g_cl.

SELECT * FROM usmd120c INTO TABLE lt_sla WHERE usmd_data_active NE 'X' AND usmd_creq_status NE '06'.

LOOP AT lt_sla INTO wa_sla.

CLEAR : lv_crequest.

lv_crequest = wa_sla-usmd_crequest.

CALL METHOD g_cl->get_crequest_step

EXPORTING

id_crequest = wa_sla-usmd_crequest

IMPORTING

ed_step = lv_step.

ENDLOOP.

ERROR.

An instance of the class "CL_USMD_WF_SERVICE" cannot be created outside the class. .

View Entire Topic
DoanManhQuynh
Active Contributor

since this class dont have contructor method you cant creat object as usual, you should create class like this:

g_cl = cl_usmd_wf_service=>get_instance( ).
former_member314998
Participant
0 Kudos

Thanks, it's resolved.