2010 May 14 7:37 AM
Hi Experts,
how do we need to insert a name into the dynamic file name.
For example we are getting the dynamic file name as
/zdata/G15/us/useiswtol1/glb/hroiswtl01/US16.USEISWTOL1.HROISWTL01.DAT'
so in between HROISWTL01 and .DAT we need to insert a name called FLAG.
Regards,
Harish Kasyap.
Hi Experts,
how do we need to insert a name into the dynamic file name.
For example we are getting the dynamic file name as
/zdata/G15/us/useiswtol1/glb/hroiswtl01/US16.USEISWTOL1.HROISWTL01.DAT'
so in between HROISWTL01 and .DAT we need to insert a name called FLAG.
Regards,
Harish Kasyap.
2010 May 14 7:43 AM
>
> For example we are getting the dynamic file name as
> /zdata/G15/us/useiswtol1/glb/hroiswtl01/US16.USEISWTOL1.HROISWTL01.DAT'
Where are you getting the dynamic filename from ?
2010 May 14 7:48 AM
Hi Suhas,
we are getting the name from a functional module which is specific to our system and we cant change it.how to insert the name after retrieving the file name
2010 May 14 7:54 AM
Which FM you are using to get dynamic file name ? is it FILE_GET_NAME or something else ? If you are using FM to get dynamic file name then check the parameter whether the FM returning only file name or not
2010 May 14 8:11 AM
Yes, u can say we are using the Fm GET_FILE_NAME ...but after we get the FILE NAME we need to insert FLAG in the middle.
2010 May 14 9:18 AM
Hi,
just usef fm /SAPDMC/LSM_PATH_FILE_SPLIT, it will split the file name and path name.
path = /zdata/G15/us/useiswtol1/glb/hroiswtl01/US16.USEISWTOL1.
filename = HROISWTL01.DAT
concatenate path 'FLAG' filename into path.
2010 May 14 9:22 AM
Hi Keshav,
if the file and path name is this
/ZDATA/G15/US/USEISWTOL1/GLB/HROISWTL01/US16.USEISWTOL1.HROISWTL01.000000000341.DAT
We need to replace the sequence number which we are getting at the end with a name called 'FLAG'
We cannot use " REPLACE" command as the sequence number changes dynamically
Regards,
Vishal'
Edited by: vishal_reddy786 on May 14, 2010 10:23 AM
2010 May 14 9:36 AM
We cannot use " REPLACE" command as the sequence number changes dynamically
Actually what do you want to replace.
is it the name of the file or anything else ?
2010 May 14 9:56 AM
Keshav,
As i said we are getting a sequence number in the end...... for example '000000000341'.
This sequence number should be replaced with a name called 'FLAG'.
Hope u got my point.'
Edited by: vishal_reddy786 on May 14, 2010 10:58 AM
2010 May 14 10:24 AM
Some more questions:
Is it always the same length , same position ?
After splitting the path and file how will the result look ( considering the path from your question ).
2010 May 14 10:38 AM
Yes Keshav,
The same lenght and same postion.
/ZDATA/G15/US/USEISWTOL1/GLB/HROISWTL01/US16.USEISWTOL1.HROISWTL01.000000000341.DAT
instead of above we need to get
/ZDATA/G15/US/USEISWTOL1/GLB/HROISWTL01/US16.USEISWTOL1.HROISWTL01.FLAG.DAT
2010 May 14 10:43 AM
so after splitting your file name will be 000000000341.DAT .
split filename at '.' into part1 part2.
concatenate path 'FLAG' '.' part2 into path.
or
if filename ca '.'.
sy-fdpos = sy-fdpos - 1.
filename+0(syfd-pos) = 'FLAG'.
clear path.
concatenate path filename into path.
2010 May 14 11:21 AM
Hi Vishal,
Do this...
Split whole of your string into itab separated by '.'.
split <path> at '.' into table it_text.Now, the second last record of your int tab would be the number you want to replace by "FLAG".Just replace it with FLAG.Now loop at it_text and merge the path into string again.Regards,
Sumit
2010 May 14 12:26 PM
2010 May 14 12:32 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |