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

Dump with GUI_UPLOAD

Former Member
0 Likes
1,344

Hi,

Can you please help with the following code. I am getting a dump when I execute.

Thanks,

Ven

REPORT Testreport.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.PARAMETERS: p_infile LIKE rlgrap-filenameDEFAULT 'C:\Users\nveni\Desktop\name.txt' OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b1.

DATA: gd_file TYPE string.
TYPES: BEGIN OF t_record,
name1 LIKE pa0002-vorna,
name2 LIKE pa0002-name2,
age TYPE i,

END OF t_record.
DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
wa_record TYPE t_record.
CALL FUNCTION 'GUI_UPLOAD'EXPORTING
filename = p_infile
filetype = 'ASC'
has_field_separator = ' '

TABLES
data_tab = it_recordEXCEPTIONS
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 = 16OTHERS = 17.IF sy-subrc NE 0.WRITE: 'Error ', sy-subrc, 'returned from GUI_UPLOAD FM'.SKIP.ENDIF.
END-OF-SELECTION.

LOOP AT it_record INTO wa_record.WRITE:/ sy-vline,(10) wa_record-name1, sy-vline,(10) wa_record-name2, sy-vline,(10) wa_record-age, sy-vline.ENDLOOP.i

4 REPLIES 4
Read only

ArthurParisius
Contributor
1,199

Please use the code button to format your code. Also it looks like it's not your complete code. I see an 'i' after the last loop.

It might also be useful to mention what dump you're actually getting.

Having said this it is most likely a type mismatch.

Instead of p_infile for the Filename parameter, try moving it to a string variable and use that variable.

Read only

Sandra_Rossi
Active Contributor
1,199

Please use the CODE button to format your code so that it's more user-friendly.

Please provide the full short dump.

Read only

1,199

change p_infile with gd_file below.

*** begin

gd_file = p_infile.

CALL FUNCTION 'GUI_UPLOAD'EXPORTING
filename = gd_file

*** end

Read only

Nawanandana
Active Contributor
0 Likes
1,199

Hi,

I modify your code kindly look at the attachment.

Regards,

Nawa.