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: 

upload_files FM

Former Member
0 Kudos

Hi Alll,

CALL FUNCTION 'UPLOAD_FILES'

EXPORTING

  • I_TRUNCLEN = ' '

I_FILETYPE =

I_XPC =

TABLES

FILE_ALL =

TAB_FILE =

  • EXCEPTIONS

  • ERROR_FILE = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

what we have to fill in all these parameters

in file all does I have to provide all the file names using comma or only a space.

1 ACCEPTED SOLUTION

kishorekumar_vemula
Active Participant
0 Kudos

Hi Ravi, i think you need to upload the files to table 'TAB_FILE' and not in 'FILE_ALL'.

check below code.


data :lt_rlgrap type table of  rlgrap,
         ls_rlgrap type rlgrap.

data : lv_xpc type RF02B-BANKXFPR value 'X'.
DATA : lt_itab TYPE standard table of BUT000.
 
data : asc type  RLGRAP-FILETYPE value 'ASC'.

PARAMETERS : p_file type rlgrap-filename default '<path>'. 
" above is to select the single file. 
" if you want to select multiple files the use select-options.
 
ls_rlgrap-filename = p_file.
append ls_rlgrap to lt_rlgrap.
" lt_rlgrap will hold the all files which you have selected 
 
CALL FUNCTION 'UPLOAD_FILES'
  EXPORTING
*   I_TRUNCLEN       = ' '
    i_filetype       = asc
    i_xpc            = lv_xpc
  tables
    file_all         = lt_itab     "data will be uploaded to this internal table
    tab_file         = lt_rlgrap.

Hope this is useful.

Edited by: Kishore Kumar Vemula on Aug 20, 2010 6:19 PM

Edited by: Kishore Kumar Vemula on Aug 20, 2010 6:22 PM

2 REPLIES 2

kishorekumar_vemula
Active Participant
0 Kudos

Hi Ravi, i think you need to upload the files to table 'TAB_FILE' and not in 'FILE_ALL'.

check below code.


data :lt_rlgrap type table of  rlgrap,
         ls_rlgrap type rlgrap.

data : lv_xpc type RF02B-BANKXFPR value 'X'.
DATA : lt_itab TYPE standard table of BUT000.
 
data : asc type  RLGRAP-FILETYPE value 'ASC'.

PARAMETERS : p_file type rlgrap-filename default '<path>'. 
" above is to select the single file. 
" if you want to select multiple files the use select-options.
 
ls_rlgrap-filename = p_file.
append ls_rlgrap to lt_rlgrap.
" lt_rlgrap will hold the all files which you have selected 
 
CALL FUNCTION 'UPLOAD_FILES'
  EXPORTING
*   I_TRUNCLEN       = ' '
    i_filetype       = asc
    i_xpc            = lv_xpc
  tables
    file_all         = lt_itab     "data will be uploaded to this internal table
    tab_file         = lt_rlgrap.

Hope this is useful.

Edited by: Kishore Kumar Vemula on Aug 20, 2010 6:19 PM

Edited by: Kishore Kumar Vemula on Aug 20, 2010 6:22 PM

0 Kudos

Thanks Kishore,

Your answer helped me to solve my requirement.

Thanks