2008 May 05 10:25 AM
Hi all,
I have an internal table 'tabl'.In this internal table the paths and names of all the pdf files in SAP directory are stored seperated by '/'.This table consists of a single field of type C.The name of the pdf file consists of the order no,organisation ,month and year of that file creation.
I have a requirement to extract the month and year from the name of the file.Can anyone suggest how to break the internal table to get the month and year.
Thank You.
2008 May 05 10:30 AM
hi
you can use regular expressions for this
see
[https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/866072ca-0b01-0010-54b1-9c02a45ba8aa]
[http://help.sap.com/saphelp_erp2005/helpdata/en/42/9d6ceabb211d73e10000000a1553f6/content.htm]
bye bye
Hi all,
I have an internal table 'tabl'.In this internal table the paths and names of all the pdf files in SAP directory are stored seperated by '/'.This table consists of a single field of type C.The name of the pdf file consists of the order no,organisation ,month and year of that file creation.
I have a requirement to extract the month and year from the name of the file.Can anyone suggest how to break the internal table to get the month and year.
Thank You.
2008 May 05 10:30 AM
hi
you can use regular expressions for this
see
[https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/866072ca-0b01-0010-54b1-9c02a45ba8aa]
[http://help.sap.com/saphelp_erp2005/helpdata/en/42/9d6ceabb211d73e10000000a1553f6/content.htm]
bye bye
2008 May 05 10:30 AM
Hi Rohan,
You can use SPLIT command.
Hope it helps.
Reward if helpful.
Regards
Hemant Khemani
2008 May 05 10:41 AM
Hi,
If your month and year format is MM and YY then firstly count the length of the whole string i.e your single record.
suppose length of the string is 10 and above date format i.e MM and YY then fetch last 4 characters from your string[just like sub string]. you will get month and year.
2008 May 05 10:41 AM
hi rohan,
do like this ,
loop at itab into text.
SPLIT text AT '/' INTO: str1 str2 str3, ...
file = str1.
year = str2.
.
.
clear text.
endloop.
reward if useful,
regards,
chandu
2008 May 05 10:44 AM
hi you can do in this way:
suppose file name is in name1. and value of this file can be in this format -
062008. blank is name of file 06 is month and 2008 is year.
to extract month and year do like :
data: month(2) , year(4).
data: len type i, tmp type i.
len = strlen(name1).
tmp = len - 6.
month = name1+tmp(2).
tmp = tmp + 2.
year = name1+tmp(4).
now you can use month and year.
reward if useful.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |