on 09-20-2005 6:30 AM
hi all
can anyone plz suggest the logic for uploading multiple files from desktop using function module upload or gui_upload.
the files are tab delimited. and can be more that 2 or 3 or 4.
so can anyone please suggest the logic for this
thanks
put file names in internal table and loop it around upload function
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Directly u cant achive multiple file upload..
but indirectly u can do like this..
In this also u hv to select file one by one..but the thing is if u select one file it will automatically show the popup for next file...and goes on..one u press cancel the process stops...all the file names with full path in stored in itab...using that u can loop & upload...
regards
gv
REPORT ZZGV099 .
TYPES:BEGIN OF WRK_CHAR,
ZZCHAR(256) TYPE C,
END OF WRK_CHAR.
DATA : ITAB01 TYPE STANDARD TABLE OF WRK_CHAR,
H_ITAB01 LIKE LINE OF ITAB01.
PARAMETERS : P_FNAME LIKE RLGRAP-FILENAME. "UP LOAD FILE
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAME .
PERFORM FILENAME_SLS .
************************************************************************
START-OF-SELECTION
************************************************************************
START-OF-SELECTION.
LOOP AT ITAB01 INTO H_ITAB01.
WRITE : / H_ITAB01-ZZCHAR.
ENDLOOP.
FORM FILENAME_SLS.
DATA : WRK_DEF_PATH(256).
DO.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_PATH = WRK_DEF_PATH
MASK = ',.txt,.txt.'
MODE = 'O'
TITLE = 'Upload file selection'
IMPORTING
FILENAME = P_FNAME
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF SY-SUBRC = 3.
EXIT.
ELSEIF SY-SUBRC = 0.
H_ITAB01-ZZCHAR = P_FNAME.
APPEND H_ITAB01 TO ITAB01.
ENDIF.
IF WRK_DEF_PATH IS INITIAL.
CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
EXPORTING
FULL_NAME = P_FNAME
IMPORTING
STRIPPED_NAME = wrk_DEF_PATH
FILE_PATH = WRK_DEF_PATH
EXCEPTIONS
X_ERROR = 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.
ENDIF.
ENDDO.
ENDFORM. " FILENAME_SLS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.