‎2012 Nov 06 7:05 AM
Dear Experts,
I am trying to call a method with the help of interface IF_UJA_APPSET_DATA->GET_PARAM_VALUE
called this below interface in ma program but i am getting catch as
1) An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handled locally, nor declared in a RAISING clause
2) Dereferencing the NULL reference
i have pasted my code for reference. actually my code is not executing at all.. its not going inside the class to test.
Kindly advice how to proceed further.
why this is going for exception.how to rectify that?
Data: lo_app_Set type ref to if_uja_appset_data,
l_appl_param type string
CALL METHOD lo_app_Set->GET_PARAM_VALUE
EXPORTING
I_TYPE = 'SYSTEM'
I_PARAM_NAME = 'RTRCT_CC_COST_DEST'
RECEIVING
R_VALUE = l_appl_param.
‎2012 Nov 06 8:10 AM
Whatever you have written is wrong.if_uja_appset_data is an interface, there is no object reference to the implementing class. Which class implements if_uja_appset_data~ GET_PARAM_VALUE ?
Consider the below sample for example and correct it yourself.
data: lo_app_set type ref to if_ex_mb_document_badi,
l_appl_param type string.
data mk type ty_t_mkpf.
data ms type ty_t_mseg.
data et type ty_t_vm07m.
create object lo_app_set type cl_exm_im_mb_document_badi.
call method lo_app_set->mb_document_update
exporting
xmkpf = mk
xmseg = ms
xvm07m = et.
‎2012 Nov 06 7:25 AM
Hiii,
If you read error it clearly indicates you NULL reference means lo_app_Set reference variable is not initialize .and if you want to handle it use exception handling with TRY CATCH block .
http://help.sap.com/saphelp_470/helpdata/en/a9/b8eef8fe9411d4b2ee0050dadfb92b/content.htm
‎2012 Nov 06 8:10 AM
Whatever you have written is wrong.if_uja_appset_data is an interface, there is no object reference to the implementing class. Which class implements if_uja_appset_data~ GET_PARAM_VALUE ?
Consider the below sample for example and correct it yourself.
data: lo_app_set type ref to if_ex_mb_document_badi,
l_appl_param type string.
data mk type ty_t_mkpf.
data ms type ty_t_mseg.
data et type ty_t_vm07m.
create object lo_app_set type cl_exm_im_mb_document_badi.
call method lo_app_set->mb_document_update
exporting
xmkpf = mk
xmseg = ms
xvm07m = et.
‎2012 Nov 06 9:40 AM
Before you can use an instance, you must instantiate it - either through a factory method or via CREATE OBJECT.