‎2007 May 04 3:11 PM
Hi experts,
I am working on a BDC programme for uploading master data into SAP.
I have generated an ABAP programme from the transaction recording in SHDB and I have used Function GUI_UPLOAD to upload a file from the Local PC and it worked fine.
But now my file is in application server, how to load that data into my internal table and generate the BDC session?
I know that we need to use open dataset, read dataset, transfer dataset ..... but can anyone provide me the sample code for uploading file from application server.
I will appreciate your help by rewarding points.........
Thank you,
Mili.
‎2007 May 04 3:18 PM
You can use this FM <b>RZL_READ_FILE_LOCAL</b>
You need to pass the Directory and the file name and the FM will pass you an Internal Table with all the file information -;)
Works almost like using GUI_UPLOAD but with the app server -:)
Greetings,
Blag.
‎2007 May 04 3:18 PM
You can use this FM <b>RZL_READ_FILE_LOCAL</b>
You need to pass the Directory and the file name and the FM will pass you an Internal Table with all the file information -;)
Works almost like using GUI_UPLOAD but with the app server -:)
Greetings,
Blag.
‎2007 May 04 3:19 PM
To read file from applciation server, you need to use :
READ DATASET <dsn> INTO <f> [LENGTH <len>].
Check this example :
http://help.sap.com/saphelp_webas620/helpdata/en/fc/eb3d42358411d1829f0000e829fbfe/content.htm
Thanks,
SKJ
‎2007 May 04 3:22 PM
Hi,
Please check this links for sample codes.
http://www.sapdevelopment.co.uk/file/file_uploadsap.htm
http://www.sapdevelopment.co.uk/file/file_uptabsap.htm
http://www.sapdevelopment.co.uk/file/file_updown.htm
Regards,
Ferry Lianto
‎2007 May 04 3:33 PM
Hi Ferry,SKJ and Alvaro,
Thank you all for the valuable input.
I have rewarded points.........
Thank you,
Mili.
‎2007 May 04 3:29 PM
PARAMETER P_LFILE LIKE FILENAME-FILEINTERN.
to get actual file name from logical file.
data : FILE_NAME LIKE RLGRAP-FILENAME.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
LOGICAL_FILENAME = P_LFILE
IMPORTING
FILE_NAME = FILE_NAME
EXCEPTIONS
FILE_NOT_FOUND = 1
OTHERS = 2.
OPEN DATASET P_FILENAME FOR INPUT IN TEXT MODE.
DO.
READ DATASET P_FILENAME INTO WA_FLINE.
enddo.
this is not full code..just the important steps..