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 calling data provider

Former Member
0 Kudos

Hi All,

I am having an issue while converting a SAP script to PDF.

Functionality is somewhat like this: Scripts output is generated and when user presses back button, it displays the file save dialog screen, user enters the name and path to be saved when save button is clicked, it gives "Error Calling data provider"which is a SY-SUBRC = 14 of Function module GUI_DOWNLOAD.

Code is somewhat like this:

data t_pdf like tline occurs 0 .
  data t_doctab like  docs occurs 0 .
  data fsize type i .


  

call function 'CONVERT_OTF_2_PDF'

  • EXPORTING

  • USE_OTF_MC_CMD = 'X'

  • ARCHIVE_INDEX =

importing

bin_filesize = fsize

tables

otf = t_otfdata

doctab_archive = t_doctab

lines = t_pdf

exceptions

err_conv_not_possible = 1

err_otf_mc_noendmarker = 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.

  • Download to local file

if not t_pdf[] is initial .

DATA: l_filename1 TYPE string,

l_filen TYPE string,

l_path TYPE string,

l_fullpath TYPE string,

l_usr_act TYPE I.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG

IF sy-subrc = 0

AND l_usr_act <>

CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE = fsize

FILENAME = l_fullpath

FILETYPE = 'BIN'

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

NO_AUTH_CHECK = 'X'

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • WRITE_EOL = ABAP_TRUE

  • IMPORTING

  • FILELENGTH =

TABLES

DATA_TAB = t_pdf[]

  • FIELDNAMES =

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

.

ENDIF.

  • End of changes by TSOSSKUMAR change request <DV2K945761>

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

endif .

Edited by: shekhar tagra on Aug 26, 2009 4:37 PM

Edited by: shekhar tagra on Aug 26, 2009 4:38 PM

Edited by: shekhar tagra on Aug 26, 2009 4:39 PM

Edited by: shekhar tagra on Aug 26, 2009 4:41 PM

1 REPLY 1

former_member192723
Active Participant
0 Kudos

Hi

Please check if you are missing '\' character after directory name and before file name in file path. I resolved this issue keeping '\' character after directory name in path.

Thanks

Shravan