Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

Home arrow Sample Code arrow Control Objects arrow Using the Text Edit Control
Using the Text Edit Control PDF Print E-mail
User Rating: / 1
PoorBest 
Sample Code - Control Objects
Written by Kevin Wilson   
Wednesday, 07 February 2007

This sample code shows you the parts that are needed to get the TextEdit control object working on a dialog screen.

ABAP Objects: Introduction to Programming SAP ApplicationsSams Teach Yourself ABAP/4 in 21 DaysABAP/4, Second Edition: Programming the SAP(R) R/3(R) System (2nd Edition)
ABAP Objects: Introduction to Programming S...
by Horst Keller
$51.48
Sams Teach Yourself ABAP/4 in 21 Days
by Ken Greenwood
ABAP/4, Second Edition: Programming the SAP...
by Bernd Matzke
$48.9

 

 

 

PBO

if editor1 is initial

*   create control container

  create object textedit_custom_container1

      exporting

          container_name = 'TEXTEDITOR1'

      exceptions

          cntl_error = 1

          cntl_system_error = 2

          create_error = 3

          lifetime_error = 4

          lifetime_dynpro_dynpro_link = 5.

  if sy-subrc ne 0.

*      add your handling

  endif.

 

 

*   create calls constructor, which initializes, creats and links

*    a TextEdit Control

  create object editor1

    exporting

       parent = textedit_custom_container1

       wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position

       wordwrap_position = line_length

       wordwrap_to_linebreak_mode = cl_gui_textedit=>true

    exceptions

        others = 1.

 

endif.   “End of EDITOR1 is initial

 

  SELECT * FROM znotes INTO CORRESPONDING FIELDS OF wa_mytable

    where qmnum = zpcr-qmnum.

        append wa_mytable to mytable1.

  ENDSELECT.

 

  CALL METHOD editor1->set_selected_text_as_r3table

    EXPORTING

      table                         = mytable1

    EXCEPTIONS

      error_dp                      = 1

      error_dp_create               = 2

      OTHERS                        = 3.

  IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  ENDIF.

 

 

PAI on SAVE

      refresh: mytable1.

      CALL METHOD editor1->get_text_as_r3table

                IMPORTING

                    table = mytable1

                EXCEPTIONS

                    OTHERS = 1.

DATA

constants: line_length type i value 52.

 

*** Variables

data: editor1 type ref to cl_gui_textedit,

*     reference to custom container: necessary to bind TextEdit Control

   textedit_custom_container1 type ref to cl_gui_custom_container.

 

* define table type for data exchange

types: begin of mytable_line,

         line(line_length) type c,

       end of mytable_line.

 

* table to exchange text

types: mytable type standard table of mytable_line initial size 0.

 

data: mytable1 type mytable,

      wa_mytable type mytable_line.


Related Items:

Last Updated ( Wednesday, 18 April 2007 )
 
< Prev   Next >

Google Search

Google Ads