2009 Apr 16 4:53 AM
Hi all,
my client wants to schedule a BDC program for daily running.
But the file name is changed daily eventhough path is fixed.
can this be done.
can we read dynamic file from local system.
thanks in advance
Vikash.
2009 Apr 16 5:00 AM
Hello,
Although the path remains the same and the filename changes, is there any common pattern in the name of the file?
for eg..
..../ abc_20090416.txt, etc
If the name of file is dynamic based on either the current date or current time, we can handle these dynamic files in our program. But if the name of the file changes altogther handling it wont be possible. think about some common pattern for filename.
Hope i am clear.
Regards,
Mansi.
Hello,
Although the path remains the same and the filename changes, is there any common pattern in the name of the file?
for eg..
..../ abc_20090416.txt, etc
If the name of file is dynamic based on either the current date or current time, we can handle these dynamic files in our program. But if the name of the file changes altogther handling it wont be possible. think about some common pattern for filename.
Hope i am clear.
Regards,
Mansi.
2009 Apr 16 5:00 AM
Hello,
Although the path remains the same and the filename changes, is there any common pattern in the name of the file?
for eg..
..../ abc_20090416.txt, etc
If the name of file is dynamic based on either the current date or current time, we can handle these dynamic files in our program. But if the name of the file changes altogther handling it wont be possible. think about some common pattern for filename.
Hope i am clear.
Regards,
Mansi.
2009 Apr 16 5:17 AM
Hi ,
yes the file has the name pattern "SAP Forex Upload_10042009.xls" the dates will keep on changing..
with warm regards.
vikash
2009 Apr 16 5:26 AM
yes. so u can at initialissation for the paramter which takes the filepath name you can set to synamic filename as below
data : p_filename type RSVAR-FILEPATH.
initialization.
concatenate '/....SAP Forex Upload_' sy-datum+06(02) sy-datum+04(02) sy-datum+00(04) into p_filename.
2009 Apr 16 5:00 AM
Hi Vikas,
It can be done, just make some rule for the file name, like filename will be always the system date,
so as u know the path just u need to concatenate the system date with the file path and u can pass to the gui_upload FM to upload the file for the BDC.
Hope u get my point.
Amresh.
2009 Apr 16 5:30 AM
Hi Amresh,
Can u elaborate the solution.
the excel file is having a fixed pattern name that is "ddmmyyyy.xls"
what i need to concatenate .
currently i have put file path as parameter.
can u give me any sample code so that it ll be easy for me to understand.
Thanks in advance
Vikash
2009 Apr 16 5:40 AM
in the initialization event...
concatenate p_path sy-datum '.xls' into p_path.
and use this p_path in gui_upload or open dataset... to read the file...
or you can provide a p_date type d in the selection screen and concatenate p_path p_date '.xls' into p_path.
2009 Apr 16 5:16 AM
hi,
yes it is possible, make sure that u r file name pattern and input file pattern should be same. in such a way that make the file name it is easy to handle.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |