‎2008 Jan 04 1:27 PM
Hi all,
I am new to SAP.
Could someone help me in uploading csv files. It would be of great help.
Thanks,
Aishwarya.
‎2008 Jan 04 3:06 PM
if you're using LSMW transaction to upload data into SAP, then all you have to do is click Comma in Delimiter radiobutton in legacy file (Specify files step). It is assumed you saved the excel as csv format text file first, then you used this file as legacy data
if you're writing your own ABAP program to upload data, then use SPLIT...AT <delimiter> command, in this case SPLIT ... AT ','.
Edited by: Harris Veziris on Jan 4, 2008 4:06 PM
‎2008 Jan 04 3:11 PM
Hello,
i which that this code will help you :
Recherche le chemin du fichier via popup windows
perform call_file using p_fic_pc.
*&----
-
*& Form call_file
*&----
-
FORM call_file USING p_fic_pc.
Sélection du fichier csv en entrée à partir de l'arborescence windows
dans le paramètre p_fic_pc.
CLEAR p_fic_pc.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
static = 'X'
mask = ',Fichier .csv,csv*.'
IMPORTING
filename = p_fic_pc
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
IF sy-subrc <> 0 AND sy-subrc <> 3.
MESSAGE e398(00) WITH text-007.
ENDIF.
ENDFORM. " call_file
========================================================================
FORM upload_pc_file.
Variable contenant le nom du fichier au format attendu par le module
fonction
DATA: w_file TYPE string.
CLEAR w_file.
REFRESH t_file.
w_file = p_fic_pc.
Appel du module focntion de chargement du fichier
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = w_file
filetype = 'ASC'
TABLES
data_tab = t_line
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 e398(00) WITH text-006.
ENDIF.
ENDFORM.
Reward me if helpful.
Mustapha