‎2006 Sep 27 2:11 AM
Hi SDN, Rich Please respond ..! <b>ITS VERY URGENT</b>
i need a longtext in one of the table contol of my customised screen. the purpose of the screen is to create RFQ's where in user can enter LT ( just like the transaction IW32 - > Operations Tab - > LT Column. actually the LT in that table control is a button, pressing on which will take the user to an editor like SAP Script editor )
<b>how do i save this into my customised tables so taht i display the LT in the display screen for RFQ's</b>
This same LT created in RFQ Creation screen should be displayed to the users in another customised screens of RFQ Display / Change where the same functionality is needed.
Please help me in achieving this, i have been struggling from past few days, and this is very urgent.
i have been tryin the same with the fm's edit_text and read_text, but am not clear on these fm's related to HEADER in the importing parameters of the fm.
is this wrong? or is there any other way to achieve my requirement?
Please HELP
Pratyusha
‎2006 Sep 27 3:58 AM
Hi,
Check this code..To display the text in a text editor control..
First you have to create a custom control in your screen painter and name it as CONTAINER1..
Then apply this code..
TYPES: BEGIN OF type_text,
line(70),
END OF type_text.
DATA: t_texttable1 TYPE STANDARD TABLE OF type_text.
DATA: custom_container TYPE REF TO cl_gui_custom_container,
editor TYPE REF TO cl_gui_textedit,
repid LIKE sy-repid.
repid = sy-repid.
CALL SCREEN '0100'.
*&----
*& Module STATUS_0100 OUTPUT
*&----
text
*----
MODULE status_0100 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
PERFORM delete_container.
*- Container franchise codes
IF editor IS INITIAL.
repid = sy-repid.
CREATE OBJECT custom_container
EXPORTING
container_name = 'CONTAINER1'
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 OBJECT editor
EXPORTING
parent = custom_container
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_mode = cl_gui_textedit=>wordwrap_at_windowborder
wordwrap_position = '38'
wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
*- Eliminate toolbar
PERFORM toolbar.
ENDIF.
PERFORM load_data.
Load TextEdit control with texts
CALL METHOD editor->set_text_as_r3table
EXPORTING table = t_texttable1.
IF sy-subrc > 0.
Display an error message
EXIT.
ENDIF.
CALL METHOD cl_gui_cfw=>flush.
ENDMODULE. " STATUS_0100 OUTPUT
----
FORM delete_container *
----
........ *
----
FORM delete_container.
IF NOT editor IS INITIAL.
CALL METHOD editor->delete_text.
CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS
OTHERS = 1.
IF sy-subrc > 0.
Errormessage: Error in flush
ENDIF.
ENDIF.
ENDFORM. " delete_container
----
FORM toolbar *
----
........ *
----
FORM toolbar.
DATA: lv_toolbar_mode TYPE i VALUE 0.
CALL METHOD editor->set_toolbar_mode
EXPORTING
toolbar_mode = lv_toolbar_mode.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc > 0.
Errormessage: Error in flush
ENDIF.
ENDFORM. " toolbar
*&----
*& Form LOAD_DATA
*&----
text
*----
--> p1 text
<-- p2 text
*----
FORM load_data.
DATA: gwa_line TYPE type_text.
gwa_line-line = 'HELLO HOW ARE YOU!!!!!'.
APPEND gwa_line TO t_texttable1.
ENDFORM. " LOAD_DATA
*&----
*& Module USER_COMMAND_0100 INPUT
*&----
text
*----
MODULE user_command_0100 INPUT.
DATA: T_SAVE_TEXT TYPE STANDARD TABLE OF TLINE.
DATA: S_SAVE_tEXT TYPE TLINE.
DATA: S_TEXT TYPE TYPE_TEXT.
Load TextEdit control with texts
CALL METHOD editor->get_text_as_r3table
IMPORTING table = t_texttable1.
ENDMODULE. " USER_COMMAND_0100 INPUT
Hope this helps...
Thanks,
Naren
‎2006 Sep 27 4:12 AM
Hi Usha,
First thing you need to determine against which text id you want to save the Long Text, in ME42 if you go to item text of any line item there you will find the different long text, click on required long text then select GOTO->HEADER in the menu there you will find the Long text details which needs to be passed as a part of header.
Reagrds,
Arun.
‎2006 Sep 27 4:21 AM
Hi Arun,
Yes u r right, i knew this, but in order to create LT, whihc i use in cutomised screens and tables, what shud be the text id and other passing parameters?
Thanks
Pratyusha
‎2006 Sep 27 4:52 AM
Hi,
Try this options.
1)TDNAME = Concatenate Z + RFQ Number + Line Item Number
TDID = ST
TDOBJECT = TEXT
LANGUAGE = EN.
Need one clarification, are you not updating RFQ details into SAP standrad tables i.e EKKO and EKPO .
Regards,
Arun.
‎2006 Sep 27 5:18 AM
no i am not using any Standard tables are the tables i use are Ztables
Thanks
Pratyu
‎2006 Sep 27 5:38 AM
No problem, you can try this option and it is not rquired to save long text into custom tables.
In the header structure of FM edit_text fill the below details.
1)TDNAME = Concatenate Z + RFQ Number + Line Item Number
TDID = ST
TDOBJECT = TEXT
TDPRAS = EN.
TDLINESIZE = 70.
Regards,
Arun.
Regards,
Arun.
‎2006 Sep 27 6:21 AM
but when i try to display the LT of a RFQ, for which tehre is another customised screen to display / change of RFQ. i need to display the LT for items there. so plz suggest me.
‎2006 Sep 27 6:27 AM
You can make use of same header and call the FM EDIT_TEXT in display mode or change mode.
Regards,
Arun.