‎2009 Aug 20 11:26 AM
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.
‎2009 Aug 20 2:25 PM
Try this way:
APPEND '<HTML>< body style="background-color:#c3d9ff;" >' TO raw_html.
APPEND '</BODY></HTML>' TO raw_html.
check this http://html-color-codes.info/ for color information.
Regards,
Naimesh Patel
‎2009 Aug 20 2:28 PM
Hi Naimesh,
I have this coding in my report:
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.
where can I insert the background colour?
‎2009 Aug 20 2:47 PM
CALL FUNCTION 'DOC_OBJECT_GET_HTML'
EXPORTING
docuid = 'RE'
docuobject = sy-repid
TABLES
html_page = l_t_html_page.
"<- here
"just look for <BODY> tag inside table L_T_HTML_PAGE and modify it accordingly (as suggested by Naimesh)
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.
Regards
Marcin
‎2009 Sep 01 12:55 PM
How can I look to the body tag. Shall I have to modify the first line in the hmtl table?
‎2009 Sep 01 1:11 PM
Loop at the table, and check each line if
CS '<BODY>'
then use that line and statements FIND or SEARCH to get its position in a line. Next use offset specification to modify that <BODY ...> and finally modify entire line in table.
Regards
Marcin
‎2009 Sep 01 1:21 PM
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?
‎2009 Sep 01 1:51 PM
You can do it like
SEARCH it_html FOR 'BODY'.
IF sy-subrc = 0.
DELETE it_html INDEX sy-tabix. "sy-tabix automatically set by SEARCH
it_html = '< BODY style="background-color:#c3d9ff" TEXT="BLACK" LINK="BLUE" VLINK="#3366CC" ALINK="RED" >'.
INSERT it_html INDEX sy-tabix. "new style applies here
ENDIF.Regards
Marcin
‎2009 Sep 01 2:11 PM
Hello Marcin,
now I have this one:
LOOP AT l_t_html_page INTO l_r_html_page.
SEARCH l_r_html_page FOR 'BODY'.
IF sy-subrc = 0.
l_r_html_page-tdline = '<BODY BGCOLOR="WHITE" TEXT="GREEN" LINK="BLUE" VLINK="#3366CC" ALINK="RED">'.
MODIFY l_t_html_page FROM l_r_html_page.
CLEAR l_r_html_page.
ENDIF.
ENDLOOP.
and it works, thanks a lot.