Cl_gui_html_viewer method load_data
Hi,
I use use the mentioned method to load the documentation of the program into a container. Is it possible to change the background of this? I get only a white background, what I want is a different colour.
Thanks.
Hello Marcin,
this is my html:
<BODY BGCOLOR="WHITE" TEXT="BLACK" LINK="BLUE" VLINK="#3366CC" ALINK="RED">
<TABLE BORDER="0" CELLPADDING="2" WIDTH="100%" BGCOLOR="#3366CC"><TR><TD><FONT COLOR="#FFFFFF" SIZE="5">
</FONT></TD></TR></TABLE>
<H2>Dokumentation</H2>
<H2></H2>
<P>Einleitung:</P>
</FONT></BODY></HTML>
now I have to make:
loop at html into wa_html.
if wa_html-TDLINE cs 'BODY'.
endif.
endloop.
but how can I say that he only change the value of BGCOLOR?
Similar Messages
-
Oop report programme: call method
hi, i need ur guys advice about my oop report. its contain 2 class, lcl_main (main programme), lcl_disp(display report), lcl_update (upload report). all 3 class defination as below:
* C.L.A.S.S D.E.F.I.N.I.T.I.O.N
class lcl_main definition.
public section.
methods: init,
get_filename,
load_data,
chk_col,
chk_data,
chk_mandatory,
disp_status.
endclass.
class lcl_disp definition inheriting from lcl_main.
public section.
methods: chk_9700,
disp_success.
endclass.
class lcl_update definition inheriting from lcl_main.
public section.
methods: update9700.
endclass.
the idea was, i planned to put all methods which will be access by lcl_disp and lcl_update into lcl_main. i currently cofious to call method at lcl_main. currently i done as below, which if want to display (user will choose radio button display - p_view) i will create the object for lcl_disp and call all method in lcl_main and lcl_disp , for example o_disp-> init ... o_disp->loaddata .. and etc. the problem was if i want to choose the update , i need to object for lcl_update and call again the lcl_main with: o_update-> init ... o_update->loaddata .. and etc. the code as below.
the question , the programme can be successfully run with this method but i faced the problem when i tried to create a call method inside others method because at the START-OF-SELECTION i need to identify with object (lcl_disp or lcl_update) first.
2nd, i tried to figure out how at the start-of-selection , i no need to repeat to call method init, loaddata repeatly for different class (lcl_disp and lcl_update). really need advice. thank you.
*---------------------------------------------------------------------|
* INITIALIZATION |
*---------------------------------------------------------------------|
initialization.
data: o_main type ref to lcl_main.
create object: o_main.
* START OF SELECTION *
start-of-selection.
data: o_disp type ref to lcl_disp,
o_update type ref to lcl_update.
create object: o_disp, o_update.
if p_view = 'X'. "for view report
set handler o_handler->handle_event for all instances.
call method o_disp->init.
call method o_disp->load_data.
call method o_disp->chk_col.
"only proceeed if initial - col header and pernr syntax (pre 100 and length = 8)
if o_disp->status = 0.
call method o_disp->chk_data.
endif.
if o_disp->status = 0.
call method o_disp->chk_mandatory.
endif.
if o_disp->status = 0.
call method o_disp->chk_9700.
endif.
call method o_disp->disp_status.
elseif p_upld = 'X'."for update report
set handler o_handler->handle_event for all instances.
call method o_update->init.
call method o_update->load_data.
call method o_update->chk_col.
"only proceeed if initial - col header and pernr syntax (pre 100 and length = 8)
if o_update->status = 0.
call method o_update->chk_data.
endif.
if o_update->status = 0.
call method o_update->update9700.
endif.
call method o_update->disp_status.
endif.
class lcl_main implementation.
method get_filename.
endmethod.
method init.
endmethod.
method load_data.
endmethod.
method chk_col.
endmethod.
method chk_data.
endmethod.
method chk_mandatory.
endmethod.
method disp_status.
endmethod.
endclass.
class lcl_disp implementation.
method chk_9700.
endmethod.
method disp_success.
endclass.
class lcl_update implementation.
method update9700.
endmethod.
endclass.
Edited by: firdaus hashim on Nov 23, 2009 11:01 AMHello Sam,
Go to the class CL_DD_DOCUMENT (trxn SE24).
In the 'Attributes' tab, check for the attributes with SDYDO_ATTRIBUTE as the associated type.
It gives all the available attributes.
BR,
Suhas -
Interacrive forms within the SAP GUI
Hello
I want to work with interactive forms within the SAP GUI, with ABAP.
I've managed to display a generated PDF in an ABAP screen, with CL_GUI_HTML_VIEWER, using the method LOAD_DATA. The problem now is getting the filled data out of the form. Is there any standard way of doing it? (getting the data without saving the file)
I've thought of some ways, such as getting the filled file somehow as a binary file, or handling the document's Submit button, but I haven't managed to get any of them to work.
Is there any way to make it work, or use the different PDF classes to do it..
ThanksHello
I want to work with interactive forms within the SAP GUI, with ABAP.
I've managed to display a generated PDF in an ABAP screen, with CL_GUI_HTML_VIEWER, using the method LOAD_DATA. The problem now is getting the filled data out of the form. Is there any standard way of doing it? (getting the data without saving the file)
I've thought of some ways, such as getting the filled file somehow as a binary file, or handling the document's Submit button, but I haven't managed to get any of them to work.
Is there any way to make it work, or use the different PDF classes to do it..
Thanks -
Defining attribute for internal table within class builder?
Hello there,
I use an function module that provides me an internal table which has the reference type of the DDIC object zml_output. Furthermore I call this function module within a global class that should keep the result of the function module into the attribute lt_result, that is declared as private and typed with
lt_result TYPE zml_output.
Even the definition of that attribute causes the following error message:
"lt_result" is not an internal table.
I don't have any clue how to type lt_result differently. Actually I would need the following type of typing "TYPE TABLE OF" but that does not exist within the class builder.
Thanks for your help in advanced!
RobertHi Konstantinidis ...
Of course I can provide it to you. The code of my methode load_data reads as follows:
method LOAD_DATA.
CALL FUNCTION 'ZDATAGET'
EXPORTING
iv_dat = iv_dat
iv_time1 = iv_time1
iv_delta = iv_delta
TABLES
et_result = lt_result.
endmethod.
Especially the lt_result causes the mentioned error message
The compiler seems to expect something "TABLE" like for attribute lt_result. But whatever I tried it doesn't seem to work out.
Many thanks for help... -
Objects not created after the AT USER-COMMAND
Hi experts, gud evening. I'm new to ooabap. in my prog. after the at user-command the objects are not getting created. so i've created even before that. even then i couldn't get that created. so pls help me where the prob. is
Prog :
REPORT yrj_my_oops.
CLASS cl_vbak DEFINITION
CLASS cl_vbak DEFINITION.
PUBLIC SECTION.
METHODS : load_data IMPORTING value(im_kunnr) TYPE vbak-kunnr,
display_head,
write_data.
PROTECTED SECTION.
PRIVATE SECTION.
DATA : it_vbak TYPE TABLE OF vbak,
wa_vbak TYPE vbak.
ENDCLASS. "cl_vbak DEFINITION
DATA : w_vbeln TYPE vbak-vbeln.
CLASS cl_vbap DEFINITION
CLASS cl_vbap DEFINITION.
PUBLIC SECTION.
METHODS : load_data IMPORTING value(im_vbeln) TYPE vbak-vbeln,
write_data.
PROTECTED SECTION.
PRIVATE SECTION.
DATA : it_vbap TYPE TABLE OF vbap,
wa_vbap TYPE vbap.
ENDCLASS. "cl_vbap DEFINITION
CLASS cl_vbap IMPLEMENTATION
CLASS cl_vbap IMPLEMENTATION.
METHOD load_data.
SELECT * FROM vbap INTO TABLE it_vbap WHERE vbeln = w_vbeln.
ENDMETHOD. "load_data
METHOD write_data.
LOOP AT it_vbap INTO wa_vbap.
WRITE : /5 wa_vbap-posnr,
20 wa_vbap-matnr,
35 wa_vbap-arktx,
70 wa_vbap-netpr.
ENDLOOP.
ENDMETHOD. "write_data
ENDCLASS. "cl_vbap IMPLEMENTATION
CLASS cl_vbak IMPLEMENTATION
CLASS cl_vbak IMPLEMENTATION.
METHOD load_data.
SELECT * FROM vbak INTO TABLE it_vbak WHERE kunnr EQ im_kunnr.
ENDMETHOD. "load_data
METHOD display_head.
WRITE : /5 'Order No.',
15 'Order Date',
30 'Net Value'.
ENDMETHOD. "display_head
METHOD write_data.
LOOP AT it_vbak INTO wa_vbak.
WRITE : /5 wa_vbak-vbeln,
15 wa_vbak-audat,
30 wa_vbak-netwr.
ENDLOOP.
ENDMETHOD. "write_data
ENDCLASS. "cl_vbak IMPLEMENTATION
PARAMETERS : p_kunnr TYPE vbak-kunnr.
DATA : o_vbak TYPE REF TO cl_vbak,
o_vbap TYPE REF TO cl_vbap.
START-OF-SELECTION.
SET PF-STATUS : 'YRJ_MY_OOPS'.
CREATE OBJECT o_vbak.
CREATE OBJECT o_vbap.
CALL METHOD o_vbak->load_data
EXPORTING
im_kunnr = p_kunnr.
CALL METHOD o_vbak->display_head.
CALL METHOD o_vbak->write_data.
AT USER-COMMAND.
w_vbeln = sy-lisel+4(10).
CASE sy-ucomm.
WHEN 'BACK' or 'EXIT'.
LEAVE LIST-PROCESSING.
WHEN 'ITEM'.
CREATE OBJECT o_vbap.
CALL METHOD o_vbap->load_data
EXPORTING
im_vbeln = w_vbeln.
CALL METHOD o_vbap->write_data.
WHEN OTHERS.
ENDCASE.Hi,
I dont see any problem with you code. I ran your code in my system and worked fine. Except for one thing that is you need to do a conversion exit on the w_vbeln before selecting data from VBAP in method load data. This is because when you ouput the data, the VBELN is converted to external format and thus needs to be converted to internal format if you want to do further selects based on it.
CLASS cl_vbap IMPLEMENTATION.
METHOD load_data.
" Add this , so it converts the VBELN to internal format.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_vbeln
IMPORTING
output = w_vbeln.
SELECT * FROM vbap INTO TABLE it_vbap WHERE vbeln = w_vbeln.
ENDMETHOD. "load_data
METHOD write_data.
LOOP AT it_vbap INTO wa_vbap.
WRITE : /5 wa_vbap-posnr,
20 wa_vbap-matnr,
35 wa_vbap-arktx,
70 wa_vbap-netpr.
ENDLOOP.
ENDMETHOD. "write_data
regards,
Advait -
Method show_url of class cl_gui_html_viewer
Hello,
I use this method to show my html in a container.The problem is that I have sap icons in my html which are not shown in the container, what can be a solution to display the icons within the html?Hello Robert,
sorry but I think I can't explain my problem.
I have following coding:
DATA: l_t_html_page LIKE STANDARD TABLE OF htmlline,
html_viewer TYPE REF TO cl_gui_html_viewer.
CALL FUNCTION 'DOC_OBJECT_GET_HTML'
EXPORTING
docuid = 'RE'
docuobject = sy-repid
TABLES
html_page = l_t_html_page.
CREATE OBJECT html_viewer
EXPORTING
parent = container.
CALL METHOD html_viewer->load_data
IMPORTING
assigned_url = l_f_url
CHANGING
data_table = l_t_html_page.
CALL METHOD html_viewer->show_url
EXPORTING
url = l_f_url.
In table l_t_html_page I have the documentation of my report which include several icons like @01@. So I think I can't use your mentioned methods like LOAD_PICTURE_FROM_URL as the icons are in the documentation.
So is there any possibiliy how I can replace those icons with html icons? -
Set DOCTYPE for a self rendered HTML page using cl_gui_html_viewer
G'Day!
I'm dealing with HTML in ABAP and i' stuck with a nasty little problem. Perhaps somebody know's the answer and can help me out. Thanks in advance. (I'm sorry for my poor english)
My problem is:
I am rendering a html page in abap and display ist using a cl_gui_html_viewer.
Works fine.
But now in need to set the right DOCTYPE for the rendered html page.
If i add the DOCTYPE definition, my html page is not displayed, instead i get a display of the html-code??
To break it down to the root:
How can i add the DOCTYPE definition to a self-rendered html page?
If i add the DOCTYPE definition as first element of my html table, the html code won't be interpreted.
If i do not add the DOCTYPE defintion everything works fine.
I need the DOCTYPE definition so that the browser won't get into quirks mode and interpretes the html tag's right.
What i've done so far:
(Dynpro, container, html_viewer)
Load my JScripts (with load_mime_object)
Load my CSS (with load_mime_object)
Load my HTML:
-- lt_html TYPE w3htmltab
((-- APPEND '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">' TO ct_html.)) this line cause my trouble
-- filled the itab with my html tags <html>....</html> (set right url for Jscript and CSS)
-- Load my html table and get an URL CALL METHOD gr_labform_html->load_data
-- Load the url CALL METHOD gr_labform_html->show_urlI've "solved" my issue with a little workaround.
I created an empty html page with an existing DOCTYPE def and an tag like <!MYDATA!>
After that i filled 'l_merge_table TYPE swww_t_merge_table' with my tag and my html_data.
Loaded the whole thing with CALL METHOD gr_labform_html->load_html_document and now the DOCTYPE is set fully correct!
But i'm still interessted why i can't set the DOCTYPE directly? Anybody knows?
Got the idea from: Re: How can I read color from frond-end PC -
CL_GUI_HTML_VIEWER and external javascripts
Hi,
is it possible to display HTML document what has a reference to the external file with javascripts (but it could be CSS styles as well ) what were generated by abap program as well.
So I need to generate a file with javascripts. Download it to the workstation and later display a HTML page in HTML viewer what has a reference to generated external file.
Thank you for any help.
MarianHi ,
I dont really understood the problem what you have but can give as simple sample code. This code reads a .txt file containg a html code and shows the output on html viewer.
*& Report ZHTML_PROG *
REPORT ZHTML_PROG .
data: custom_control type ref to cl_gui_custom_container,
html_control type ref to cl_gui_html_viewer,
html_handle type ref to html_events.
data:it_W3HTML type standard table of W3HTML with header line.
data:HTML type standard table of W3HTML with header line.
DATA: doc_url0(80),
doc_url(80),
alignment type i, " Ausrichtung tree_control
okcode type sy-ucomm.
CONSTANTS: ALIGN_AT_LEFT TYPE I VALUE 1.
CONSTANTS: ALIGN_AT_RIGHT TYPE I VALUE 2.
CONSTANTS: ALIGN_AT_TOP TYPE I VALUE 4.
CONSTANTS: ALIGN_AT_BOTTOM TYPE I VALUE 8.
CONSTANTS: ALIGN_CENTERED TYPE I VALUE 16.
start-of-selection.
call screen 9006.
end-of-selection.
*& Form call_context_menu
text
-->P_ACTION text
FORM call_context_menu USING P_ACTION.
ENDFORM. " call_context_menu
*& Module display_html OUTPUT
text
MODULE display_html OUTPUT.
set pf-status '9006'.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'D:\281143\Sandy_signature\html.TXT'
FILETYPE = 'ASC'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = it_W3HTML[]
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT CUSTOM_CONTROL
EXPORTING
CONTAINER_NAME = 'CONTAINER'
CREATE OBJECT HTML_CONTROL
EXPORTING
SHELLSTYLE =
PARENT = CUSTOM_CONTROL
LIFETIME = LIFETIME_DEFAULT
SAPHTMLP =
UIFLAG =
NAME =
SAPHTTP =
QUERY_TABLE_DISABLED =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_INSTALL_ERROR = 2
DP_INSTALL_ERROR = 3
DP_ERROR = 4
others = 5
alignment = align_at_left + align_at_right + align_at_top +
align_at_bottom.
CALL METHOD html_control->set_alignment
EXPORTING
alignment = alignment.
CALL METHOD HTML_CONTROL->LOAD_DATA
EXPORTING
URL =
TYPE = 'text'
SUBTYPE = 'html'
SIZE = 0
ENCODING =
CHARSET =
IMPORTING
ASSIGNED_URL = doc_url0
CHANGING
DATA_TABLE = it_W3HTML[]
EXCEPTIONS
DP_INVALID_PARAMETER = 1
DP_ERROR_GENERAL = 2
CNTL_ERROR = 3
others = 4
APPEND:
'<html><frameset>' TO html.
CONCATENATE
'<frame name=Frame0 src="'
doc_url0
'" scrolling=auto >'
INTO html.
APPEND html .
APPEND:
'</frameset></html>' TO html.
create final link to welcome-screen;
CALL METHOD html_control->load_data
EXPORTING
type = 'text'
subtype = 'html'
IMPORTING
assigned_url = doc_url
CHANGING
data_table = html[]
EXCEPTIONS
dp_invalid_parameter = 1
dp_error_general = 2
OTHERS = 3.
IF sy-subrc = 0.
ENDIF.
CALL METHOD html_control->show_data
EXPORTING
url = doc_url0.
ENDMODULE. " display_html OUTPUT
*& Module USER_COMMAND_9006 INPUT
text
MODULE USER_COMMAND_9006 INPUT.
if okcode = 'BACK'.
leave program.
endif.
ENDMODULE. " USER_COMMAND_9006 INPUT -
Unable to Create a CL_GUI_HTML_VIEWER
Hi to all..
I'm not able to create an CL_GUI_HTML_VIEWER ... after executing everything it just shows the button and textbox along..
This is my code..
TYPE-POOLS: icon.
CLASS cls_event_handler DEFINITION DEFERRED.
G L O B A L V A R I A B L E S
DATA:
ok_code LIKE sy-ucomm,
Container for html vieaer
go_html_container TYPE REF TO cl_gui_custom_container,
HTML viewer
go_htmlviewer TYPE REF TO cl_gui_html_viewer,
Container for toolbar
go_toolbar_container TYPE REF TO cl_gui_custom_container,
SAP Toolbar
go_toolbar TYPE REF TO cl_gui_toolbar,
Event handler for toolbar
go_event_handler TYPE REF TO cls_event_handler,
Variable for URL text field on screen 100
g_screen100_url_text(255) TYPE c,
g_screen100_display_url(255) TYPE c.
I N T E R N A L T A B L E S
DATA:
Table for button group
gi_button_group TYPE ttb_button,
Table for registration of events. Note that a TYPE REF
to cls_event_handler must be created before you can
reference types cntl_simple_events and cntl_simple_event.
gi_events TYPE cntl_simple_events,
Workspace for table gi_events
g_event TYPE cntl_simple_event.
START-OF-SELECTION.
SET SCREEN '100'.
CLASS cls_event_handler DEFINITION
Handles events for the toolbar an the HTML viewer
CLASS cls_event_handler DEFINITION.
PUBLIC SECTION.
METHODS:
Handles method function_selected for the toolbar control
on_function_selected
FOR EVENT function_selected OF cl_gui_toolbar
IMPORTING fcode,
Handles method navigate_complete for the HTML viewer control
on_navigate_complete
FOR EVENT navigate_complete OF cl_gui_html_viewer
IMPORTING url.
ENDCLASS.
CLASS cls_event_handler IMPLEMENTATION.
Handles method function_selected for the toolbar control
METHOD on_function_selected.
CASE fcode.
WHEN 'BACK'.
CALL METHOD go_htmlviewer->go_back
EXCEPTIONS cntl_error = 1.
WHEN 'FORWARD'.
CALL METHOD go_htmlviewer->go_forward
EXCEPTIONS cntl_error = 1.
WHEN 'STOP'.
CALL METHOD go_htmlviewer->stop
EXCEPTIONS cntl_error = 1.
WHEN 'REFRESH'.
CALL METHOD go_htmlviewer->do_refresh
EXCEPTIONS cntl_error = 1.
WHEN 'HOME'.
CALL METHOD go_htmlviewer->go_home
EXCEPTIONS cntl_error = 1.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMETHOD.
Handles method navigate_complete for the HTML viewer control
METHOD on_navigate_complete.
Display current URL in a textfield on the screen
g_screen100_display_url = url.
ENDMETHOD.
ENDCLASS.
*& Module STATUS_0100 OUTPUT
MODULE status_0100 OUTPUT.
IF go_html_container IS INITIAL.
Create container for HTML viewer
CREATE OBJECT go_html_container
EXPORTING
container_name = 'HTML_CONTAINER'.
Create HTML viewer
CREATE OBJECT go_htmlviewer
EXPORTING parent = go_html_container.
Create container for toolbar
CREATE OBJECT go_toolbar_container
EXPORTING
container_name = 'TOOLBAR_CONTAINER'.
Create toolbar
CREATE OBJECT go_toolbar
EXPORTING
parent = go_toolbar_container.
Add buttons to the toolbar
PERFORM add_button_group.
Create event table. The event ID must be found in the
documentation of the specific control
CLEAR g_event.
REFRESH gi_events.
g_event-eventid = go_toolbar->m_id_function_selected.
g_event-appl_event = 'X'. "This is an application event
APPEND g_event TO gi_events.
g_event-eventid = go_htmlviewer->m_id_navigate_complete.
APPEND g_event TO gi_events.
Use the events table to register events for the control
CALL METHOD go_toolbar->set_registered_events
EXPORTING
events = gi_events.
CALL METHOD go_htmlviewer->set_registered_events
EXPORTING
events = gi_events.
Create event handlers
CREATE OBJECT go_event_handler.
SET HANDLER go_event_handler->on_function_selected
FOR go_toolbar.
SET HANDLER go_event_handler->on_navigate_complete
FOR go_htmlviewer.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
Handles the pushbutton for goto url
CASE ok_code.
WHEN 'GOTOURL'.
PERFORM goto_url.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form add_button_group
Adds a button group to the toolbar
FORM add_button_group.
BACK botton
CALL METHOD cl_gui_toolbar=>fill_buttons_data_table
EXPORTING
fcode = 'BACK'
icon = icon_arrow_left
butn_type = cntb_btype_button
text = ''
quickinfo = 'Go back'
CHANGING
data_table = gi_button_group.
FORWARD botton
CALL METHOD cl_gui_toolbar=>fill_buttons_data_table
EXPORTING
fcode = 'FORWARD'
icon = icon_arrow_right
butn_type = cntb_btype_button
text = ''
quickinfo = 'Go forward'
CHANGING
data_table = gi_button_group.
STOP button
CALL METHOD cl_gui_toolbar=>fill_buttons_data_table
EXPORTING
fcode = 'STOP'
icon = icon_breakpoint
butn_type = cntb_btype_button
text = ''
quickinfo = 'Stop'
CHANGING
data_table = gi_button_group.
REFRESH button
CALL METHOD cl_gui_toolbar=>fill_buttons_data_table
EXPORTING
fcode = 'REFRESH'
icon = icon_refresh
butn_type = cntb_btype_button
text = ''
quickinfo = 'Refresh'
CHANGING
data_table = gi_button_group.
Home button
CALL METHOD cl_gui_toolbar=>fill_buttons_data_table
EXPORTING
fcode = 'HOME'
icon = ''
butn_type = cntb_btype_button
text = 'Home'
quickinfo = 'Home'
CHANGING
data_table = gi_button_group.
Separator
CALL METHOD cl_gui_toolbar=>fill_buttons_data_table
EXPORTING
fcode = 'SEP1'
icon = ' '
butn_type = cntb_btype_sep
CHANGING
data_table = gi_button_group.
EXIT button
CALL METHOD cl_gui_toolbar=>fill_buttons_data_table
EXPORTING
fcode = 'EXIT'
icon = icon_close
butn_type = cntb_btype_button
text = ''
quickinfo = 'Close porgram'
CHANGING
data_table = gi_button_group.
Add button group to toolbar
CALL METHOD go_toolbar->add_button_group
EXPORTING data_table = gi_button_group.
ENDFORM. " add_button_group
*& Form goto_url
Calls method SHOW_URL to navigate to an URL
FORM goto_url.
CALL METHOD go_htmlviewer->show_url
EXPORTING url = g_screen100_url_text.
ENDFORM. " goto_url
please provide a solution
With regards
aahbhayes you can do that.
place a button in the status bar and enter the following code if the button is pressed
call method html_control->execwb
exporting cmd_id = html_control->wb_cmdid_print
exceptions cntl_error = 1 .
if sy-subrc <> 0.
message e003(cnht) raising html_print_error.
endif.
Hope this helps.
Regards
Raja -
CL_GUI_HTML_VIEWER in a customcontainer on a popup - not changable
Hello,
I have a little function that eventually call a small modal screen that containes very few valuea, an input field and a custom control.That custom control is linked to CL_GUI_HTML_VIEWER.
It should just display a few lines of self created HTML coding. That is all done in the PBO and it works fine - the 1st time it is called.
But it seems that in case the function is called a second time, the custom control just displays what was shown the very first time. Any changes to the HTML coding are disregarded - although the rest of the popup reflects the changes made.
I might be missing some simple steps or things. Clearing down the reference variables and firing the cl->free method do not seem to make a difference.
Does anyone have an idea?
Is something wrong w/ the 'lietime management' - to what should I set the 'lifetime' parameter?
I am a bit confused.
Any help appreciated
Thanks,
C.N.Well I found the solution - as suspected I was looking to hard and not doing the obvious.
When speaking of control I always thought of CL_GUI_HTML_VIEWER only - freeing it up did not help the cause.
While working on the issue, I attempted various things including usinh two popup screens. Both worked fine - when called the 1st time w/ two different container of course.
This led me to the obvious - not to 'free the instance of CL_GUI_HTML_VIEWER but to 'free' CL_GUI_CUSTOM_CONTAINER instance.
* In the PBO:
If not container is initial. " container is the 'created' custom container
CALL METHOD container->free.
endif.
That's all that is needed to overcome this shortcoming!
Thanks, Sandra! -
CL_GUI_HTML_VIEWER need to open a different Browser session if one exists
Hi All,
I'm using the class cl_gui_html_viewer for displaying a PDF in My program. However, if an Internet Explorer Session is already open, the HTLM_VIEWER created in my program is behaving more like a child of the already open browser (In other words, it works like pressing CTRL+N on the original window). But my requirement is to open a new Browser session altogether (Like Opening up another Internet Explorer Session).
The reason i need to have this is because the PDF i display is based on an authenticated login. If a person is already logged in through the Stand alone IE browser, my program should not allow the same user to view it in the browser but authenticate again by prompting for a login. This is achieved by using different Browser sessions (not by CTRL+N).
Please let me know if you have any thoughts on achieving this.
Thanks in advance,
Jr.where is this PDf coming from, is it from external source thru a url? can you pass uid/pwd to this PDF via url,
if yes, pass a wrong uid/pwd thru the url , every time you load the pdf, in the html viewer control, this would always prompt for authntication box. other option is to delete the sso2 cookie, you need to find a method to delete the cookie in your local machine created by calling this pdf from standalone browser.
Raja -
CL_GUI_HTML_VIEWER
hi,
I'm using a container and class interface CL_GUI_HTML_VIEWER to display documents (Text, Word...)
I just want to display them and don't want the user to be able to change the document.
I try to do it with method set_enable form class CL_GUI_HTML_VIEWER, but then i can't use the scrool bar.....
any idea??
thanks,
josephIn my system, I display a text file in the viewer. It does not allow me to change the document at all.
report zrich_0002.
data: url(2048).
parameters: p_check type c.
start-of-selection.
at selection-screen output.
data: dockingleft type ref to cl_gui_docking_container,
html_control type ref to cl_gui_html_viewer,
repid type syrepid.
repid = sy-repid.
check dockingleft is initial.
create object dockingleft
exporting repid = repid
dynnr = sy-dynnr
side = dockingleft->dock_at_left
extension = 1000.
create object html_control
exporting
parent = dockingleft.
url = '\serverfolderfile.txt'.
call method html_control->show_url
exporting
url = url
exceptions
cnht_error_parameter = 1
others = 2.
Regards,
Rich Heilman -
Cl_gui_html_viewer and javascript
hi,
I wonder if I can add some javascript code with cl_gui_html_viewer.
Let's says that if the user click on the container I would like to pop up a message.
I try to do it with method set_script and event navigate_complete but I failled.
Thank youquick and dirty:
copy paste the following code in a noted pad
<i><a href="#" onclick="alert('test');">test</a>
<br>
<a href="http://www.google.com" target="_blank">google</a></i>
and save it as test.html in your desktop.
run program SAPHTML_DEMO1 and enter the path for test.html in the input field and hit enter, you should now see the html page inside the container , click on the links to see how it works.
hope this helps.
Regards
Raja -
How can i get the additional text fields in the ALV methods
Hi all,
I have 2 different layouts in the same screen, here i am using the 2 custom containers,for each container having the method called SET_TABLE_FOR_FIRST_DISPLAY, in this i have used the Title through the gridtitle field, now i need to display some more texts under the title OR in the top of the layouts.
Please suggest me.
Thanks
GiridharHi,
check this code, here i developed using splitter container, and implemented top of page event. check it. and i documented it also.
REPORT ZTEST1234_ALV_TOP MESSAGE-ID ZZ .
DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: L_VALID TYPE C,
V_FLAG,
V_DATA_CHANGE,
V_ROW TYPE LVC_S_ROW,
V_COLUMN TYPE LVC_S_COL,
V_ROW_NUM TYPE LVC_S_ROID.
DATA: IT_ROW_NO TYPE LVC_T_ROID,
X_ROW_NO TYPE LVC_S_ROID.
DATA:BEGIN OF ITAB OCCURS 0,
VBELN LIKE LIKP-VBELN,
POSNR LIKE LIPS-POSNR,
CELLCOLOR TYPE LVC_T_SCOL, "required for color
DROP(10),
END OF ITAB.
"The Below Definitions Must.....
DATA:
* Reference to document
DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT,
* Reference to split container
DG_SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
* Reference to grid container
DG_PARENT_GRID TYPE REF TO CL_GUI_CONTAINER,
* Reference to html container
DG_HTML_CNTRL TYPE REF TO CL_GUI_HTML_VIEWER,
* Reference to html container
DG_PARENT_HTML TYPE REF TO CL_GUI_CONTAINER.
"up to here
* CLASS lcl_event_handler DEFINITION
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
**Hot spot Handler
HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
**Double Click Handler
HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW E_COLUMN ES_ROW_NO,
TOP_OF_PAGE FOR EVENT TOP_OF_PAGE "event handler
OF CL_GUI_ALV_GRID
IMPORTING E_DYNDOC_ID.
* END_OF_LIST FOR EVENT end_of_list "event handler
* OF CL_GUI_ALV_GRID
* IMPORTING E_DYNDOC_ID.
ENDCLASS. "lcl_event_handler DEFINITION
* CLASS lcl_event_handler IMPLEMENTATION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
*Handle Hotspot Click
METHOD HANDLE_HOTSPOT_CLICK .
CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
V_ROW = E_ROW_ID.
V_COLUMN = E_COLUMN_ID.
V_ROW_NUM = ES_ROW_NO.
* MESSAGE I000 WITH V_ROW 'clicked'.
CLEAR IT_ROW_NO[].
X_ROW_NO-ROW_ID = V_ROW.
APPEND X_ROW_NO TO IT_ROW_NO .
CALL METHOD G_GRID->SET_SELECTED_ROWS
EXPORTING
IT_ROW_NO = IT_ROW_NO.
ENDMETHOD. "lcl_event_handler
*Handle Double Click
METHOD HANDLE_DOUBLE_CLICK.
CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
V_ROW = E_ROW.
V_COLUMN = E_COLUMN.
V_ROW_NUM = ES_ROW_NO.
IF E_COLUMN = 'VBELN'.
SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
ENDIF.
IF E_COLUMN = 'POSNR'.
SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN."
ENDIF.
ENDMETHOD. "handle_double_click
* METHOD END_OF_LIST. "implementation
** Top-of-page event
* PERFORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID.
* ENDMETHOD. "top_of_page
METHOD TOP_OF_PAGE. "implementation
* Top-of-page event
PERFORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID.
ENDMETHOD. "top_of_page
ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION
*& Global Definitions
DATA: G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,"Container1
G_HANDLER TYPE REF TO LCL_EVENT_HANDLER. "handler
DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE SY-UCOMM,
G_CONTAINER1 TYPE SCRFNAME VALUE 'TEST',
GS_LAYOUT TYPE LVC_S_LAYO.
data: v_lines type i.
data: v_line(3) type c.
*- Fieldcatalog for First and second Report
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
X_FIELDCAT TYPE LVC_S_FCAT,
LS_VARI TYPE DISVARIANT.
* START-OF_SELECTION
START-OF-SELECTION.
SELECT VBELN
POSNR
FROM LIPS
UP TO 20 ROWS
INTO CORRESPONDING FIELDS OF TABLE ITAB.
describe table itab lines v_lines.
END-OF-SELECTION.
IF NOT ITAB[] IS INITIAL.
CALL SCREEN 100.
ELSE.
MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
ENDIF.
*& Form CREATE_AND_INIT_ALV
* text
FORM CREATE_AND_INIT_ALV .
DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
"attention.....from here
"split your container here...into two parts
"create the container
CREATE OBJECT G_CUSTOM_CONTAINER
EXPORTING CONTAINER_NAME = G_CONTAINER1.
"this is for top of page
* Create TOP-Document
CREATE OBJECT DG_DYNDOC_ID
EXPORTING STYLE = 'ALV_GRID'.
* Create Splitter for custom_container
CREATE OBJECT DG_SPLITTER
EXPORTING PARENT = G_CUSTOM_CONTAINER
ROWS = 2
COLUMNS = 1.
* Split the custom_container to two containers and move the reference
* to receiving containers g_parent_html and g_parent_grid
"i am allocating the space for grid and top of page
CALL METHOD DG_SPLITTER->GET_CONTAINER
EXPORTING
ROW = 1
COLUMN = 1
RECEIVING
CONTAINER = DG_PARENT_HTML.
CALL METHOD DG_SPLITTER->GET_CONTAINER
EXPORTING
ROW = 2
COLUMN = 1
RECEIVING
CONTAINER = DG_PARENT_GRID.
* CALL METHOD DG_SPLITTER->GET_CONTAINER
* EXPORTING
* ROW = 2
* COLUMN = 1
* RECEIVING
* CONTAINER = DG_PARENT_HTML.
* CALL METHOD DG_SPLITTER->GET_CONTAINER
* EXPORTING
* ROW = 1
* COLUMN = 1
* RECEIVING
* CONTAINER = DG_PARENT_GRID.
"you can set the height of it
* Set height for g_parent_html
CALL METHOD DG_SPLITTER->SET_ROW_HEIGHT
EXPORTING
ID = 1
HEIGHT = 5.
"from here as usual..you need to specify parent as splitter part
"which we alloted for grid
CREATE OBJECT G_GRID
EXPORTING I_PARENT = DG_PARENT_GRID.
* Set a titlebar for the grid control
CLEAR GS_LAYOUT.
GS_LAYOUT-GRID_TITLE = TEXT-003.
GS_LAYOUT-ZEBRA = SPACE.
GS_LAYOUT-CWIDTH_OPT = 'X'.
GS_LAYOUT-NO_ROWMARK = 'X'.
GS_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
CALL METHOD G_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_ENTER.
CREATE OBJECT G_HANDLER.
SET HANDLER G_HANDLER->HANDLE_DOUBLE_CLICK FOR G_GRID.
SET HANDLER G_HANDLER->HANDLE_HOTSPOT_CLICK FOR G_GRID.
* SET HANDLER G_HANDLER->END_OF_LIST FOR G_GRID.
SET HANDLER G_HANDLER->TOP_OF_PAGE FOR G_GRID.
DATA: LS_CELLCOLOR TYPE LVC_S_SCOL. "required for color
DATA: L_INDEX TYPE SY-TABIX.
"Here i am changing the color of line 1,5,10...
"so you can change the color of font conditionally
LOOP AT ITAB.
L_INDEX = SY-TABIX.
IF L_INDEX = 1 OR L_INDEX = 5 OR L_INDEX = 10.
LS_CELLCOLOR-FNAME = 'VBELN'.
LS_CELLCOLOR-COLOR-COL = '6'.
LS_CELLCOLOR-COLOR-INT = '0'.
LS_CELLCOLOR-COLOR-INV = '1'.
APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
LS_CELLCOLOR-FNAME = 'POSNR'.
LS_CELLCOLOR-COLOR-COL = '6'.
LS_CELLCOLOR-COLOR-INT = '0'.
LS_CELLCOLOR-COLOR-INV = '1'.
APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
ENDIF.
ENDLOOP.
* setting focus for created grid control
CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
EXPORTING
CONTROL = G_GRID.
* Build fieldcat and set editable for date and reason code
* edit enabled. Assign a handle for the dropdown listbox.
PERFORM BUILD_FIELDCAT.
PERFORM SET_DRDN_TABLE.
* Optionally restrict generic functions to 'change only'.
* (The user shall not be able to add new lines).
PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
**Vaiant to save the layout
LS_VARI-REPORT = SY-REPID.
LS_VARI-HANDLE = SPACE.
LS_VARI-LOG_GROUP = SPACE.
LS_VARI-USERNAME = SPACE.
LS_VARI-VARIANT = SPACE.
LS_VARI-TEXT = SPACE.
LS_VARI-DEPENDVARS = SPACE.
**Calling the Method for ALV output
CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
IS_VARIANT = LS_VARI
IS_LAYOUT = GS_LAYOUT
I_SAVE = 'A'
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT
IT_OUTTAB = ITAB[].
"do these..{
* Initializing document
CALL METHOD DG_DYNDOC_ID->INITIALIZE_DOCUMENT.
* Processing events
CALL METHOD G_GRID->LIST_PROCESSING_EVENTS
EXPORTING
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = DG_DYNDOC_ID.
"end }
* Set editable cells to ready for input initially
CALL METHOD G_GRID->SET_READY_FOR_INPUT
EXPORTING
I_READY_FOR_INPUT = 1.
ENDFORM. "CREATE_AND_INIT_ALV
*& Form EXCLUDE_TB_FUNCTIONS
* text
* -->PT_EXCLUDE text
FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
* Only allow to change data not to create new entries (exclude
* generic functions).
DATA LS_EXCLUDE TYPE UI_FUNC.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
ENDFORM. " EXCLUDE_TB_FUNCTIONS
*& Form build_fieldcat
* Fieldcatalog
FORM BUILD_FIELDCAT .
DATA: L_POS TYPE I.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Delivery'(024).
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-NO_ZERO = 'X'.
X_FIELDCAT-OUTPUTLEN = '10'.
X_FIELDCAT-HOTSPOT = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Item'(025).
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '5'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Drop'(025).
X_FIELDCAT-FIELDNAME = 'DROP'.
X_FIELDCAT-TABNAME = 'IT_FINAL'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '5'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-DRDN_HNDL = '1'.
X_FIELDCAT-DRDN_ALIAS = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
ENDFORM. " build_fieldcat
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAIN100'.
IF G_CUSTOM_CONTAINER IS INITIAL.
**Initializing the grid and calling the fm to Display the O/P
PERFORM CREATE_AND_INIT_ALV.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form SET_DRDN_TABLE
* text
FORM SET_DRDN_TABLE.
DATA:LT_DRAL TYPE LVC_T_DRAL,
LS_DRAL TYPE LVC_S_DRAL.
LOOP AT ITAB .
* First listbox (handle '1').
IF SY-INDEX = 1.
LS_DRAL-HANDLE = '1'.
LS_DRAL-VALUE = ' '.
LS_DRAL-INT_VALUE = ' '.
ELSE.
LS_DRAL-HANDLE = '1'.
LS_DRAL-VALUE = ITAB-POSNR.
LS_DRAL-INT_VALUE = ITAB-POSNR.
ENDIF.
APPEND LS_DRAL TO LT_DRAL.
ENDLOOP.
**Setting the Drop down table for Reason Code
CALL METHOD G_GRID->SET_DROP_DOWN_TABLE
EXPORTING
IT_DROP_DOWN_ALIAS = LT_DRAL.
ENDFORM. " set_drdn_table
*& Form EVENT_TOP_OF_PAGE
* text
* -->DG_DYNDOC_ID text
FORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT.
"this is more clear.....check it
"first add text, then pass it to comentry write fm
DATA : DL_TEXT(255) TYPE C. "Text
* Populating header to top-of-page
CALL METHOD DG_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = 'Test Report'
SAP_STYLE = CL_DD_AREA=>HEADING.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move program ID
CONCATENATE 'Program Name :' SY-REPID
INTO DL_TEXT SEPARATED BY SPACE.
* Add Program Name to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move User ID
CONCATENATE 'User ID :' SY-UNAME INTO DL_TEXT SEPARATED BY SPACE
* Add User ID to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move count (no of records).
move v_lines to v_line.
CONCATENATE 'No of records :' v_line INTO DL_TEXT SEPARATED BY SPACE.
* Add Client to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move date
WRITE SY-DATUM TO DL_TEXT.
CONCATENATE 'Date :' DL_TEXT INTO DL_TEXT SEPARATED BY SPACE.
* Add Date to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
* Move time
WRITE SY-UZEIT TO DL_TEXT.
CONCATENATE 'Time :' DL_TEXT INTO DL_TEXT SEPARATED BY SPACE.
* Add Time to Document
PERFORM ADD_TEXT USING DL_TEXT.
* Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
* Populating data to html control
PERFORM HTML.
ENDFORM. " EVENT_TOP_OF_PAGE
*& Form ADD_TEXT
* To add Text
FORM ADD_TEXT USING P_TEXT TYPE SDYDO_TEXT_ELEMENT.
* Adding text
CALL METHOD DG_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = P_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING.
ENDFORM. " ADD_TEXT
*& Form HTML
* text
FORM HTML.
DATA : DL_LENGTH TYPE I, " Length
DL_BACKGROUND_ID TYPE SDYDO_KEY VALUE SPACE. " Background_id
* Creating html control
IF DG_HTML_CNTRL IS INITIAL.
CREATE OBJECT DG_HTML_CNTRL
EXPORTING
PARENT = DG_PARENT_HTML.
ENDIF.
* Reuse_alv_grid_commentary_set
CALL FUNCTION 'REUSE_ALV_GRID_COMMENTARY_SET'
EXPORTING
DOCUMENT = DG_DYNDOC_ID
BOTTOM = SPACE
IMPORTING
LENGTH = DL_LENGTH.
* Get TOP->HTML_TABLE ready
CALL METHOD DG_DYNDOC_ID->MERGE_DOCUMENT.
* Set wallpaper
CALL METHOD DG_DYNDOC_ID->SET_DOCUMENT_BACKGROUND
EXPORTING
PICTURE_ID = DL_BACKGROUND_ID.
* Connect TOP document to HTML-Control
DG_DYNDOC_ID->HTML_CONTROL = DG_HTML_CNTRL.
* Display TOP document
CALL METHOD DG_DYNDOC_ID->DISPLAY_DOCUMENT
EXPORTING
REUSE_CONTROL = 'X'
PARENT = DG_PARENT_HTML
EXCEPTIONS
HTML_DISPLAY_ERROR = 1.
IF SY-SUBRC NE 0.
MESSAGE I999 WITH 'Error in displaying top-of-page'(036).
ENDIF.
ENDFORM. " HTML
Regards
vijay -
How can we use cl_gui_html_viewer in a background process.
Hello,
Refering to this thread: Pie chart using Class cl_igs_chart ??
How can we use cl_gui_html_viewer in a background process.
I want to execute a html code in bakground process in abap program.
but using cl_gui_html_viewer I have an error with CNTL_ERROR in the method CONSTRUCTOR;
ThanksMarie,
I don't know about HTML viewer specifically, but whenever a GUI object is needed to be used in background, there is a standard method to avoid CNTL_ERROR.
When a program runs in background, there is no "screen" and hence no GUI, and hence a custom control can not be displayed. That is why the program generates an error.
The trick is to avoid creating the custom control in background.
if sy-batch = 'X'. "background mode
* We don't want to create the custom control
else. "dialog mode
create object l_container exporting ...
endif.
* We really don't need a container for using CL_GUI_ objects
* Proceed with the normal coding
create object l_html_viewer
exporting
parent = l_container
Maybe you are looking for
-
I'm new at SSRS 2008 R2. I need to return a value from PERCENT_NUM if DESCRIPTION = 'x'. PERCENT_NUM is a numeric field and DESCRIPTION is a string field. The DESCRIPTION field has multiple items that I need to turn into columns then list the equi
-
Can I use the same Apple ID for iMessage and FaceTime services simultaneously on two different devices - iPhone and iPad? It seems those are competing to each other, and the services work on one of them only (iPhone).
-
BI Admin Cockpit - only for myself system(BI)...?
Dear Gurus, We are implementing BI admin cockpit in our BI system. u2022 When we are installing BI content two datasources, transformations, Info Packages has been installed for every cube -one for myself system(BI) and another one is for EC
-
Hello all why every server have a capture Process have this problem "High Disk I/O" ??? in all configurations , transactions load (high or low) , number of connections (high or low) i try to keep server without any transactions or any connections for
-
OS X 10.6.8 updates not visible from Server 10.6.8 SUS
SUS downloads, copies, and enables all updates from 10.4 to 10.9, but clients can't see any of the updates. I've pointed a client on 10.6.8 using: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL http://<MyCatalogIP>:8088/