Application Development and Automation 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: 
Read only

Dialog programming

ravi_sirigiri
Participant
0 Likes
592

in Dialog programming i have a text editor control, my requirement is: i am storing the longtext which is entered in that text editor control.I want to display different texts in it based upon the records which i have selected in the list.

Basic Flow:

Selection screen --> based on the selection screen, i will be getting the records in the alv format. If i select one record and click on a button on its gui status , it calls the texteditor control screen, in that i will enter some text and press save. it comes back to the previous screen which has the records again i select another record and press a button on the gui status,i will go to the screen again where i have the text editor control, in which i have to get the longtext which is been saved for that record. How is this possible.

when i am trying to do, its showing the same text for different records also.previous record text is not clearing.

can any one suggest and give a solution on this.it is working fine when i am coming out of the whole transaction.

5 REPLIES 5
Read only

Former Member
0 Likes
564

Ravi

In the PBO of the screen where you are displaying the saved text check if text exists - if yes then display the same, if no then it is fresh entry hence display empty box.

Check in PBO whether you are clearing the text editor based on condition above so that it wont show the same text again

Read only

0 Likes
564

Hi Girish,

I am clearing it, after i save and come out of that text editor screen.

thanks,

Ravi

Read only

naimesh_patel
Active Contributor
0 Likes
564

hello,

Whenever you save the text for any perticular line, save the primary key of that line as well. So, first search this table (primary key + text), if you find any entry show that into the editor based on the primary key (selected line).

Regards,

Naimesh

Read only

Laxmana_Appana_
Active Contributor
0 Likes
564

Hi,

check below code , use delete_text after get_text_as_r3table method.

CALL METHOD editor->get_text_as_r3table

IMPORTING

table = li_text_table

EXCEPTIONS

error_dp = 1

error_cntl_call_method = 2

error_dp_create = 3

potential_data_loss = 4.

CALL METHOD editor->delete_text

EXCEPTIONS

error_cntl_call_method = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CALL METHOD editor->set_text_as_r3table

EXPORTING

table = li_text_table

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.

I have done the coding using above methods which is exactly like your requirement , it is working fine for me.

Regards

Appana

Message was edited by: L Appana

Read only

0 Likes
564

Hi Appana,

i have not used the method get_text_as_r3table instead i have used GET_TEXT_AS_STREAM and i am deleteing the text with the same method : delete_text. what happens is for the new record the text of the text editor is not displaying. it is showing blank.

Thanks,

Ravi