Hello experts,
I want to refresh my HTML container from the button in HTML. I am having 2 methods 1 is to print HTML in container and another is ON_HTML_EVENT in which i call the first method to refresh the container. As i press Save button of HTML it goes into infinite loop. i tried method do_refresh but this method works for the one time and then it again goes into the loop at RAISE SAPEVENT. How should i clear the raised event flags ??
Please find the code below. Thanks in advance.
CLASS lcl_class IMPLEMENTATION.
METHODmain.
IFmy_container ISINITIAL.
CREATEOBJECT my_container
EXPORTING
container_name ='HTML'
EXCEPTIONS
OTHERS=1.
ENDIF.
IFhtml_control ISINITIAL.
CREATEOBJECT html_control
EXPORTING
parent =my_container.
ENDIF.
DATAeventsTYPEcntl_simple_events.
DATAeventTYPEcntl_simple_event.
event-eventid =html_control->m_id_sapevent.
event-appl_event ='X'.
APPENDeventTOevents.
CALLMETHODhtml_control->set_registered_events
EXPORTING
events=events.
SETHANDLERme->on_html_event FORhtml_control.
CLEARe_data.
FREEts_data.
FREEhtml.
APPEND''
TOhtml.
APPEND'
'.
.
.
.
.
.
.
.
.
.
TOhtml.
APPEND'
TOhtml.
APPEND'
'TOhtml.
APPEND''
TOhtml.
APPEND''
TOhtml.
APPEND''
TOhtml.
APPEND''
TOhtml.
APPEND'
TOhtml.
.
.
.
.
APPEND''
TOhtml.
APPEND''TOhtml.
CALLMETHODhtml_control->load_data
EXPORTING
type='text'
subtype ='html'
IMPORTING
assigned_url =w_url
CHANGING
data_table =html
EXCEPTIONS
dp_invalid_parameter =1
dp_error_general =2
cntl_error =3
OTHERS=4.
IFsy-subrc <> 0.
ENDIF.
CALLMETHODhtml_control->show_url
EXPORTING
url =w_url
EXCEPTIONS
cntl_error =1
cnht_error_not_allowed =2
cnht_error_parameter =3
dp_error_general =4
OTHERS=5.
IFsy-subrc <> 0.
ENDIF.
ENDMETHOD."main
METHODon_html_event.
DATA:l_string TYPEstring.
l_string =getdata.
DATA:lv_valid TYPExfeld,
lv_refresh TYPExfeld.
ifv_role =text-020or(wa_zctmm-STATUS =text-004
orwa_zctmm-STATUS =text-000orwa_zctmm-STATUS =text-001).
SPLITl_string AT'='INTOs1 s2.
SPLITs2 AT'&'INTOs3 s4.
SPLITs4 AT'='INTOs5 s6.
wa_av-att_name =s6.
wa_av-value=s3.
MODIFYit_av FROMwa_av TRANSPORTINGvalue
WHEREatt_name =wa_av-att_name.
CALLMETHODalv_grid2->check_changed_data
IMPORTING
e_valid =lv_valid
CHANGING
c_refresh =lv_refresh.
" to refresh alv
CALLMETHODalv_grid2->refresh_table_display
EXCEPTIONS
finished =1
OTHERS=2.
flag1 =1.
PERFORMgen_long.
PERFORMgen_short.
DATA:lcl_oref TYPEREFTOlcl_class.
IFlcl_oref ISNOTBOUND.
CREATEOBJECT lcl_oref.
CALLMETHODlcl_oref->main.
ENDIF.
CALLMETHODhtml_control->DO_REFRESH.
ENDIF.
ENDMETHOD."on_html_event
ENDCLASS."lcl_class IMPLEMENTATION