Application Development 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: 

textedit(notebox)

former_member397321
Participant
0 Kudos

Hi experts.

I need your help.

how can I catch value in textedit(notebox) and save it in my ztable.

I'm looking forward to hearing from you.

kind regards.

11 REPLIES 11

Former Member
0 Kudos

Hi,

Can you provide some more details of your issue. is it long text?

Thanks,

Sree

former_member397321
Participant
0 Kudos

ok.

it is long text, it is a comment, I have provided it like Demo of text edit.

kind regards

Former Member
0 Kudos

Hi Elina,

           Are you using custom screen?

          if yes it will be helpful to you. create a button in screen having fctcode-'P1'(lets assume)

if you click on the button it will trigger the PBI Event.. write the below code in PAI Event.

  IF sy-ucomm = 'P1'.

    CALL FUNCTION 'TERM_CONTROL_EDIT'

   EXPORTING

     titel                    = 'Comments'

     LANGU                = sy-langu

    TABLES

    textlines            = it_note1

   EXCEPTIONS

     user_cancelled       = 1

     OTHERS               = 2

            .

  ENDIF.

it_note1  TYPE TABLE OF TXW_NOTE  WITH HEADER LINE.

and before saving the data

    LOOP AT it_not1.

      CONCATENATE <wa-fieldnam> it_not1-line INTO <wa-fieldnam> SEPARATED BY ' '.

    ENDLOOP.

if it helps give me a feedback  i will help you whole code..

Thanks

Pedda Raju Jogi

rosenberg_eitan
Active Contributor
0 Kudos

Hi,


Have you consider using the standard sap function to read and save your text ?

function 'READ_TEXT'

Using cl_gui_textedit or function EDIT_TEXT

function 'SAVE_TEXT'

You can create your own user texts.

Try SO10 .

Regards.

raymond_giuseppi
Active Contributor
0 Kudos

Did you use CL_GUI_TEXTEDIT or did you use FM EDIT_TEXT or EDIT_TEXT_INLINE ?

If you use class, in PAI of program, you can use method get_text_as_r3table to get the text in an internal table. In every case; you can then save it to database with FM SAVE_TEXT.

NB: First create Text object and Id in transaction SE75, then read BC SAPscript: Printing with Forms, SAPscript Function Modules.

Regards,

Raymond

former_member397321
Participant
0 Kudos

code of creating and call textedit is above:

repid = sy-repid.

*   create control container

  CREATE OBJECT container

    EXPORTING

      container_name = 'TXT_COMENT'

    EXCEPTIONS

      OTHERS         = 1.

  IF sy-subrc NE 0.

*    add your handling

  ENDIF.

* create calls constructor, which initializes, creats and links

* TextEdit Control

  CREATE OBJECT editor

    EXPORTING

      parent                     = container

      wordwrap_mode              = cl_gui_textedit=>wordwrap_at_fixed_position

      wordwrap_position          = g_line_length

      wordwrap_to_linebreak_mode = cl_gui_textedit=>true.

* register editor for event dblclick

  CALL METHOD editor->register_event_dblclick

    EXPORTING

      appl_event = 'X'.

* Create the event_receiver object and set the handlers for the events

* of the control

  CREATE OBJECT event_receiver.

  SET HANDLER event_receiver->event_handler_dblclick

              FOR editor.

* set status text of control

  CALL METHOD editor->set_status_text

    EXPORTING

      status_text = text-011.

* set new pf-status

*  SET PF-STATUS 'MAIN100'.

* to manage back

  nothing_displayed = 1.

wish that will clarify my doubt

0 Kudos

Hi expert,

so with this code I could provide the text edit in my screen, but what I want is to save that text I have introduced in my ztable.

kind regards

0 Kudos

Hi,

We have method in CL_GUI_TEXTEDIT class, by using below methos you can capture the text information.

types : begin of ty_text,

       text(50) type c,

      end of ty_text.

data : it_text type standard table of ty_text,

       wa_text type ty_text.


    call method editor->get_text_as_r3table

*    EXPORTING

*      ONLY_WHEN_MODIFIED     = FALSE

           importing

             table                  = it_text

*      IS_MODIFIED            =

*    EXCEPTIONS

*      ERROR_DP               = 1

*      ERROR_CNTL_CALL_METHOD = 2

*      ERROR_DP_CREATE        = 3

*      POTENTIAL_DATA_LOSS    = 4

*      others                 = 5

                 .

      if sy-subrc <> 0.

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

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

      endif.


After capturing this value you can save this information in your custom table.


Hopes it helps you.


Thanks,

Ashok.

Former Member
0 Kudos

you can use GET_TEXT_AS_R3TABLE method of cl_gui_textedit c lass

former_member397321
Participant
0 Kudos

Hi experts,

hope this email finds you well,

I have called the method editor->get_text_as_r3table, in my PAI module when save buttom, but i can't get the text i have wrote in the note box.


I think something is missing.

note box is there but i want to save it's content in the table.



kind regards.

0 Kudos

Hi,

Can you please share your code.

Thanks,

Ashok.