11-05-2008 4:54 PM
Hello,
I am getting input string as YYYYMMD. I want it to be converted to date format based on the format that user has in his profile.
So if user has MM/DD/YYY or DD.MM.YYYY or any other ata from user data paramets, I want to convert it into that format.
I tried using FM Convert_date_to_external but it has issue since when I test it does not take data in YYYYMMDD format.
Please hlep.
Regards,
rajesh.
11-05-2008 4:59 PM
you can simple use write to convert to the format in the user profile.
parameters : p_date TYPE mkpf-budat.
data : v_date(10) TYPE C.
Write p_date TO v_date.
11-05-2008 4:59 PM
you can simple use write to convert to the format in the user profile.
parameters : p_date TYPE mkpf-budat.
data : v_date(10) TYPE C.
Write p_date TO v_date.
11-05-2008 5:13 PM
11-05-2008 5:00 PM
11-05-2008 5:00 PM
I guess you are trying in SE37 test. it wouldnt work there, you can try that in yoru code
11-05-2008 5:01 PM
11-05-2008 5:10 PM
Use FM DATUMSAUFBEREITUNG
I used like this and it worked for me:
data: idate TYPE sy-datum,
tdat8 type string.
idate = p_budat.
CALL FUNCTION 'DATUMSAUFBEREITUNG'
EXPORTING
IDATE = idate
IMPORTING
TDAT8 = tdat8" get user format date here
* EXCEPTIONS
* DATFM_UNGUELTIG = 1
* DATUM_UNGUELTIG = 2
* OTHERS = 3.
11-05-2008 5:28 PM
Hi Rajesh,
1. Define a variable with type 'DATS'.
2. Move input date string 'YYYYMMDD' to this.
3. Write this date variable to Output string.
DATA : v_date type dats,
output_date_string(10) type c .
v_date = input_date_string .
write v_date to output_date_string .
And output_date_string will contain the date in user defined date format.
Thanks,
Aditya. V