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

reg:gui_upload

Former Member
0 Likes
1,055

hello everyone,

can i use gui_upload in module pool programming.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,020

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.

7 REPLIES 7
Read only

Former Member
0 Likes
1,021

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.

Read only

0 Likes
1,020

Thank you susmitha. i want to upload some text file and display it in screen painter.is that possible if i use gui_upload.

Read only

0 Likes
1,020

Hi,

You want to display the file on screen painter?  can explain elaborately

Read only

0 Likes
1,020

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.

Read only

0 Likes
1,020

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'.

Read only

0 Likes
1,020

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

Read only

0 Likes
1,020

thank you sushmitha that was very helpful.