2008 Jul 11 1:03 AM
I have a DSO that has a date field like:
ZDATE DATS 8 references 0date
and I have a transformation that needs to load the run_date.
So my abap looks like:
DATA: my_date(10) type C.
DATA: my_mm(2) type C,
my_dd(2) type C,
my_yy(4) type C.
WRITE sy-datum to my_date MM/DD/YYYY.
my_mm = my_date+0(2).
my_dd = my_date+3(2).
my_yy = my_date+6(4).
concatenate my_mm my_dd my_yy to zdate
but this fails to activate in my DSO because its the wrong format.
I'm not getting that. Do I somehow have to specify that my variable is like 0DATE?
2008 Jul 11 5:22 AM
HI,
You have to concatenate the variables as follows...
concatenate my_yy my_mm my_dd to zdate. (YYYYMMDD Format).
Hope it helps you.
Murthy
2008 Jul 11 2:12 AM
Hi,
Use FM 'CONVERT_DATE_TO_INTERN_FORMAT'
give exporting parameters as
datum = (Date you wat to convert)
dtype = 'DATS'
importing
ERROR =
idate = l_budat
MESSG =
MSGLN =
This should correct your error.
Regards,
Nikhil
Edited by: Nikhil A Chitre on Jul 11, 2008 11:12 AM
Edited by: Nikhil A Chitre on Jul 11, 2008 11:14 AM
2008 Jul 11 5:22 AM
HI,
You have to concatenate the variables as follows...
concatenate my_yy my_mm my_dd to zdate. (YYYYMMDD Format).
Hope it helps you.
Murthy
2008 Jul 11 5:28 AM
Try to use:
concatenate my_yy my_mm my_dd to zdate.
As zdate is a dats field so it stores date internally in YYYYMMDD format.
Regards,
Joy.
2008 Jul 11 5:46 AM
Hi Michael,
Use the Function Module: 'CONVERT_DATE_TO_INTERN_FORMAT'
&************Reward point if helpful**************&
2008 Jul 13 2:38 AM
We didnt have the FM 'CONVERT_DATE_TO_INTERN_FORMAT'
Also, just changing the order of the fields was a quick change.
I was putting in the wrong format mmddyyyy and so using yyyymmdd solved the problem.
Thanks a bunch
2008 Jul 11 6:01 AM
Hi,
Check out with this code hope this will help u.
DATA: my_date(10) type C,
z_date(10) type c.
DATA: my_mm(2) type C,
my_dd(2) type C,
my_yy(4) type C.
WRITE sy-datum to my_date .
write my_date.
my_yy = my_date+0(4).
my_mm = my_date+5(2).
my_dd = my_date+8(2).
concatenate my_yy my_mm my_dd into z_date.
write: z_date.
Regards,
Sravanthi
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |