‎2007 Jul 05 2:49 AM
hi,
i have a BDC program to be done however the file is in File server so wht shud i do inorder to access the file the file server for example the path is given :
127.1.1.10\SharedFolder\20070704.txt
and i have authorization set on it and i have been given a user id and password to access the folder so wht shud i be doin to read the file from the given location
‎2007 Jul 05 4:35 AM
Create a Logical Path for this Physical path in tcode FILE.
Pass this logical path to your Program.
Use OPEN DATASET to access the file at this path.
Most important thing this system should be in the same network as of your machine (SAP SERVER).
Since you are given an IP address, so you can also try for FTP download as an alternative. This will save you from network issue.
For sample codes for both just search the forum with <b>'FTP DOWNLOAD'</b> & <b>'APPLICATION SERVER'</b>.
Regards,
Amit
reward all helpful replies.
‎2007 Jul 05 4:35 AM
Ask the BASIS people to map this path in your application server.
Once mapped read file contents using
OPEN DATASET <dir>.
CLOSE DATASET.
<dir> is the path to the application server pointing to the your desired file.
Regards,
A.Singh
‎2007 Jul 05 7:01 AM
Hi
Use the Tcode CG3Y to bring the file from Application to Local server and write the ordinary BDC code
other wise
Use OPEN DATASET concept..
READ dataset
TRANSFER dataset
CLOSE dataset
see the sample code
START-OF-SELECTION.
ld_file = p_infile.
OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
ELSE.
DO.
CLEAR: wa_string, wa_uploadtxt.
READ DATASET ld_file INTO wa_string.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
wa_uploadtxt-name2
wa_uploadtxt-age.
MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
APPEND wa_upload TO it_record.
ENDIF.
ENDDO.
CLOSE DATASET ld_file.
ENDIF.
Reward points for useful Answers
Regards
Anji