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: 

Regarding GUI_UPLOAD

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi Friends

I am getting some error while downloading the data from my presentation server.

TYPES: BEGIN OF type_compensationawards,

pernr TYPE pspar-personid_ext,

subtype TYPE p0759-citem,

carea TYPE p0759-carea,

amount TYPE p0759-cpamt,

currency TYPE p0759-curre,

  • timeunit TYPE q0759-prfre,

effectivedate TYPE q0759-effdt,

END OF type_compensationawards.

DATA: it_compawards TYPE STANDARD TABLE OF type_compensationawards,

wa_compawards TYPE type_compensationawards.

DATA: lv_file TYPE string.

lv_file = p_file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = lv_file

filetype = 'ASC'

  • has_field_separator = 'X'

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • CHECK_BOM = ' '

  • VIRUS_SCAN_PROFILE =

  • NO_AUTH_CHECK = ' '

  • IMPORTING

  • FILELENGTH =

  • HEADER =

TABLES

data_tab = it_compawards

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

OTHERS = 17

.

IF sy-subrc <> 0.

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

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

ENDIF.

Here I am getting Sy-subrc = 8.

I tried with the file:

899910 07ls 10 3000 usd 010162007

What’s the wrong in my code?

Please correct me. If possible send me some sample files also.

Regards,

Sree

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi.

You have define the lv_file  as a string.

And you are trying to upload fileds defined as currency.

All your fields should be defined as char fields.

Bye

4 REPLIES 4

Former Member
0 Kudos

Hi,

Is your file data separated by a tab-delimiter? is the data in the same order of internal table declaration? Also do the size of the field and data match?

Regards,

Ramya

Former Member
0 Kudos

hi sree ram,

use the data in the notepad using tab.

like this....

899910 07ls 10 3000 usd 0101 62007.

regards,

venkat.

Former Member
0 Kudos

Hi.

You have define the lv_file  as a string.

And you are trying to upload fileds defined as currency.

All your fields should be defined as char fields.

Bye

0 Kudos

Hi

Issue is with the file format.Not with the program logic.

It's working now.