Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

HTML type Texts in a Module Pool Screen

Former Member
0 Likes
1,305

Hi all experts,

I have to display some points in a part of a module pool screen. I dont have any idea on this, if anyone can give some example.

Thanks & Regards,

Rock.

1 ACCEPTED SOLUTION
Read only

kerem_kayacan
Active Participant
0 Likes
1,185

It is possible to view html pages with class CL_GUI_HTML_VIEWER in a custom control of a module pool screen.

9 REPLIES 9
Read only

kerem_kayacan
Active Participant
0 Likes
1,186

It is possible to view html pages with class CL_GUI_HTML_VIEWER in a custom control of a module pool screen.

Read only

0 Likes
1,185

Thanks for the reply Kerem Kayacan ,

I have created a custom container in my screen. I want to display some default data. How to achieve that using CL_GUI_HTML_VIEWER or any other class. Plz provide example code if possible.

Thanks & Regards,

Rock.

Read only

0 Likes
1,185

What default points you want to display? Is it dynamic points?

Gothrough some example program, if you want to display it in container

ITSQ_HTML_CONTROL

BCALV_DEMO_HTML

Read only

0 Likes
1,185

Thanks Tharani,

I have some STATIC data like "Welcome to SDN' for example, how to display that?

Thanks & Regards,

Rock.

Read only

0 Likes
1,185

Hi,

Kindly refer below link which display the footer data in HTML texts.

http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-ALVFooterinHTML+Display

And use the methods as per your requirement.

Thanks,

K.Tharani.

Read only

0 Likes
1,185

1: Create a container in your module pool screen with name "HTML_CONTROL".

2: Create object as below:Point this object to the module pool control using its name

data: html_control TYPE REF TO cl_gui_html_viewer,

my_container TYPE REF TO cl_gui_custom_container.

CREATE OBJECT my_container

EXPORTING

container_name = 'HTML_CONTROL'.

CREATE OBJECT html_control

EXPORTING

parent = my_container.

3: You can load image or text to module pool screen using this OBJECT reference only. An exaple for loading graphics is shown below:

CALL METHOD html_control->load_mime_object

EXPORTING

object_id = 'HTMLCNTL_TESTHTM2_SAPLOGO'

object_url = 'SAPLOGO.GIF'

EXCEPTIONS

OTHERS = 1.

ags.

Read only

0 Likes
1,185

HI,

In ur screen place a custom control (say with name CONTAINER )....

Check the below code.....

DATA : container   TYPE REF TO cl_gui_custom_container,
       text_editor TYPE REF TO cl_gui_textedit,
       lt_texttab  TYPE soli_tab.
 
CALL SCREEN 100. " Assuming ur screen no is 100
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
MODULE status_0100 OUTPUT.        "PBO MODULE
 
  SET PF-STATUS '001'.
 
  IF sy-ucomm EQ 'BACK'.
    LEAVE PROGRAM.
  ENDIF.
 
  CHECK container IS NOT BOUND.
 
  CREATE OBJECT container EXPORTING container_name = 'CONTAINER'.
 
  CREATE OBJECT text_editor EXPORTING parent            = container
                                      wordwrap_mode     = cl_gui_textedit=>wordwrap_at_windowborder.
 
***to put some text in the text editor.
 
  APPEND 'Welcome to SDN' TO lt_texttab.
 
  CALL METHOD text_editor->set_text_as_r3table
    EXPORTING
      table           = lt_texttab       " Contents of this table is displayed in text editor
    EXCEPTIONS
      error_dp        = 1
      error_dp_create = 2
      OTHERS          = 3.
  IF sy-subrc  0.
  ENDIF.
 
 
ENDMODULE.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
MODULE user_command_0100 INPUT.        "PAI MODULE
 
  CALL METHOD text_editor->get_text_as_r3table
    IMPORTING
      table           = lt_texttab       " Text tyed in editor gets collected in this table
    EXCEPTIONS
      error_dp        = 1
      error_dp_create = 2
      OTHERS          = 3.
  IF sy-subrc  0.
  ENDIF.
 
  BREAK-POINT. " Check the table lt_texttab
 
ENDMODULE.                 " USER_COMMAND_0100  INPUT

This is a simple example of text editor.

You can also use it to display test in your screen.

May it helps you.

Regards.

DS.

Edited by: deepaks sharma on Aug 5, 2010 10:12 AM

Read only

0 Likes
1,185

I think below SAP program does all that you want to do in your program:

SAPHTML_EVENTS_DEMO

Read only

0 Likes
1,185

Thanks Deepaks sharma, for your help and all others who spent time to reply this thread.