05-28-2008 6:45 AM
Hi Experts,
I want to change the User Status in Real Estate contract ( TCODE: RECN) when the user press the SAVE button. Now I get a BADI definition RECN_CONTRACT and implement it in an implementation YCL_IM_RECN_CONTRACT . It seems that the method CHECK_ALL can meet my requirement. But I don't know to to process the next step. Do any friends can provide me a sample for this requirement?? Or do you havr other user exit/Badi can meet my requirement? Thanks in advance.
Best Regards
Joe
05-28-2008 7:37 AM
first go for a trace...through ST05
trace after pressing the save button..u will get the list of badi name..find which badi is suitable for u Req.and implementthat badi.
CL_EXITHANDLER keep break point in this class...u can c all the badi name.....
if it is usefull Plz reward
regards
Anbu
05-28-2008 8:50 AM
Hi Anbu
Thanks for your kindness.
I had got the proper badi definition ( RECN_CONTRACT ) before. I have try to implement the badi in my implementation YCL_IM_RECN_CONTRACT and below is my example codes. It can update the user status when the SAVE button is pressed. My example codes are below:
METHOD if_ex_recn_contract~check_all.
DATA:
cl_recn_contract TYPE REF TO cl_recn_contract.
DATA: r_status_mngr TYPE REF TO if_reca_status_mngr.
DATA: lv_status_profile TYPE j_stsma.
DATA: lt_status TYPE re_t_status,
ls_status TYPE LINE OF re_t_status.
DATA: r_message TYPE REF TO if_reca_message_list.
cl_recn_contract ?= io_object.
CHECK if_before_store = 'X'.
CALL METHOD cl_recn_contract->if_reca_has_status~mo_status_mngr->get_current_status
IMPORTING
ed_status_scheme = lv_status_profile
et_status = lt_status.
lv_status_profile = 'ZBCIA01'.
CALL METHOD cl_recn_contract->if_reca_has_status~mo_status_mngr->set_status_profile
EXPORTING
id_status_profile = lv_status_profile.
READ TABLE lt_status INTO ls_status INDEX 2.
ls_status-stat = 'E0001'.
ls_status-inact = ''.
MODIFY lt_status FROM ls_status INDEX 2.
CALL METHOD cf_reca_message_list=>create
RECEIVING
ro_instance = r_message.
CALL METHOD cl_recn_contract->if_reca_has_status~mo_status_mngr->set_status
EXPORTING
it_status = lt_status
if_only_user_status = 'X'
io_msglist = r_message.
REFRESH lt_status.
ENDMETHOD.