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

GUI_UPLOAD returning only 256 character input

Former Member
0 Likes
3,961

Hi,

I have read in multiple threads that GUI_UPLOAD allows you to upload data more than 256 chars unlike other function modules.

But when I am trying to use GUI_UPLOAD, it is fetches only characters till 256th character. I want to upload a long text which spans about 4000 characters.

Could you please help me as to how to use GUI_UPLOAD for this?

Thank you.

Regards,

Gayatri

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,108

Greetings,

In the debugger, change the mode of your table. You should be able to see all the characters, though the system will only show limited number of characters (I guess only certain number of lines).

Hope this helps.


Happy Coding!!!



Cheers

Naavy

Hi,

I have read in multiple threads that GUI_UPLOAD allows you to upload data more than 256 chars unlike other function modules.

But when I am trying to use GUI_UPLOAD, it is fetches only characters till 256th character. I want to upload a long text which spans about 4000 characters.

Could you please help me as to how to use GUI_UPLOAD for this?

Thank you.

Regards,

Gayatri

9 REPLIES 9
Read only

LukaszPegiel
SAP Champion
SAP Champion
0 Likes
3,108

What code do you have, and where it fails?

Read only

0 Likes
3,108

My code works is executed properly. Just that, this FM does not upload input of more than 256 characters.

This is how I am calling it:

Input = CSV File

CALL METHOD cl_gui_frontend_services=>gui_upload

       EXPORTING

         filename                = g_fname

         filetype                = 'ASC'

         has_field_separator     = 'X'

       CHANGING

         data_tab                = i_table

       EXCEPTIONS

         file_open_error         = 1

         file_read_error         = 2

         no_batch                = 3

         gui_refuse_filetransfer = 4

         invalid_type            = 5

         no_authority            = 6

         unknown_error           = 7

         bad_data_format         = 8

         header_not_allowed      = 9

         separator_not_allowed   = 10

         header_too_long         = 11

         unknown_dp_error        = 12

         access_denied           = 13

         dp_out_of_memory        = 14

         disk_full               = 15

         dp_timeout              = 16

         not_supported_by_gui    = 17

         error_no_gui            = 18

         OTHERS                  = 19.

Read only

0 Likes
3,108

And what is your definition of i_table ?

Read only

0 Likes
3,108

How did you define i_table, I was unable to get the problem. (I used a TYPE TABLE OF STRING, and loaded without problems text of some thousands characters.)

Regards,

Raymond

Read only

rosenberg_eitan
Active Contributor
0 Likes
3,108

Try this:

You will need to parse the result in your program:

I use this code to UL XML file:

Read only

0 Likes
3,108

Hi Eitan,

This results in the error "bad_data_format" with sy-subrc = 8.

Read only

0 Likes
3,108

Hi,

Have you tried the code exactly as in the picture ?

The code is here:

Or here

Regards.

Read only

former_member197132
Participant
0 Likes
3,108

Hello Gayatri,


Please refer below steps for more than 256 char.

Step 1 .FM to convert String to xstring. (HR_KR_STRING_TO_XSTRING)

Step2 . FM to convert xstring to binary. (SCMS_XSTRING_TO_BINARY)

add the binary content in attachment and upload it via gui_upload

Read only

Former Member
0 Likes
3,109

Greetings,

In the debugger, change the mode of your table. You should be able to see all the characters, though the system will only show limited number of characters (I guess only certain number of lines).

Hope this helps.


Happy Coding!!!



Cheers

Naavy