2009 Aug 27 10:29 AM
i have requirement to capture employee remarks on text editor.when i enter other employee id it is not deleting previous emplyee
remarks.i want delete previous remarks.how can i achieve this one?
i have create texteditor using below code:
IF p_cust_cont IS INITIAL.
CREATE OBJECT p_cust_cont
EXPORTING
container_name = p_cont_textedit
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6
.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Create obejct for the TextEditor control
CREATE OBJECT p_text_edit
EXPORTING
wordwrap_mode =
cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_position = c_line_length
wordwrap_to_linebreak_mode = cl_gui_textedit=>true
parent = p_cust_cont
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
gui_type_not_supported = 5
OTHERS = 6
.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
kindly need your help.....
thanks....
Ram
i have requirement to capture employee remarks on text editor.when i enter other employee id it is not deleting previous emplyee
remarks.i want delete previous remarks.how can i achieve this one?
i have create texteditor using below code:
IF p_cust_cont IS INITIAL.
CREATE OBJECT p_cust_cont
EXPORTING
container_name = p_cont_textedit
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6
.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Create obejct for the TextEditor control
CREATE OBJECT p_text_edit
EXPORTING
wordwrap_mode =
cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_position = c_line_length
wordwrap_to_linebreak_mode = cl_gui_textedit=>true
parent = p_cust_cont
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
gui_type_not_supported = 5
OTHERS = 6
.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
kindly need your help.....
thanks....
Ram
2009 Aug 27 1:54 PM
Hi,
You are creating text editor correcly and providing user input
but the thing is that against ecah employee u need to create a text name to save these editor commnets by using save_text and while retreiving use read_text for getting the comments against particular employee.
Check out dis link:
/people/smita.gupta/blog/2009/03/17/an-insight-of-text-objects
2009 Aug 27 2:35 PM
In PBO you need to use method set_text_as_r3table , while in PAI get_text_as_r3table only if EE hasn't changed. If entry changes then you simply clear the content and PBO will show empty text.
DATA: r_textedit TYPE REF TO cl_gui_textedit,
r_cont TYPE REF TO cl_gui_custom_container.
DATA: itab TYPE TABLE OF char255.
DATA: eename(10) TYPE c,
prev_eename(10) TYPE c.
CALL SCREEN 100.
MODULE pbo OUTPUT.
IF r_cont IS INITIAL.
CREATE OBJECT r_cont
EXPORTING
container_name = 'CUSTOM_CONTROL'.
CREATE OBJECT r_textedit
EXPORTING
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
parent = r_cont.
ENDIF.
CALL METHOD r_textedit->set_text_as_r3table
EXPORTING
table = itab.
ENDMODULE. "pbo OUTPUT
MODULE pai INPUT.
REFRESH itab.
IF prev_eename is not INITIAL and
eename = prev_eename.
CALL METHOD r_textedit->get_text_as_r3table
IMPORTING
table = itab.
ENDIF.
prev_eename = eename.
ENDMODULE. "pai INPUT
Regards
Marcin
2009 Aug 27 3:00 PM
I understood your question a little bit differently (it's important to be very accurate about the context).
I understood that you display the screen with a given text, leave the screen (not the program), enter again the same screen but with a new text, and it displays the previous text.
You must free the control in the PAI when you leave the screen (both call control "free" method, and free the object in memory).
2009 Aug 28 5:05 AM
Hi,
When ever you reach a new employee. you should refresh the content in the table you use for displaying and update the new content.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = WA_HEADER_OP-TDID
LANGUAGE = WA_HEADER_OP-TDSPRAS
NAME = WA_HEADER_OP-TDNAME
OBJECT = WA_HEADER_OP-TDOBJECT
TABLES
LINES = I_LINES_OP
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
IF SY-SUBRC <> 0.
ENDIF.
IF SY-UCOMM EQ 'PRV'
OR SY-UCOMM EQ 'NXT'.
REFRESH G_MYTABLE.
ENDIF.
IF G_MYTABLE[] IS INITIAL.
LOOP AT I_LINES_OP.
CLEAR WA_MYTABLE.
WA_MYTABLE = I_LINES_OP-TDLINE.
APPEND WA_MYTABLE TO G_MYTABLE.
ENDLOOP.
CALL METHOD G_EDITOR->SET_TEXT_AS_R3TABLE
EXPORTING
TABLE = G_MYTABLE.
ENDIF.
regards
Ramesh
2011 Jun 16 8:07 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |