2008 Mar 13 5:49 AM
Hi all,
I need to format the date as follows:
input date format : 20070506 (system date format )
required output date format : 05.06.2007
I tried with the FMs CONVERSION_EXIT_SDATE_OUTPUT,CONVERSION_EXIT_LDATE_OUTPUT
I get the output as 05.May.2007. This is not what is needed.
Please let me know how to I get the reqd date format VERY URGENT
Thanks & Regards,
Srilakshmi B
2008 Mar 13 5:58 AM
Hi
Input date format : 20070506 (system date format )
Required output date format : 05.06.2007
DATA : DAT1 TYPE DATS VALUE '20070506,
DAT2 TYPE STRING.
U can use CONCATENATE DAT14(2) '.' DAT16(2) '.' DAT1+0(4) TO DAT2.
Regards,
Mayank
Hi
Input date format : 20070506 (system date format )
Required output date format : 05.06.2007
DATA : DAT1 TYPE DATS VALUE '20070506,
DAT2 TYPE STRING.
U can use CONCATENATE DAT14(2) '.' DAT16(2) '.' DAT1+0(4) TO DAT2.
Regards,
Mayank
2008 Mar 13 5:53 AM
Hi Srilakshmi,
Just split that date and insert into 3 workareas and display.
Regards,
dvns
2008 Mar 13 5:53 AM
2008 Mar 13 5:54 AM
Use the Function Module CONVERT_DATE_TO_EXTERNAL to convert the date to the external format.
2008 Mar 13 5:54 AM
data: l_dat(10).
concatenate sy-datum+6(2)
'.'
sy-datum+4(2)
'.'
sy-datum+0(4) into l_dat.
2008 Mar 13 5:54 AM
Hi,.
you can use offset opperator, like this
data: v_datum(10) type c.
concatenate sy-datum+4(2) '.' sy-datum +2(2) '.' sy-datum +0(4) to v_datum.
write:/ v_datum.
Regards,
S.Nehru
2008 Mar 13 5:58 AM
Hi,
Use FM CONVERT_DATE_TO_EXTERNAL or
CONVERT_DATE_TO_INTERNAL
2008 Mar 13 5:58 AM
Hi
Input date format : 20070506 (system date format )
Required output date format : 05.06.2007
DATA : DAT1 TYPE DATS VALUE '20070506,
DAT2 TYPE STRING.
U can use CONCATENATE DAT14(2) '.' DAT16(2) '.' DAT1+0(4) TO DAT2.
Regards,
Mayank
2008 Mar 13 6:05 AM
Thanks all for the response..will award points
I used a FM. It gives a output 06052007.
All i need to do now is put a '.' to get 06.05.2007.
Is this possible ?
2008 Mar 13 6:11 AM
Hi,
U Can use CONCATENATE keyword to achieve the same.
Just manipulate my previous post a little bit.
Regards,
Mayank
2008 Mar 13 6:22 AM
Hi,
Have a look on the following code u can get the solution.
DATA: VAR1 TYPE SY-DATUM value '20080313',
VAR2 TYPE SY-DATUM.
This gives the previous month and next month
CALL FUNCTION 'HR_PT_ADD_MONTH_TO_DATE'
EXPORTING
dmm_datin = var1
dmm_count = '0'
dmm_oper = '-' " Operation (add/subtract)
dmm_pos = 'B' " Set date in the beginning or end of month
IMPORTING
DMM_DAOUT = VAR2
EXCEPTIONS
UNKNOWN = 1
OTHERS = 2.
write:/ var2.
This function module is used to get the previous month/next month.
Regards,
Chandu.
2008 Mar 14 1:06 PM
hey you can directly use this date format without any '.' in your transaction. Otherwise use offset operator by concatenating each variable with '.'
Reward points if use full.
Thanks,
Swapna
2008 Mar 13 6:11 AM
hi....
DATA: yyyy TYPE string.
DATA: mm TYPE string.
DATA: dd TYPE string.
LOOP AT date.
dd = date-eindt+6(2).
mm = date-eindt+4(2).
yyyy = date-eindt+2(4).
CONCATENATE dd mm yyyy INTO date-date1 ."SEPARATED BY '.' .
modify date .
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM date.
2008 Mar 13 6:16 AM
yes it is possible.
create one vatiable to hold the date with saperaters, size should be 10
data: date1(10) type c.
write: sy-datum to date1 using edit mask '__.__.____'.
regards.
santhosh reddy
Edited by: Santhosh Reddy on Mar 13, 2008 11:50 AM
2008 Mar 14 1:14 PM
simple solution
write:/ sy-datum using edit mask '__.__.____'.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |