2009 Mar 25 4:49 AM
Hi all,
i am using this fm to create a text editor. now i want to displaythe text in smartforms. how can i achieve this?
2009 Mar 25 5:01 AM
hi,
Pass the field containing saved text from 'CATSXT_SIMPLE_TEXT_EDITOR' to the smart form through form interface.
Regards,
Rishikesh
Hi all,
i am using this fm to create a text editor. now i want to displaythe text in smartforms. how can i achieve this?
2009 Mar 25 5:01 AM
hi,
Pass the field containing saved text from 'CATSXT_SIMPLE_TEXT_EDITOR' to the smart form through form interface.
Regards,
Rishikesh
2009 Mar 25 5:07 AM
hi,
there is no saved text.
the FM is:
CALL FUNCTION 'CATSXT_SIMPLE_TEXT_EDITOR'
EXPORTING
im_title = 'Enter your text here'
IM_DISPLAY_MODE = ' '
IM_START_COLUMN = 10
IM_START_ROW = 10
changing
ch_text = wa_ship.
and wa_ship is of type wa_ship type CATSXT_LONGTEXT_ITAB.
so when i define wa_ship in smartforms, i am getting an error as invalid type 'h'.
what do i need to do now?
2009 Mar 25 5:26 AM
Hi,
Decalre wa_ship type CATSXT_LONGTEXT_ITAB in tables declaration of your smartforms ..not in import...
Then create a table out_lines. " whose structure has component of length car 200 say..
Loop at out_lines " in your smarform.....
Create the text area where you want to paste this text...below it create a code...in it write..
DATA: w_text1(50000) TYPE c.
REFRESH: out_lines.
CLEAR w_text1.
LOOP AT wa_ship.
CONCATENATE w_text1 wa_ship INTO w_text1 SEPARATED BY space.
ENDLOOP.
CONDENSE: w_text1.
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
textline = w_text1
outputlen = '120'
TABLES
out_lines = out_lines
EXCEPTIONS
outputlen_too_large = 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.
Regards
Debarshi
Edited by: Debarshi Roy on Mar 25, 2009 11:02 AM
2009 Mar 25 5:30 AM
Data: fs_comment(72) TYPE c,
Itab like table of fs_comment .
CALL FUNCTION 'CATSXT_SIMPLE_TEXT_EDITOR'
EXPORTING
im_title = 'HEADER'
CHANGING
ch_text = ITAB.Internal table Itab will hold data for the editor.You can pass the internal table
to smartform through its Import parameter in Function module.
Regards,
Gurpreet
2009 Mar 25 5:38 AM
ok i have defined in tables. but ehat to define in the editor so that it should display in the smartform.???
2009 Mar 25 5:46 AM
Hi,
In your driver program you are calling ....
CALL FUNCTION 'CATSXT_SIMPLE_TEXT_EDITOR'
EXPORTING
im_title = 'Physical Appearance'
* IM_DISPLAY_MODE = ' '
im_start_column = 10
im_start_row = 10
CHANGING
ch_text = ch_text_1
.
ENDIF.
Then in you call function of smartform....
CALL FUNCTION fm_name
EXPORTING
TABLES
yqm_comb_table = <your internal table with values>
ch_text_1 = ch_text_1 " here goes your text
out_lines = out_lines " which is blank
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
Debarshi
2009 Mar 25 5:54 AM
2009 Mar 25 5:56 AM
Declare ...in your driver program
DATA: out_lines TYPE STANDARD TABLE OF <the type you created> WITH HEADER LINE.
Regards
Debarshi
2009 Mar 25 6:04 AM
i am still getting an error, as i have not mentioned what is out_lines in smartforms..
2009 Mar 25 6:08 AM
Declare in the table in form interface of your smartform....
OUT_LINES TYPE <table type>
Remember to create a table type with a line type having a component of type char of your desired length say 200....
Regards
Debarshi
2009 Mar 25 6:10 AM
i am literally very much confused and not getting what to do....
i am getting many errors now
wa_ship is a line type how can we loop it???.
Edited by: Poonam Naik on Mar 25, 2009 7:13 AM
2009 Mar 25 6:17 AM
Calm down....start form scratch.....
1st what you should do at first is create a check box...whenever it is ticked the text editor gets called...
for this do....
data : DATA : ch_text_1 TYPE catsxt_longtext_itab.
PARAMETERS: c_phyapp TYPE char1 AS CHECKBOX.
Now in your start-of-selection.
do...
IF c_phyapp EQ 'X'.
CALL FUNCTION 'CATSXT_SIMPLE_TEXT_EDITOR'
EXPORTING
im_title = 'Physical Appearance'
* IM_DISPLAY_MODE = ' '
im_start_column = 10
im_start_row = 10
CHANGING
ch_text = ch_text_1 " here the text you entered gets populated.....
.
ENDIF.
Ok till now?
Regards
Debarshi...
2009 Mar 25 6:24 AM
yes i ahve done this...
can i write that code in report which u asked me to write in smartforms?
2009 Mar 25 6:29 AM
2009 Mar 25 6:49 AM
ok.. now the final text is in out_lines table right????
so this i have to define in a cell i.e a column, so i have defined there &out_lines-tdline& because i have define out_lines as table tline.
but i am not getting any data displayed in smartforms but there is data in out_lines tables, i checked it thru debug.
2009 Mar 25 5:14 AM
HI,
u can use like this to create a text editor,
CREATE OBJECT cus_co
EXPORTING
container_name = 'CUSTOM_1'.
CREATE OBJECT scrpteditor
EXPORTING
parent = cus_co
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_position = 100
wordwrap_to_linebreak_mode = cl_gui_textedit=>true
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
gui_type_not_supported = 5
OTHERS = 6
.
scrpteditor->set_width( 73 ).
ENDIF.
IF lt_texts[] IS NOT INITIAL.
CALL METHOD scrpteditor->set_text_as_r3table
EXPORTING
table = lt_texts
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.
REFRESH lt_texts[].
ENDIF.
once the text editor is created the entered text will be saved and it will have an object ,id and name as u give.In the smartform then u create a text node and selet the text type as include text and give the name,object and id details,so that the entered text will be saved
2009 Mar 25 7:01 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |