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: 

How to save multiple lines from text editor to ztable in database?

Former Member
0 Kudos
478

Dear Experts,

   i have created one text editor for a field name Project Description. as i  can save the data in my z-table whatever i am writing in the editor in 1 line.

  But whenever i am writing anything in the editor in multiple lines the data is not being saved in the z-table for all the lines.

   Suppose i am writing the details of the field ( Project Description) in multiple lines,but in the table only the last line data is being stored.As i am new to this problem please help me out to resolve this.

8 REPLIES 8

JL23
Active Contributor
0 Kudos
128

It pretty much looks like any line is written, but the next line is overwriting he prior written.

maybe your z-table does not have a key to support several lines.

maybe you do not fill this key properly, if available

0 Kudos
128

what is your Z-table design, its its only having the Project ID and may be Language for your Description, then you need to add one more field like counter as a part of primary key which you have to generate within your code for multi-line data save

Former Member
0 Kudos
128

Dear Jurgen,

   How do i do this????please help me to solve...

JL23
Active Contributor
0 Kudos
128

tell how your table looks, tell how your coding for this update looks,

then I (or somebody else) maybe able to tell what is wrong

Former Member
0 Kudos
128

Before saving in the ztable, try to concatenate the lines from your text editor to the ztable-field then append.

0 Kudos
128

Dear Mark,

  As it is not defined that how many lines can used by an user...so could you tell me that how is it possible to concatenate the lines as i have to declare those as variables in my program......

Thanks in advance.....

0 Kudos
128

Rather than saving text in a user table, why not use FMs such as CREATE_TEXT, SAVE_TEXT, etc. they're meant for this purpose and well documented.

Rob

former_member230486
Contributor
0 Kudos
128

Hi,

You just follow the below code,

data:  o_edit TYPE REF TO cl_gui_textedit,

           text_tab_1 LIKE STANDARD TABLE OF line.

CALL METHOD o_edit->set_text_as_r3table

              EXPORTING

                table           = text_tab_1.

From this text_tab_1 internal table to database table(ztable) by using Modify statement.