SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Using the Text Edit Control



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Fri Nov 23, 2007 10:14 pm    Post subject: Using the Text Edit Control Reply with quote

Code:
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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.