‎2013 Dec 10 6:49 AM
hello everyone,
can i use gui_upload in module pool programming.
‎2013 Dec 10 7:24 AM
Yes, you can.
GUI_UPLOAD just needs an active GUI to function. So you cannot run it in background.
But you can use it in module pool program, as long as it is executed in foreground.
‎2013 Dec 10 7:24 AM
Yes, you can.
GUI_UPLOAD just needs an active GUI to function. So you cannot run it in background.
But you can use it in module pool program, as long as it is executed in foreground.
‎2013 Dec 10 7:44 AM
Thank you susmitha. i want to upload some text file and display it in screen painter.is that possible if i use gui_upload.
‎2013 Dec 10 7:57 AM
Hi,
You want to display the file on screen painter? can explain elaborately
‎2013 Dec 10 7:59 AM
hello kiran
i want some long text to be displayed in screen painter.as we can not type long text diectly on screen painter i thought of upload the file.
‎2013 Dec 10 10:47 AM
Hi Maya,
Why dont you display in text edit control?
This is used to display long text in screen painter with various functions including word wrap.
You will find lot of sample codes in the net.
Create a custom control on screen with name say, 'TEXT_CONTAINER '.
In the code, add the following
TYPES: BEGIN OF text_area,
line(70),
END OF text_area.
DATA: t_texttable TYPE STANDARD TABLE OF type_area.
DATA: custom_container TYPE REF TO cl_gui_custom_container,
text_editor TYPE REF TO cl_gui_textedit.
MODULE status_0100 OUTPUT.
CREATE OBJECT CUSTOM_CONTAINER
EXPORTING
CONTAINER_NAME = 'TEXT_CONTAINER'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5.
CREATE OBJECT TEXT_EDITOR
EXPORTING
PARENT = CUSTOM_CONTAINER
WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
WORDWRAP_POSITION = 250
WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>TRUE.
To read the text in the text editor, implement the following in PAI.(First create a function code say 'SAVE' that triggers the PAI to read/save the inputted text.
WHEN 'SAVE'.
CALL METHOD TEXT_EDITOR->GET_TEXTSTREAM
* EXPORTING
* ONLY_WHEN_MODIFIED = CL_GUI_TEXTEDIT=>TRUE
IMPORTING
TEXT = TEXT
* IS_MODIFIED =
EXCEPTIONS
ERROR_CNTL_CALL_METHOD = 1
NOT_SUPPORTED_BY_GUI = 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.
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
MESSAGE TEXT TYPE 'I'.
‎2013 Dec 10 10:54 AM
Hi,
The 'text' is static or dynamic?
static text can be displayed by text edit control,
for dynamic text its a few steps more.
revert back if not clear.
JP
‎2013 Dec 10 11:03 AM