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: 

Custom Control - Saving the content of the text-field

Former Member
0 Kudos

Hi

I've made a text-field using Custom Control and I'm using the class CL_GUI_TEXTEDIT and this method to get the entered text:

<i> call method editor_660->get_text_as_stream

importing

text = text_tab.

</i>

Unfortunately I thought that it would be easy to store the text of a length 512 for each customer in a table. But that's not working as the table does not have the ability to store a line that long.

If I look in the sample programs of SAP (DEMO_CUSTOM_CONTROL) there's never a text really stored in the DB.

<b>Would any one have an idea where and how I could store this text?</b> I would like to use it with the kunnr as key. So that it would be possible to find the text belonging to a customer and to display it in the dynpro.

Thank you very much for your help!!

Petra

1 ACCEPTED SOLUTION

Former Member
0 Kudos

If its a custom table, I don't see why it can't store a field of length 512. There are other ways to store lines as well. One of the common one is :

Table

a) Key1 - Primary Key part 1

b) Line no - Primary Key part 2

c) Text

so if your text has length 512, and you would like to store in parts, then you can do it. For example, lets take text has length 80. Use function module RKD_WORD_WRAP , give length 80, you have an internal table, generate the line numbers and store the values. A breeze 😛

Hope it helps.

Regards,

Subramanian V.

3 REPLIES 3

Former Member
0 Kudos

If its a custom table, I don't see why it can't store a field of length 512. There are other ways to store lines as well. One of the common one is :

Table

a) Key1 - Primary Key part 1

b) Line no - Primary Key part 2

c) Text

so if your text has length 512, and you would like to store in parts, then you can do it. For example, lets take text has length 80. Use function module RKD_WORD_WRAP , give length 80, you have an internal table, generate the line numbers and store the values. A breeze 😛

Hope it helps.

Regards,

Subramanian V.

0 Kudos

Thank you already very much for your answer..

With this method: GET_TEXT_AS_STREAM from the class: CL_GUI_TEXTEDIT

I get in my program a text-stream back of the lenght 512.

And if possible I would like to save this text in one lenght somewhere, so that I would not have to split it up in several parts. But I don't know if this is possible.

As I wanted to create a DB-table, with a field of the length 512, it could not be activated, as tables take only fields of the length maximum 255.

Do you got any idea, to save it with this length or do I really have to split the text up into several parts?

Thanks

Petra

0 Kudos

Check this table, EDID4. It has a field SDATA of length 1000.

Regards,

Subramanian V.