04-17-2007 5:47 AM
Hi SDN,
I am having a requirement that i has to convert a table control into text editor in modulepool programming.
so the user enters a long text in the converted text editor , it should be read from the editor and should be saved in a custom table.
i had seen some posts in SDN regarding my doubt, but most of them suggested to use custom control instead of table control, but i cant use a custom control because the requirement was given as table control only.
please help me , how to convert a table control into a test editor?
is there are any datatype that can store upto 2000 characters?
Thanks,
Phani.
06-28-2007 8:20 AM
06-28-2007 8:20 AM
07-04-2007 9:46 AM
Dear Phani,
I am now facing a similar situation, can you please pass your code. I have to store 20 email addresses seperated by comma. I declared string datatype in the database table. But while displaying the data on the table control, it is displaying only 255 chrs. It is best method if i can display an editor and pull all the email addersses, and show them on editor and upon they modify, i will update the changes to the database. Please help me, very urgent.
Regardss
Sravanthi
09-11-2007 3:24 PM
Hello sravanthi,
i saw the reply what u gave .
i am enclosing with the code.
it might help you if your reuirement is not closed.
declare a table control ,
data : begin of g_t_text occurs 0,
text(255),
end of g_t_text.
remove the vertical and horizontal parameters in the attributes of the table control
append 20 to 30 empty lines in the internal table
PROCESS BEFORE OUTPUT.
MODULE status_1002.
LOOP AT g_t_text WITH CONTROL tabcntrl
CURSOR tabcntrl-current_line.
MODULE lines_tabcntrl.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT g_t_text.
CHAIN.
FIELD g_t_text-text MODULE read_tabcntrl.
ENDCHAIN.
ENDLOOP.
MODULE user_command_1002.
&----
*& Module lines_tabcntrl OUTPUT
&----
text
----
MODULE lines_tabcntrl OUTPUT.
DESCRIBE TABLE g_t_text LINES g_f_line.
IF tabcntrl-current_line >= 4.
SET CURSOR FIELD 'G_T_TEXT-TEXT' LINE 1."sy-stepl.
ENDIF.
ENDMODULE. " lines_tabcntrl OUTPUT
&----
*& Module read_tabcntrl INPUT
&----
text
----
MODULE read_tabcntrl INPUT.
MODIFY g_t_text INDEX tabcntrl-current_line.
ENDMODULE. " read_tabcntrl INPUT
check the above logic.
Regards,
phani.