2014 Aug 06 7:49 AM
Hi experts,
I am using below code in module pool programming. I want to refresh data in Cont for ALV or HTML at run time.
but it is not working, plz help?????
Code:
TABLES: vbrk.
TYPES : BEGIN OF ty_html,
dataset(255) TYPE c,
END OF ty_html.
DATA : splitter TYPE REF TO cl_gui_splitter_container.
DATA: cont TYPE REF TO cl_gui_container,
html TYPE REF TO cl_gui_html_viewer,
salv TYPE REF TO cl_salv_table.
DATA: it_data TYPE STANDARD TABLE OF vbrk,
ts_data TYPE STANDARD TABLE OF ty_html,
w_url TYPE char255.
SELECTION-SCREEN : BEGIN OF SCREEN 1001.
PARAMETERS: rb_alv RADIOBUTTON GROUP rb1,
rb_graph RADIOBUTTON GROUP rb1.
SELECT-OPTIONS : s_fkdat FOR vbrk-fkdat.
SELECTION-SCREEN END OF SCREEN 1001.
START-OF-SELECTION.
IF splitter IS INITIAL.
CREATE OBJECT splitter
EXPORTING
parent = cl_gui_container=>screen0
rows = 2
columns = 1
align = 15. " (splitter fills the hole custom container)
ENDIF.
IF cont IS NOT INITIAL.
cont->free( ).
ENDIF.
CALL METHOD splitter->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = cont.
SELECT * FROM vbrk INTO TABLE it_data
WHERE fkdat IN s_fkdat.
IF rb_alv = 'X'.
IF html IS NOT INITIAL.
html->free( ).
ENDIF.
TRY.
cl_salv_table=>factory(
EXPORTING
r_container = cont
IMPORTING
r_salv_table = salv
CHANGING
t_table = it_data ).
CATCH cx_salv_msg. "#EC NO_HANDLER
ENDTRY.
ELSE.
*** APPEND SOMETHING IN TS_DATA.
IF html IS INITIAL.
CREATE OBJECT html
EXPORTING
parent = cont
EXCEPTIONS
cntl_error = 1
cntl_install_error = 2
dp_install_error = 3
dp_error = 4
OTHERS = 5.
CALL METHOD html->load_data
EXPORTING
* url = w_url
type = 'text'
subtype = 'html'
IMPORTING
assigned_url = w_url
CHANGING
data_table = ts_data
EXCEPTIONS
dp_invalid_parameter = 1
dp_error_general = 2
cntl_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
ENDIF.
CALL METHOD html->show_url
EXPORTING
url = w_url
in_place = 'X'
EXCEPTIONS
cntl_error = 1
cnht_error_not_allowed = 2
cnht_error_parameter = 3
dp_error_general = 4
OTHERS = 5.
IF sy-subrc <> 0.
ENDIF.
html->set_ui_flag( html->uiflag_no3dborder ).
ENDIF.
ENDIF.
2014 Aug 06 8:17 AM
Hi Narendra..
Make sure that weather u created the screen or not....
and if not first create Screen and in that screen Layout place the control of Custom container with the name of CONT.......
Then Uncomment the ( PBO and PAI ) Event Modules in the flow logic of Screen and
write your logic on that PBO and PAI Modules then it will work Other wise it will not respond to you..
Hope you understand,
Vamsilakshman.p
2014 Aug 06 8:21 AM
Thanks for reply,
I have created the screen 9000 and after start-of-selection code called in screen 9000 PBO.
but it not work.
2014 Aug 06 9:22 AM
Hi
DATA: lo_grid TYPE REF TO cl_gui_alv_grid.
Try to get your alv refresh using the grid method REFRESH_TABLE_DISPLAY.
Ex : CALL METHOD lo_grid->refresh_table_display.
Hope this will workout for you...
vamsilakshman.p
2014 Aug 06 9:30 AM
Dear,
I know about this method, but I don't want to refresh alv data, I want to display the alv and HTML code in a same container based on radio button.
User case switch multiple times between ALV and HTML at runtime.
My changed alv/HTMl data shows in the container but user switch Alv to HTML or HTML to ALV, the container shows nothing(Blank).
2014 Aug 06 10:13 AM
Hi neran,
before u split the container, u have to create the container.
create object cont "Creating Docking Container
exporting
side = 4 "At Bottom
ratio = 70
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
"u have to pass the container name
IF splitter IS INITIAL.
CREATE OBJECT splitter
EXPORTING
parent = cont " pass the container name
rows = 2
columns = 1
align = 15. " (splitter fills the hole custom container)
ENDIF.
"Then u need another objects, which ref to cl_gui_container, to get the splitted containers