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

issue with the code for free trext

Former Member
0 Likes
576

Hi all

I have code for free text or long text in my module pool.

say my free text is in screen 102 and i am in screen 101.

i go to screen 102 and enter my text and come back to 101.

when i go back iam seeing the same text ,which i don't want. can anybody tell me what should i do .

this is my free text code.

do i need to clear editor ,mytable and refresh mytablewould solve my problem.

Thanks

if editor is initial.

CREATE OBJECT TEXTEDIT_CUSTOM_CONTAINER

EXPORTING

CONTAINER_NAME = 'TEXTEDITOR1'

EXCEPTIONS

CNTL_ERROR = 1

CNTL_SYSTEM_ERROR = 2

CREATE_ERROR = 3

LIFETIME_ERROR = 4

LIFETIME_DYNPRO_DYNPRO_LINK = 5.

IF SY-SUBRC NE 0.

  • add your handling

ENDIF.

CREATE OBJECT EDITOR

EXPORTING

PARENT = TEXTEDIT_CUSTOM_CONTAINER

WORDWRAP_POSITION = '85'

WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION

WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>FALSE

EXCEPTIONS

OTHERS = 1.

refresh mytable.

CLEAR MYTABLE.

FREE MYTABLE.

endif.

IF SY-SUBRC NE 0.

CALL FUNCTION 'POPUP_TO_INFORM'

EXPORTING

TITEL = V_REPID "--> program name

TXT2 = SPACE

TXT1 = 'Error in flush'.

ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
550

Hi swathi,

do something like this.

if not editor is initial.

CALL METHOD editor->DELETE_TEXT.

endif.

award points if helpful

thanks

venki

4 REPLIES 4
Read only

Former Member
0 Likes
550

Hi,

Destroy the container using the free method..

OR

Try refreshing the internal table for the text internal table and call the below method..

CALL METHOD editor->set_text_as_r3table

EXPORTING table = gt_text_table.

Thanks,

Naren

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
550

Everytime you enter the screen with the editor, you should initialize it. You can try using the DELETE_TEXT method.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
551

Hi swathi,

do something like this.

if not editor is initial.

CALL METHOD editor->DELETE_TEXT.

endif.

award points if helpful

thanks

venki

Read only

Former Member
0 Likes
550

Hi swathi,

do something like this.

if not editor is initial.

CALL METHOD editor->DELETE_TEXT.

endif.

award points if helpful

thanks

venki