2008 Jul 14 1:13 PM
Hello,
my source machine provides dates in the format YYYYDDD (i.e. 2007091 = April 01.2007).
I need the format YYYYMMDD = 20070401.
Any Ideas in ABAB or BW-Converting routines ?
Thanks
Armin Batzelt
2008 Jul 14 1:55 PM
hi armin,
try this one
DATA: w_date_original(7) TYPE c VALUE '2007091',
w_date TYPE sy-datum,
w_date1 TYPE sy-datum.
CONCATENATE w_date_original(4) '0101' INTO w_date .
w_date = w_date + w_date_original+4(3) - 1 .
WRITE:/ w_date.
CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
EXPORTING
input = w_date
IMPORTING
OUTPUT = w_date1.
regards,
sandeep
Hello,
my source machine provides dates in the format YYYYDDD (i.e. 2007091 = April 01.2007).
I need the format YYYYMMDD = 20070401.
Any Ideas in ABAB or BW-Converting routines ?
Thanks
Armin Batzelt
2008 Jul 14 1:16 PM
Hi,
Use function module
CONVERSION_EXIT_SDATE_INPUT
You will get the required date format
Best regards,
Brijesh
2008 Jul 14 1:28 PM
Hi Brijesh,
thanks for your fast answer.
the function module CONVERSION_EXIT_SDATE_INPUT accepts dates in format 01.APR.2007, but not in my format (2007091).
Armin
2008 Jul 14 1:32 PM
Hi Armin,
Is the date format for your input is 'YYYYMMDD' ?
Cause above you have mentioned 2007091
Is it 20070401
Best Regards,
Brijesh
2008 Jul 14 1:36 PM
Hi Brijesh,
I have 2007091 and I need 20070401.
091 is the 91th day in 2007.
Armin
2008 Jul 14 1:40 PM
Hi
I can give you an idea first you find the first day of the year and the by using OFFSET u read 091 and by adding this 91 to the first day of the year you will get the result.
use this FM to get the first day and last day of the month
HR_BEN_SPENDA_FIRST_LAST_DAY
Regards
pavan
2008 Jul 14 1:50 PM
Hi pavan,
this sounds good.
i think the first day of 2007091 will be 20070101 (1. Jan).
How do I add a number of days to a date ?
Thanks
Armin
2008 Jul 14 1:19 PM
2008 Jul 14 1:33 PM
Hi santosh,
this thread is not exactly about my problem, it is another format.
Thanks Armin
2008 Jul 14 1:20 PM
hi Armin,
I would suggest some manual calculation:
DATA : lv_source(7) TYPE n,
lv_target TYPE sy-datum.
CONCATENATE lv_source(4) '0101' INTO lv_target.
lv_target = lv_target +lv_source+4(3) - 1.hope this helps
ec
2008 Jul 14 1:47 PM
Hello Armin,
You can try this way.
Your format is YYYYDDD. Take the last date digits in it into a variable Here 'num'.
data: num type i .
data: date type sy-datum,
date+0(4) = sy-datum+0(4).
date+4(2) = '01'.
date+6(2) = '01'.
date = date + num.
write date.Hope this would solve your purpose
Regards
Indu.
2008 Jul 14 1:55 PM
hi armin,
try this one
DATA: w_date_original(7) TYPE c VALUE '2007091',
w_date TYPE sy-datum,
w_date1 TYPE sy-datum.
CONCATENATE w_date_original(4) '0101' INTO w_date .
w_date = w_date + w_date_original+4(3) - 1 .
WRITE:/ w_date.
CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
EXPORTING
input = w_date
IMPORTING
OUTPUT = w_date1.
regards,
sandeep
2008 Jul 14 2:05 PM
Hi,
execute this fm OIUH_PWFROMJULIANDT
Function module OIUH_PWFROMJULIANDT
Changing parameters Value
DATE 2007091
RDATE YYYYMMDD
RCODE
Result: 2007-04-01
<just play around with this fm .
br<vijay
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |