Application Development and Automation 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: 
Read only

Method throwing catch - IF_UJA_APPSET_DATA->GET_PARAM_VALUE

Former Member
0 Likes
466

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.

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
432

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.

datalo_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.

3 REPLIES 3
Read only

Aashish28
Contributor
0 Likes
432

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

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
433

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.

datalo_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.

Read only

matt
Active Contributor
0 Likes
432

Before you can use an instance, you must instantiate it - either through a factory method or via CREATE OBJECT.