Application Development 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: 

how to call one method objects in to another method of same interface.

Former Member
0 Kudos

Interface name : IF_EX_ME_PROCESS_REQ_CUST

CLass Name : ZCL_IM_PRPO_MM_BADI_CHECK

it has two methods

PROCESS_ACCOUNT

CHECK

METHOD if_ex_me_process_req_cust~check.

LOOP AT i_items INTO l_item.

ls_item = l_item-item->get_data( ).

ENDLOOP.

endmethod.

METHOD if_ex_me_process_req_cust~process_account.

DATA: re_persistent_data1 TYPE exkn.

CALL METHOD im_account_ref->get_persistent_data

RECEIVING

re_persistent_data = re_persistent_data1.

ENDMETHOD.

QUESTION

-


re_persistent_data(process_Account) has fields sakto and PSP_PNR.

i need to acccess the field values in

Check Method.

please help me with code

Thanks

1 ACCEPTED SOLUTION

MarcinPciak
Active Contributor
0 Kudos

re_persistent_data1 is defined as local data object of method if_ex_me_process_req_cust~process_account , so all its components are accesible only within that method. If you want to access it in some other method of same class you need to make it global. You do this simply by creating an attribute re_persistent_data of this class and store the persistent data in that attribute instead of that local data.

Once its there you can access it with check method hence you are able access its components.

Regards

Marcin

5 REPLIES 5

MarcinPciak
Active Contributor
0 Kudos

re_persistent_data1 is defined as local data object of method if_ex_me_process_req_cust~process_account , so all its components are accesible only within that method. If you want to access it in some other method of same class you need to make it global. You do this simply by creating an attribute re_persistent_data of this class and store the persistent data in that attribute instead of that local data.

Once its there you can access it with check method hence you are able access its components.

Regards

Marcin

0 Kudos

could you please help me with the code please. I'm new to badi.

Thanks in advance.

0 Kudos

What Marcin is saying is go to attributes tab of the class and declare re_persistent_data1 instead of declaring inside a method so that you can access that in any method

Thanks

Bala Duvvuri

0 Kudos

Thanks marcin

Former Member
0 Kudos

got answered