Application Development 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: 

error in GUI_DOWNLOAD

Former Member
0 Kudos

hi everybody

do u know why we get the error "Error Calling Data Provider" when downloading a file using the fm 'GUI_DOWNLOAD

1 ACCEPTED SOLUTION

agnihotro_sinha2
Active Contributor
0 Kudos

kindly post the FM portion of ur code...

9 REPLIES 9

Former Member
0 Kudos

check for the internal table declaration how did u did that

0 Kudos

the internal table is text

the internal table consists of a field which is type c of 1000 characters

former_member1245113
Active Contributor
0 Kudos

HI Anjali

Please check the file is available and the format and the parameters that you passed which really can reflect the file name provided.

Regards

Ramchander Rao.K

agnihotro_sinha2
Active Contributor
0 Kudos

kindly post the FM portion of ur code...

0 Kudos

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

FILENAME = l_file

FILETYPE = 'ASC'

TABLES

DATA_TAB = it_line

  • FIELDNAMES =

EXCEPTIONS

FILE_WRITE_ERROR = 1

OTHERS = 22

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

0 Kudos

HI

data: begin of text_lines occurs 100,
line(150),
end of text_lines.

data: fname type string.

parameters: p_local like rlgrap-filename.

*fill in the internal table text_lines ... with data ... 

fname = p_local.

call function 'GUI_DOWNLOAD'
exporting
filename = fname
filetype = 'ASC'
tables
data_tab = text_lines    ' passing here 
exceptions
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
others = 22.


if sy-subrc = 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO 
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. 
endif.

Ranga

former_member404244
Active Contributor
0 Kudos

Hi,

put a break point in the FM 'DP_GET_STREAM_FROM_URL'. and see..

Regards,

Nagaraj

Former Member
0 Kudos

if u dont mind can u send me code.

let me check it once .

thanks&regards

meena.

I355602
Advisor
Advisor
0 Kudos

Hi Sia Anjali,

Use this code to download your records into a text file (.txt).

Its working.

REPORT Z_VENDRP.

***********************************************Type declaration****************************************************

TYPES : BEGIN OF VENDOR,

LIFNR LIKE RF02K-LIFNR,

BUKRS LIKE RF02K-BUKRS,

EKORG LIKE RF02K-EKORG,

KTOKK LIKE RF02K-KTOKK,

ANRED LIKE LFA1-ANRED,

NAME1 LIKE LFA1-NAME1,

SORTL LIKE LFA1-SORTL,

LAND1 LIKE LFA1-LAND1,

SPRAS LIKE LFA1-SPRAS,

WAERS LIKE LFM1-WAERS,

END OF VENDOR.

************************************************************************************************************************

******************************************Internal Table declaration***********************************************

DATA : VENDOR_TAB TYPE STANDARD TABLE OF VENDOR INITIAL SIZE 10 WITH HEADER LINE.

************************************************************************************************************************

START-OF-SELECTION.

***************************************Select query into internal table********************************************

SELECT ALIFNR BBUKRS CEKORG AKTOKK AANRED ANAME1 ASORTL ALAND1 ASPRAS CWAERS

FROM ( LFA1 AS A JOIN LFB1 AS B ON ALIFNR = BLIFNR )

JOIN LFM1 AS C ON ALIFNR = CLIFNR

INTO TABLE VENDOR_TAB.

************************************************************************************************************************

*********************************Use GUI_DOWNLOAD Function Module***************************************

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = 'C:/Vendors1.txt' "File name

FILETYPE = 'DAT' "File type

TABLES

DATA_TAB = VENDOR_TAB. "internal table (data to be passed)

IF SY-SUBRC <> 0.

ENDIF.

************************************************************************************************************************

Hope this solves your problem.

Thanks & Regards.

Tarun Gambhir.