on 08-31-2006 11:45 AM
HAI
I have date data(ZDATE) in the form of MM/DD/YYYY format in oracle source system ...
I want this date data(ZDATE) in the form of YYYYMMDD format in BW.
SO hw can change this format. I think , it can be done by writing the ABAP code in TS.
So pls give the ABAP code for converting the date format from MM/DD/YYYY to YYYYMMDD
rizwan
There are no of ways for date conversion depends on requirement some are listed below
1. You can use WRITE FORMATING.
Here the sample code:
DATA: BEGDA TYPE TEXT10,
ENDDA TYPE SY-DATUM.
WRITE SY-DATUM TO BEGDA MM/DD/YYYY.
WRITE SY-DATUM TO ENDDA MM/DD/YYYY.
And of course you can use other format, like:
... DD/MM/YY
... MM/DD/YY
... DD/MM/YYYY
... MM/DD/YYYY
... DDMMYY
... MMDDYY
... YYMMDD
2. you can use concatenate statement:
concatenate SY-DATUM+4(2) SY-DATUM+6(2) SY-DATUM(4) INTO BEGDA separated by '/'.
Or
3. use FM CONVERT_DATE_TO_EXTERNAL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
to do it simpy you can extract the year , month and day into different variabales and then concatenate according to the format you want.
dest_year = sourc_date + 7(4)
dest_mm = sourc_date + 4(2)
dest_day = sourc_date + 1(2).
then concatenate all into the format you require
Concatenate dest_year dest_mm dest_day dest_day into new_date separated by /
with reaards
Suneesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use std. FM 'CONVERSION_EXIT_PDATE_INPUT', this is for DD/MM/YYYY to YYYYMMDD. you can enhance this as per your requirement.
regards,
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
***********************888
DATA : year type char 4,
month type char 2,
day type char 2,
zdate type char 8.
year = TRANSFER_STRUCTURE-/bic/ZDATE(4).
month = TRANSFER_STRUCTURE-/bic/ZDATE+4(2).
day = TRANSFER_STRUCTURE-/bic/ZDATE+6(2).
CONCATENATE year month day into zdate.
result = zdate.
*****************************
Regards,
San!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai Dinesh
Is that conversion routine converts source data from MM/DD/YYYY to YYYYMMDD format in Bw.
pls tell me confidently .
rizwan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rizwan,
You can also do this in the transfer rules using a conversion routine. Goto transfer rules -> Transfer str/Data structure -> for the date field -> select the conversion "PDATE" and then try the load.
Bye
Dinesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.